comparison src/share/vm/classfile/systemDictionary.cpp @ 3245:8ce625481709

7032407: Crash in LinkResolver::runtime_resolve_virtual_method() Summary: Make CDS reorder vtables so that dump time vtables match run time order, so when redefine classes reinitializes them, they aren't in the wrong order. Reviewed-by: dcubed, acorn
author coleenp
date Fri, 15 Apr 2011 09:36:28 -0400
parents ed69575596ac
children 167b70ff3abc
comparison
equal deleted inserted replaced
3244:a534c140904e 3245:8ce625481709
1252 objArrayHandle methods (THREAD, ik->methods()); 1252 objArrayHandle methods (THREAD, ik->methods());
1253 int num_methods = methods->length(); 1253 int num_methods = methods->length();
1254 for (int index2 = 0; index2 < num_methods; ++index2) { 1254 for (int index2 = 0; index2 < num_methods; ++index2) {
1255 methodHandle m(THREAD, methodOop(methods->obj_at(index2))); 1255 methodHandle m(THREAD, methodOop(methods->obj_at(index2)));
1256 m()->link_method(m, CHECK_(nh)); 1256 m()->link_method(m, CHECK_(nh));
1257 }
1258 if (JvmtiExport::has_redefined_a_class()) {
1259 // Reinitialize vtable because RedefineClasses may have changed some
1260 // entries in this vtable for super classes so the CDS vtable might
1261 // point to old or obsolete entries. RedefineClasses doesn't fix up
1262 // vtables in the shared system dictionary, only the main one.
1263 // It also redefines the itable too so fix that too.
1264 ResourceMark rm(THREAD);
1265 ik->vtable()->initialize_vtable(false, CHECK_(nh));
1266 ik->itable()->initialize_itable(false, CHECK_(nh));
1257 } 1267 }
1258 } 1268 }
1259 1269
1260 if (TraceClassLoading) { 1270 if (TraceClassLoading) {
1261 ResourceMark rm; 1271 ResourceMark rm;