2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -1883,16 +1883,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
1883
1883
1884
1884
// Check for safepoint operation in progress and/or pending suspend requests.
1885
1885
{
1886
- // We need an acquire here to ensure that any subsequent load of the
1887
- // global SafepointSynchronize::_state flag is ordered after this load
1888
- // of the thread-local polling word. We don't want this poll to
1889
- // return false (i.e. not safepointing) and a later poll of the global
1890
- // SafepointSynchronize::_state spuriously to return true.
1891
- //
1892
- // This is to avoid a race when we're in a native->Java transition
1893
- // racing the code which wakes up from a safepoint.
1894
-
1895
- __ safepoint_poll (safepoint_in_progress, true /* at_return */ , true /* acquire */ , false /* in_nmethod */ );
1886
+ // No need for acquire as Java threads always disarm themselves.
1887
+ __ safepoint_poll (safepoint_in_progress, true /* at_return */ , false /* acquire */ , false /* in_nmethod */ );
1896
1888
__ ldrw (rscratch1, Address (rthread, JavaThread::suspend_flags_offset ()));
1897
1889
__ cbnzw (rscratch1, safepoint_in_progress);
1898
1890
__ bind (safepoint_in_progress_done);
Original file line number Diff line number Diff line change @@ -1413,15 +1413,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
1413
1413
{
1414
1414
Label L, Continue;
1415
1415
1416
- // We need an acquire here to ensure that any subsequent load of the
1417
- // global SafepointSynchronize::_state flag is ordered after this load
1418
- // of the thread-local polling word. We don't want this poll to
1419
- // return false (i.e. not safepointing) and a later poll of the global
1420
- // SafepointSynchronize::_state spuriously to return true.
1421
- //
1422
- // This is to avoid a race when we're in a native->Java transition
1423
- // racing the code which wakes up from a safepoint.
1424
- __ safepoint_poll (L, true /* at_return */ , true /* acquire */ , false /* in_nmethod */ );
1416
+ // No need for acquire as Java threads always disarm themselves.
1417
+ __ safepoint_poll (L, true /* at_return */ , false /* acquire */ , false /* in_nmethod */ );
1425
1418
__ ldrw (rscratch2, Address (rthread, JavaThread::suspend_flags_offset ()));
1426
1419
__ cbz (rscratch2, Continue);
1427
1420
__ bind (L);
0 commit comments