8226566: [JVMCI] java.* classes are no longer necessarily resolved by the boot class loader
authordnsimon
Wed, 03 Jul 2019 11:07:48 -0700
changeset 55579 4ce8e03602e1
parent 55572 618ad1237e73
child 55580 7276ccf6c29b
8226566: [JVMCI] java.* classes are no longer necessarily resolved by the boot class loader Reviewed-by: kvn, dlong
src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java	Thu Jun 13 19:37:49 2019 +0200
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java	Wed Jul 03 11:07:48 2019 -0700
@@ -838,10 +838,8 @@
             // 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);