8007725: NPG: Klass::restore_unshareable_info() triggers assert(k->java_mirror() == NULL)

Check for exception during SystemDictionary::resolve_instance_class_or_null() and clean up.

Reviewed-by: coleenp, acorn, hseigel, minqi
This commit is contained in:
Ioi Lam 2013-03-15 17:24:40 -04:00 committed by Coleen Phillimore
parent be1b5fc17e
commit 6f76ade8e1
5 changed files with 60 additions and 6 deletions

View file

@ -798,7 +798,15 @@ void Method::unlink_method() {
backedge_counter()->reset();
_adapter = NULL;
_from_compiled_entry = NULL;
assert(_method_data == NULL, "unexpected method data?");
// In case of DumpSharedSpaces, _method_data should always be NULL.
//
// During runtime (!DumpSharedSpaces), when we are cleaning a
// shared class that failed to load, this->link_method() may
// have already been called (before an exception happened), so
// this->_method_data may not be NULL.
assert(!DumpSharedSpaces || _method_data == NULL, "unexpected method data?");
set_method_data(NULL);
set_interpreter_throwout_count(0);
set_interpreter_invocation_count(0);