src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
Print this page
rev 7516 : 8069593: AARCH64: Changes to JavaThread::_thread_state must use acquire and release
Summary: Use release stores for all changes to thread state.
Reviewed-by: kvn
*** 1843,1853 ****
__ lea(c_rarg0, Address(rthread, in_bytes(JavaThread::jni_environment_offset())));
}
// Now set thread in native
__ mov(rscratch1, _thread_in_native);
! __ str(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
{
int return_type = 0;
switch (ret_type) {
case T_VOID: break;
--- 1843,1854 ----
__ lea(c_rarg0, Address(rthread, in_bytes(JavaThread::jni_environment_offset())));
}
// Now set thread in native
__ mov(rscratch1, _thread_in_native);
! __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
! __ stlrw(rscratch1, rscratch2);
{
int return_type = 0;
switch (ret_type) {
case T_VOID: break;
*** 1900,1910 ****
// Java thread A, in _thread_in_native state, loads _not_synchronized and is preempted.
// VM thread changes sync state to synchronizing and suspends threads for GC.
// Thread A is resumed to finish this native method, but doesn't block here since it
// didn't see any synchronization is progress, and escapes.
__ mov(rscratch1, _thread_in_native_trans);
! __ str(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
if(os::is_MP()) {
if (UseMembar) {
// Force this write out before the read below
__ dmb(Assembler::SY);
--- 1901,1912 ----
// Java thread A, in _thread_in_native state, loads _not_synchronized and is preempted.
// VM thread changes sync state to synchronizing and suspends threads for GC.
// Thread A is resumed to finish this native method, but doesn't block here since it
// didn't see any synchronization is progress, and escapes.
__ mov(rscratch1, _thread_in_native_trans);
! __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
! __ stlrw(rscratch1, rscratch2);
if(os::is_MP()) {
if (UseMembar) {
// Force this write out before the read below
__ dmb(Assembler::SY);
*** 1964,1974 ****
__ bind(Continue);
}
// change thread state
__ mov(rscratch1, _thread_in_Java);
! __ str(rscratch1, Address(rthread, JavaThread::thread_state_offset()));
__ bind(after_transition);
Label reguard;
Label reguard_done;
__ ldrb(rscratch1, Address(rthread, JavaThread::stack_guard_state_offset()));
--- 1966,1977 ----
__ bind(Continue);
}
// change thread state
__ mov(rscratch1, _thread_in_Java);
! __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
! __ stlrw(rscratch1, rscratch2);
__ bind(after_transition);
Label reguard;
Label reguard_done;
__ ldrb(rscratch1, Address(rthread, JavaThread::stack_guard_state_offset()));