hotspot/src/share/vm/code/nmethod.cpp
changeset 46438 b093c3f1ab3d
parent 46289 1904e7ec236e
child 46469 f0f38f5ac34f
--- a/hotspot/src/share/vm/code/nmethod.cpp	Fri May 05 17:48:45 2017 +0200
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Fri May 05 14:22:35 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1459,14 +1459,8 @@
     JvmtiDeferredEvent event =
       JvmtiDeferredEvent::compiled_method_unload_event(this,
           _jmethod_id, insts_begin());
-    if (SafepointSynchronize::is_at_safepoint()) {
-      // Don't want to take the queueing lock. Add it as pending and
-      // it will get enqueued later.
-      JvmtiDeferredEventQueue::add_pending_event(event);
-    } else {
-      MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
-      JvmtiDeferredEventQueue::enqueue(event);
-    }
+    MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
+    JvmtiDeferredEventQueue::enqueue(event);
   }
 
   // The JVMTI CompiledMethodUnload event can be enabled or disabled at