src/hotspot/share/code/codeCache.cpp
changeset 54150 5529640c5f67
parent 54122 4b1426ed1c44
child 54355 f226ab0b7f21
--- a/src/hotspot/share/code/codeCache.cpp	Fri Mar 15 18:59:21 2019 +0100
+++ b/src/hotspot/share/code/codeCache.cpp	Fri Mar 15 16:00:18 2019 -0400
@@ -667,7 +667,7 @@
   }
 }
 
-void CodeCache::metadata_do(void f(Metadata* m)) {
+void CodeCache::metadata_do(MetadataClosure* f) {
   assert_locked_or_safepoint(CodeCache_lock);
   NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading);
   while(iter.next()) {
@@ -1061,13 +1061,14 @@
       // ...Already marked in the previous pass; count it here.
       // Also counts AOT compiled methods, already marked.
       number_of_marked_CodeBlobs++;
-    } else if (nm->is_evol_dependent()) {
+    } else if (nm->has_evol_metadata()) {
       ResourceMark rm;
       nm->mark_for_deoptimization();
       number_of_marked_CodeBlobs++;
-    } else  {
-      // flush caches in case they refer to a redefined Method*
-      nm->clear_inline_caches();
+    } else {
+      // Inline caches that refer to an nmethod are deoptimized already, because
+      // the Method* is walked in the metadata section of the nmethod.
+      assert(!nm->is_evol_dependent(), "should no longer be necessary");
     }
   }