hotspot/src/share/vm/classfile/systemDictionary.cpp
changeset 9172 a4e13ccafc44
parent 9116 9bc44be338d6
child 9630 d6419e4395e3
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp	Thu Apr 14 23:06:33 2011 -0400
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp	Fri Apr 15 09:36:28 2011 -0400
@@ -1255,6 +1255,16 @@
         methodHandle m(THREAD, methodOop(methods->obj_at(index2)));
         m()->link_method(m, CHECK_(nh));
       }
+      if (JvmtiExport::has_redefined_a_class()) {
+        // Reinitialize vtable because RedefineClasses may have changed some
+        // entries in this vtable for super classes so the CDS vtable might
+        // point to old or obsolete entries.  RedefineClasses doesn't fix up
+        // vtables in the shared system dictionary, only the main one.
+        // It also redefines the itable too so fix that too.
+        ResourceMark rm(THREAD);
+        ik->vtable()->initialize_vtable(false, CHECK_(nh));
+        ik->itable()->initialize_itable(false, CHECK_(nh));
+      }
     }
 
     if (TraceClassLoading) {