diff src/share/vm/code/compiledIC.cpp @ 23426:682119c4c32e

8058737: CodeCache::find_blob fails with 'unsafe access to zombie method' Summary: Remove active ICStubs from zombie nmethods Reviewed-by: kvn, iveresov
author thartmann
date Thu, 08 Oct 2015 09:37:23 +0200
parents aff6ccb506cb
children c1950f51ed60
line wrap: on
line diff
--- a/src/share/vm/code/compiledIC.cpp	Tue Oct 06 12:18:17 2015 +0200
+++ b/src/share/vm/code/compiledIC.cpp	Thu Oct 08 09:37:23 2015 +0200
@@ -155,6 +155,14 @@
   return _ic_call->destination();
 }
 
+// Clears the IC stub if the compiled IC is in transition state
+void CompiledIC::clear_ic_stub() {
+  if (is_in_transition_state()) {
+    ICStub* stub = ICStub_from_destination_address(stub_address());
+    stub->clear();
+  }
+}
+
 
 //-----------------------------------------------------------------------------
 // High-level access to an inline cache. Guaranteed to be MT-safe.
@@ -333,10 +341,7 @@
 
   if (safe_transition) {
     // Kill any leftover stub we might have too
-    if (is_in_transition_state()) {
-      ICStub* old_stub = ICStub_from_destination_address(stub_address());
-      old_stub->clear();
-    }
+    clear_ic_stub();
     if (is_optimized()) {
     set_ic_destination(entry);
   } else {