hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 23873 dc33274a6248
parent 23872 536c66fc43d3
parent 23845 ebd1fafcc362
child 23999 22eb7be3d99d
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Apr 08 13:58:38 2014 -0400
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Apr 11 13:04:59 2014 +0200
@@ -3408,6 +3408,10 @@
               ("purge: %s(%s): prev method @%d in version @%d is alive",
               method->name()->as_C_string(),
               method->signature()->as_C_string(), j, i));
+            if (method->method_data() != NULL) {
+              // Clean out any weak method links
+              method->method_data()->clean_weak_method_links();
+            }
           }
         }
       }
@@ -3417,6 +3421,14 @@
       ("purge: previous version stats: live=%d, deleted=%d", live_count,
       deleted_count));
   }
+
+  Array<Method*>* methods = ik->methods();
+  int num_methods = methods->length();
+  for (int index2 = 0; index2 < num_methods; ++index2) {
+    if (methods->at(index2)->method_data() != NULL) {
+      methods->at(index2)->method_data()->clean_weak_method_links();
+    }
+  }
 }
 
 // External interface for use during class unloading.