changeset 52396:5ea020bcaa0d

8209495: NMethodSweeper::sweep_code_cache cause severe delays Reviewed-by: thartmann, eosterlund
author rehn
date Thu, 01 Nov 2018 17:56:01 +0100
parents c9bbf33fd1ae
children 7b20c27b2ccb
files src/hotspot/share/runtime/sweeper.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/runtime/sweeper.cpp	Thu Nov 01 12:43:21 2018 -0400
+++ b/src/hotspot/share/runtime/sweeper.cpp	Thu Nov 01 17:56:01 2018 +0100
@@ -387,13 +387,13 @@
  * Handle a safepoint request
  */
 void NMethodSweeper::handle_safepoint_request() {
-  if (SafepointSynchronize::is_synchronizing()) {
+  JavaThread* thread = JavaThread::current();
+  if (SafepointMechanism::poll(thread)) {
     if (PrintMethodFlushing && Verbose) {
       tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count());
     }
     MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 
-    JavaThread* thread = JavaThread::current();
     ThreadBlockInVM tbivm(thread);
     thread->java_suspend_self();
   }