< prev index next >

src/share/vm/runtime/sweeper.cpp

Print this page

        

@@ -643,10 +643,16 @@
       // No inline caches will ever point to osr methods, so we can just remove it
       release_nmethod(nm);
       assert(result == None, "sanity");
       result = Flushed;
     } else {
+      {
+        // Clean ICs of unloaded nmethods as well because they may reference other
+        // unloaded nmethods that may be flushed earlier in the sweeper cycle.
+        MutexLocker cl(CompiledIC_lock);
+        nm->cleanup_inline_caches();
+      }
       // Code cache state change is tracked in make_zombie()
       nm->make_zombie();
       SWEEP(nm);
       assert(result == None, "sanity");
       result = MadeZombie;
< prev index next >