Prototype of "Minimal Value Types" (MVT)

David Simms david.simms at oracle.com
Thu Dec 1 14:11:17 UTC 2016


Recently pushed into the Valhalla repository with the comment "MVT 1.0 
prototype": This is an initial prototype of "Minimal Value Types" 
document [1] (MVT), proposed by Brian Goetz and John Rose back in 
August. The document describes a possible means of delivering an 
experimental test vehicle for "Value Type" [2] features, without 
committing to language or VM specification changes.

There are a number of differences in implementation compared to the 
"Minimal Value Types" document:

     Annotating a "Value Capable Class" (VCC) with 
"jvm.internal.value.DeriveValueType":
         The VM does not modify the VCC in anyway
         The value type derived from the VCC is not a an inner class of 
VCC, but merely provides the same instance fields
     "jdk.experimental.value.ValueType" API is by no means final, or 
even complete with regards to the MVT document

Caveats, use of "DeriveValueType" annotation and the "ValueType" method 
handle API:

     Limited to x86_64 platform
     JIT support is missing, must use "-Xint"
     Verifier support is missing, must use "-noverify"
     MethodHandles dealing with value types are implemented using 
bytecodes that are libel to change.

Much of the underlying implementation is nowhere near production 
quality. Quite the opposite, we are still prototyping new ideas and wish 
to maintain some flexibility. Performance improvements will be in most 
cases using Value Types, completely out of the question at this point.

Example usage: test/valhalla/mvt/MVTTest.java


[1] http://cr.openjdk.java.net/~jrose/values/shady-values.html
[2] http://cr.openjdk.java.net/~jrose/values/values.html




More information about the valhalla-dev mailing list