--- old/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp 2015-01-21 10:23:23.953567256 -0500 +++ new/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp 2015-01-21 10:23:23.713588510 -0500 @@ -1845,7 +1845,8 @@ // Now set thread in native __ mov(rscratch1, _thread_in_native); - __ str(rscratch1, Address(rthread, JavaThread::thread_state_offset())); + __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset())); + __ stlrw(rscratch1, rscratch2); { int return_type = 0; @@ -1902,7 +1903,8 @@ // 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())); + __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset())); + __ stlrw(rscratch1, rscratch2); if(os::is_MP()) { if (UseMembar) { @@ -1966,7 +1968,8 @@ // change thread state __ mov(rscratch1, _thread_in_Java); - __ str(rscratch1, Address(rthread, JavaThread::thread_state_offset())); + __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset())); + __ stlrw(rscratch1, rscratch2); __ bind(after_transition); Label reguard; --- old/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp 2015-01-21 10:23:25.353443272 -0500 +++ new/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp 2015-01-21 10:23:25.123463641 -0500 @@ -1097,7 +1097,8 @@ // Change state to native __ mov(rscratch1, _thread_in_native); - __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset())); + __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset())); + __ stlrw(rscratch1, rscratch2); // Call the native method. __ blrt(r10, rscratch1); @@ -1118,7 +1119,8 @@ // change thread state __ mov(rscratch1, _thread_in_native_trans); - __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset())); + __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset())); + __ stlrw(rscratch1, rscratch2); if (os::is_MP()) { if (UseMembar) { @@ -1165,7 +1167,8 @@ // change thread state __ mov(rscratch1, _thread_in_Java); - __ strw(rscratch1, Address(rthread, JavaThread::thread_state_offset())); + __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset())); + __ stlrw(rscratch1, rscratch2); // reset_last_Java_frame __ reset_last_Java_frame(true, true); --- old/src/share/vm/runtime/thread.hpp 2015-01-21 10:23:26.743320174 -0500 +++ new/src/share/vm/runtime/thread.hpp 2015-01-21 10:23:26.493342314 -0500 @@ -1016,7 +1016,7 @@ address last_Java_pc(void) { return _anchor.last_Java_pc(); } // Safepoint support -#ifndef PPC64 +#if ! (defined(PPC64) || defined(AARCH64)) JavaThreadState thread_state() const { return _thread_state; } void set_thread_state(JavaThreadState s) { _thread_state = s; } #else --- old/src/share/vm/runtime/thread.inline.hpp 2015-01-21 10:23:28.113198848 -0500 +++ new/src/share/vm/runtime/thread.inline.hpp 2015-01-21 10:23:27.873220102 -0500 @@ -122,7 +122,7 @@ set_has_async_exception(); } -#ifdef PPC64 +#if defined(PPC64) || defined (AARCH64) inline JavaThreadState JavaThread::thread_state() const { return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state); }