Skip to content

Commit

Permalink
8341451: Remove C2HandleAnonOMOwnerStub
Browse files Browse the repository at this point in the history
Reviewed-by: fyang, chagedorn
  • Loading branch information
xmas92 committed Oct 4, 2024
1 parent d3139b4 commit 3f420fa
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 70 deletions.
27 changes: 0 additions & 27 deletions src/hotspot/cpu/aarch64/c2_CodeStubs_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,4 @@ void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
__ emit_int32(0); // nmethod guard value
}

int C2HandleAnonOMOwnerStub::max_size() const {
// Max size of stub has been determined by testing with 0, in which case
// C2CodeStubList::emit() will throw an assertion and report the actual size that
// is needed.
return 24;
}

void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
__ bind(entry());
Register mon = monitor();
Register t = tmp();
assert(t != noreg, "need tmp register");

// Fix owner to be the current thread.
__ str(rthread, Address(mon, ObjectMonitor::owner_offset()));

// Pop owner object from lock-stack.
__ ldrw(t, Address(rthread, JavaThread::lock_stack_top_offset()));
__ subw(t, t, oopSize);
#ifdef ASSERT
__ str(zr, Address(rthread, t));
#endif
__ strw(t, Address(rthread, JavaThread::lock_stack_top_offset()));

__ b(continuation());
}

#undef __
28 changes: 0 additions & 28 deletions src/hotspot/cpu/riscv/c2_CodeStubs_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,4 @@ void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
__ emit_int32(0); // nmethod guard value
}

int C2HandleAnonOMOwnerStub::max_size() const {
// Max size of stub has been determined by testing with 0 without using RISC-V compressed
// instruction-set extension, in which case C2CodeStubList::emit() will throw an assertion
// and report the actual size that is needed.
return 20 DEBUG_ONLY(+8);
}

void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
__ bind(entry());
Register mon = monitor();
Register t = tmp();
assert(t != noreg, "need tmp register");

// Fix owner to be the current thread.
__ sd(xthread, Address(mon, ObjectMonitor::owner_offset()));

// Pop owner object from lock-stack.
__ lwu(t, Address(xthread, JavaThread::lock_stack_top_offset()));
__ subw(t, t, oopSize);
#ifdef ASSERT
__ add(t0, xthread, t);
__ sd(zr, Address(t0, 0));
#endif
__ sw(t, Address(xthread, JavaThread::lock_stack_top_offset()));

__ j(continuation());
}

#undef __
15 changes: 0 additions & 15 deletions src/hotspot/share/opto/c2_CodeStubs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ class C2FastUnlockLightweightStub : public C2CodeStub {
Label& slow_path_continuation() { return continuation(); }
};

#ifdef _LP64
class C2HandleAnonOMOwnerStub : public C2CodeStub {
private:
Register _monitor;
Register _tmp;
public:
C2HandleAnonOMOwnerStub(Register monitor, Register tmp = noreg) : C2CodeStub(),
_monitor(monitor), _tmp(tmp) {}
Register monitor() { return _monitor; }
Register tmp() { return _tmp; }
int max_size() const;
void emit(C2_MacroAssembler& masm);
};
#endif

//-----------------------------C2GeneralStub-----------------------------------
// A generalized stub that can be used to implement an arbitrary stub in a
// type-safe manner. An example:
Expand Down

1 comment on commit 3f420fa

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.