Skip to content

Commit

Permalink
poc of lightweight native memory barrier
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaiwei committed Jul 11, 2024
1 parent f8a6c79 commit 8a67181
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1881,10 +1881,15 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,

if(os::is_MP()) {
if (UseMembar) {
__ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
if(UseNewCode2) {
__ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
__ stlrw(rscratch1, rscratch2);
} else {
__ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset()));

// Force this write out before the read below
__ dmb(Assembler::ISH);
// Force this write out before the read below
__ dmb(Assembler::ISH);
}
} else {
__ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
__ stlrw(rscratch1, rscratch2);
Expand Down

0 comments on commit 8a67181

Please sign in to comment.