6968336: VM crash guarantee(!nm->is_zombie()) failed: cannot lock a zombie method
authornever
Thu, 15 Jul 2010 08:54:48 -0700
changeset 5929 279fd26a4b68
parent 5928 f6e69b46e9e3
child 5930 f172b22065d7
child 6062 bab93afe9df7
6968336: VM crash guarantee(!nm->is_zombie()) failed: cannot lock a zombie method Reviewed-by: twisti
hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp
--- a/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp	Wed Jul 14 14:47:34 2010 -0700
+++ b/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp	Thu Jul 15 08:54:48 2010 -0700
@@ -118,7 +118,6 @@
   for (int i=0; i<_global_code_blobs->length(); i++) {
     JvmtiCodeBlobDesc* scb = _global_code_blobs->at(i);
     if (addr == scb->code_begin()) {
-      ShouldNotReachHere();
       return;
     }
   }
@@ -206,11 +205,11 @@
   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
   nmethod* current = CodeCache::first_nmethod();
   while (current != NULL) {
-    // Lock the nmethod so it can't be freed
-    nmethodLocker nml(current);
-
     // Only notify for live nmethods
     if (current->is_alive()) {
+      // Lock the nmethod so it can't be freed
+      nmethodLocker nml(current);
+
       // Don't hold the lock over the notify or jmethodID creation
       MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       current->get_and_cache_jmethod_id();