# HG changeset patch # User rehn # Date 1541578789 -3600 # Wed Nov 07 09:19:49 2018 +0100 # Node ID 963d9692005d2c0d420831f6068a43e5da82e80a # Parent b0af758a092cdf44ebc275c28e4737fc769a3a9f imported patch 8211403 diff --git a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp --- a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp @@ -381,7 +381,7 @@ // Handle safepoint operations, pending suspend requests, // and pending asynchronous exceptions. - if (SafepointMechanism::poll(thread) || + if (SafepointMechanism::should_block(thread) || thread->has_special_condition_for_native_trans()) { JavaThread::check_special_condition_for_native_trans(thread); CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops()); @@ -513,7 +513,7 @@ intptr_t *locals = stack->sp(); // Drop into the slow path if we need a safepoint check - if (SafepointMechanism::poll(THREAD)) { + if (SafepointMechanism::should_block(THREAD)) { return normal_entry(method, 0, THREAD); } @@ -645,7 +645,7 @@ ZeroStack *stack = thread->zero_stack(); // Drop into the slow path if we need a safepoint check - if (SafepointMechanism::poll(THREAD)) { + if (SafepointMechanism::should_block(THREAD)) { return normal_entry(method, 0, THREAD); } diff --git a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp --- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp +++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp @@ -918,7 +918,7 @@ last_pc_offset = pc_offset; JavaThread* thread = JavaThread::current(); - if (SafepointMechanism::poll(thread)) { + if (SafepointMechanism::should_block(thread)) { // this is a hacky way to force a safepoint check but nothing else was jumping out at me. ThreadToNativeFromVM ttnfv(thread); } diff --git a/src/hotspot/share/runtime/interfaceSupport.inline.hpp b/src/hotspot/share/runtime/interfaceSupport.inline.hpp --- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp +++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp @@ -162,7 +162,7 @@ // We never install asynchronous exceptions when coming (back) in // to the runtime from native code because the runtime is not set // up to handle exceptions floating around at arbitrary points. - if (SafepointMechanism::poll(thread) || thread->is_suspend_after_native()) { + if (SafepointMechanism::should_block(thread) || thread->is_suspend_after_native()) { JavaThread::check_safepoint_and_suspend_for_native_trans(thread); // Clear unhandled oops anywhere where we could block, even if we don't. diff --git a/src/hotspot/share/runtime/mutex.cpp b/src/hotspot/share/runtime/mutex.cpp --- a/src/hotspot/share/runtime/mutex.cpp +++ b/src/hotspot/share/runtime/mutex.cpp @@ -383,7 +383,7 @@ jint rv = Self->rng[0]; for (int k = Delay; --k >= 0;) { rv = MarsagliaXORV(rv); - if (SafepointMechanism::poll(Self)) return 0; + if (SafepointMechanism::should_block(Self)) return 0; } Self->rng[0] = rv; } else { diff --git a/src/hotspot/share/runtime/objectMonitor.cpp b/src/hotspot/share/runtime/objectMonitor.cpp --- a/src/hotspot/share/runtime/objectMonitor.cpp +++ b/src/hotspot/share/runtime/objectMonitor.cpp @@ -1641,7 +1641,7 @@ // This is in keeping with the "no loitering in runtime" rule. // We periodically check to see if there's a safepoint pending. if ((ctr & 0xFF) == 0) { - if (SafepointMechanism::poll(Self)) { + if (SafepointMechanism::should_block(Self)) { goto Abort; // abrupt spin egress } SpinPause(); diff --git a/src/hotspot/share/runtime/safepointMechanism.hpp b/src/hotspot/share/runtime/safepointMechanism.hpp --- a/src/hotspot/share/runtime/safepointMechanism.hpp +++ b/src/hotspot/share/runtime/safepointMechanism.hpp @@ -74,7 +74,7 @@ } // Call this method to see if this thread has depending poll and appropriate action should be taken - static inline bool poll(Thread* thread); + static inline bool should_block(Thread* thread); // Blocks a thread until safepoint is completed static inline void block_if_requested(JavaThread* thread); diff --git a/src/hotspot/share/runtime/safepointMechanism.inline.hpp b/src/hotspot/share/runtime/safepointMechanism.inline.hpp --- a/src/hotspot/share/runtime/safepointMechanism.inline.hpp +++ b/src/hotspot/share/runtime/safepointMechanism.inline.hpp @@ -47,7 +47,7 @@ } } -bool SafepointMechanism::poll(Thread* thread) { +bool SafepointMechanism::should_block(Thread* thread) { if (uses_thread_local_poll()) { return local_poll(thread); } else { diff --git a/src/hotspot/share/runtime/sweeper.cpp b/src/hotspot/share/runtime/sweeper.cpp --- a/src/hotspot/share/runtime/sweeper.cpp +++ b/src/hotspot/share/runtime/sweeper.cpp @@ -388,7 +388,7 @@ */ void NMethodSweeper::handle_safepoint_request() { JavaThread* thread = JavaThread::current(); - if (SafepointMechanism::poll(thread)) { + if (SafepointMechanism::should_block(thread)) { if (PrintMethodFlushing && Verbose) { tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count()); }