8226566: [JVMCI] java.* classes are no longer necessarily resolved by the boot class loader

Reviewed-by: kvn, dlong
This commit is contained in:
Doug Simon 2019-07-03 11:07:48 -07:00
parent 63d9446117
commit 509442b2a4

View File

@ -838,10 +838,8 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
// Primitive type resolution is context free.
return true;
}
if (elementType.getName().startsWith("Ljava/")) {
// Classes in a java.* package can only be defined by the
// boot class loader. This is enforced by ClassLoader.preDefineClass()
assert hasSameClassLoader(runtime().getJavaLangObject());
if (elementType.getName().startsWith("Ljava/") && hasSameClassLoader(runtime().getJavaLangObject())) {
// Classes in a java.* package defined by the boot class loader are always resolved.
return true;
}
HotSpotResolvedObjectTypeImpl otherMirror = ((HotSpotResolvedObjectTypeImpl) accessingClass);