Review Request for MVT incubator module

mandy chung mandy.chung at oracle.com
Fri Sep 15 06:02:37 UTC 2017


Webrev:
    http://cr.openjdk.java.net/~mchung/valhalla/webrevs/incubator/

This patch proposes to define an incubator module [1] for MVT, named 
`jdk.incubator.mvt`.  Specifically this 
movesjvm.internal.value.ValueCapableClass and 
jdk.experimental.value.ValueType APIto a new jdk.incubator.mvt package.

-XX:+EnableMVT continues to be the runtime option to enable MVT.  I have 
changed the runtime to add jdk.incubator.mvt when MVT is enabled.  For 
compile-time, compiling @VCC classes would require to run javac with 
`--add-modules jdk.incubator.mvt` as incubator modules are not resolved 
by default.

A couple points worth mentioning:

java.base can't reference @VCC and ValueType class statically since they 
are now in a different module. In addition, @VCC can only be loaded 
after startup asVM startup can only load classes in java.base.

jdk.incubator.mvtis defined by the platform loader (as we want it to be 
deprivileged for security reason) and so Class.forName to find classes 
in jdk.incubator.module should use the right loader.

jdk.incubator.mvt.ValueType is basically a wrapper around the internal 
ValueTypeHolder class that is what java.base references in the 
implementation.  MethodHandleBuilder is kept as internal API for now.  I 
leave it as a future exercise if we decide to expose that API in the 
incubator module.

The tests are updated with @modules jdk.incubator.mvt or add access to 
jdk.experimental

I temporarily downgrade the javac incubating module warning to a note so 
that -Werror has no effect. We will need to revisit this warning in JDK 10.

thanks
Mandy
[1] http://openjdk.java.net/jeps/11


More information about the valhalla-dev mailing list