--- old/src/java.base/share/classes/java/lang/System.java 2017-06-20 19:15:48.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/System.java 2017-06-20 19:15:48.000000000 -0700 @@ -56,6 +56,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; +import jdk.internal.loader.BootLoader; import jdk.internal.module.ModuleBootstrap; import jdk.internal.module.ServicesCatalog; import jdk.internal.reflect.CallerSensitive; @@ -2165,6 +2166,19 @@ public Stream layers(ClassLoader loader) { return ModuleLayer.layers(loader); } + public Class loadValueTypeClass(Module module, ClassLoader cl, String name) { + try { + // VM support to define DVT + Class c = Class.forName0(name, false, cl, Object.class); + // catch if the given name is not the name of a DVT class + if (!c.isValueClass()) { + throw new InternalError(c.getName() + " not a value type"); + } + return c; + } catch (ClassNotFoundException e) { + throw new InternalError(e); + } + } }); } }