58 return 8 * 4 + 4;
59 }
60
61 void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
62 __ bind(entry());
63 __ rt_call(StubRoutines::method_entry_barrier());
64
65 __ j(continuation());
66
67 // make guard value 4-byte aligned so that it can be accessed by atomic instructions on RISC-V
68 __ align(4);
69 __ bind(guard());
70 __ relocate(entry_guard_Relocation::spec());
71 __ emit_int32(0); // nmethod guard value
72 }
73
74 int C2HandleAnonOMOwnerStub::max_size() const {
75 // Max size of stub has been determined by testing with 0 without using RISC-V compressed
76 // instruction-set extension, in which case C2CodeStubList::emit() will throw an assertion
77 // and report the actual size that is needed.
78 return 20 DEBUG_ONLY(+8);
79 }
80
81 void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
82 __ bind(entry());
83 Register mon = monitor();
84 Register t = tmp();
85 assert(t != noreg, "need tmp register");
86
87 // Fix owner to be the current thread.
88 __ sd(xthread, Address(mon, ObjectMonitor::owner_offset()));
89
90 // Pop owner object from lock-stack.
91 __ lwu(t, Address(xthread, JavaThread::lock_stack_top_offset()));
92 __ subw(t, t, oopSize);
93 #ifdef ASSERT
94 __ add(t0, xthread, t);
95 __ sd(zr, Address(t0, 0));
96 #endif
97 __ sw(t, Address(xthread, JavaThread::lock_stack_top_offset()));
98
99 __ j(continuation());
100 }
101
102 #undef __
|
58 return 8 * 4 + 4;
59 }
60
61 void C2EntryBarrierStub::emit(C2_MacroAssembler& masm) {
62 __ bind(entry());
63 __ rt_call(StubRoutines::method_entry_barrier());
64
65 __ j(continuation());
66
67 // make guard value 4-byte aligned so that it can be accessed by atomic instructions on RISC-V
68 __ align(4);
69 __ bind(guard());
70 __ relocate(entry_guard_Relocation::spec());
71 __ emit_int32(0); // nmethod guard value
72 }
73
74 int C2HandleAnonOMOwnerStub::max_size() const {
75 // Max size of stub has been determined by testing with 0 without using RISC-V compressed
76 // instruction-set extension, in which case C2CodeStubList::emit() will throw an assertion
77 // and report the actual size that is needed.
78 return 24 DEBUG_ONLY(+8);
79 }
80
81 void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) {
82 __ bind(entry());
83 Register mon = monitor();
84 Register t = tmp();
85 assert(t != noreg, "need tmp register");
86
87 // Fix owner to be the current thread.
88 __ mv(t, Address(xthread, JavaThread::lock_id_offset()));
89 __ sd(t, Address(mon, ObjectMonitor::owner_offset()));
90
91 // Pop owner object from lock-stack.
92 __ lwu(t, Address(xthread, JavaThread::lock_stack_top_offset()));
93 __ subw(t, t, oopSize);
94 #ifdef ASSERT
95 __ add(t0, xthread, t);
96 __ sd(zr, Address(t0, 0));
97 #endif
98 __ sw(t, Address(xthread, JavaThread::lock_stack_top_offset()));
99
100 __ j(continuation());
101 }
102
103 #undef __
|