8267954: Shared classes that failed to load should not be loaded again

Reviewed-by: iklam, ccheung
This commit is contained in:
Yumin Qi 2021-06-09 21:33:28 +00:00
parent 991ca14279
commit 7ff6e7b2b1
7 changed files with 51 additions and 36 deletions

View file

@ -2496,6 +2496,7 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl
// before the InstanceKlass is added to the SystemDictionary. Make
// sure the current state is <loaded.
assert(!is_loaded(), "invalid init state");
assert(!shared_loading_failed(), "Must not try to load failed class again");
set_package(loader_data, pkg_entry, CHECK);
Klass::restore_unshareable_info(loader_data, protection_domain, CHECK);