8201556: Disallow reading oops in ClassLoaderData if unloading

Move class_loader oop to an OopHandle, and assert that holder is alive when getting class_loader.

Reviewed-by: kbarrett, adinn
This commit is contained in:
Coleen Phillimore 2018-04-18 18:43:04 -04:00
parent 702ac597ad
commit ddfd4c33c6
22 changed files with 121 additions and 47 deletions

View file

@ -357,6 +357,14 @@ Handle SystemDictionaryShared::init_security_info(Handle class_loader, InstanceK
return pd;
}
bool SystemDictionaryShared::is_sharing_possible(ClassLoaderData* loader_data) {
oop class_loader = loader_data->class_loader();
return (class_loader == NULL ||
(UseAppCDS && (SystemDictionary::is_system_class_loader(class_loader) ||
SystemDictionary::is_platform_class_loader(class_loader)))
);
}
// Currently AppCDS only archives classes from the run-time image, the
// -Xbootclasspath/a path, the class path, and the module path.
//