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:
Coleen Phillimore 2011-04-15 09:36:28 -04:00
parent 2a5436b3d3
commit 8acea1848a
7 changed files with 75 additions and 13 deletions

View file

@ -453,6 +453,14 @@ void Klass::remove_unshareable_info() {
ik->unlink_class();
}
}
// Clear the Java vtable if the oop has one.
// The vtable isn't shareable because it's in the wrong order wrt the methods
// once the method names get moved and resorted.
klassVtable* vt = vtable();
if (vt != NULL) {
assert(oop_is_instance() || oop_is_array(), "nothing else has vtable");
vt->clear_vtable();
}
set_subklass(NULL);
set_next_sibling(NULL);
}