mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
7032407: Crash in LinkResolver::runtime_resolve_virtual_method()
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
This commit is contained in:
parent
2a5436b3d3
commit
8acea1848a
7 changed files with 75 additions and 13 deletions
|
@ -1255,6 +1255,16 @@ instanceKlassHandle SystemDictionary::load_shared_class(
|
|||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue