...
- The Minimal Value Types project is an early prototype for Value Types
- provides initial subset of Value Type functionality, essentially flattened data
- provides new a new type which is:
- immutable, identity-agnostic, non-nullable, non-synchronizable, final
- does not inherit from java.lang.Object
- Arrays of value types are flattened
Derived Value Class can - Can contain primitives or references
Target Audience
- Power users - Java/JVM Language, Framework, Library authors/exports
- who are comfortable with early experimental software
- who recognize that everything in the experiment - the model, the classfile extensions, the byte codes is likely to change
- who want to contribute to early exploration of Value Types
- who will not build any products based on these prototypes
- Who are willing to provide feedback to the developers on a subset of Value Type features
- Who will provide use cases for the development team to experiment with optimizations
...
- Create a POJO using an experimental javac, with an annotation ValueCapableClass (jvm.internal.value.ValueCapableClass)
- JVM will derive a Derived Value Class (DVC) from this defined "box" which we call the Value Capable Class (VCC)
- DVC contains an immutable copy of the instance fields from the VCC
- Work with MethodHandles and experimental reflection package ValueType (jdk.experimental.value.ValueType)
- Or spin your own byte codes
- experimental MethodBuilder (jdk/experimental/value.MethodHandleBuilder)
- future: ASM support is planned
Test Examples
- See directory jdk/test/valhalla/mvt in your repository
- e.g. MethodHandlesTest
- Command-line flags: Minimal Value Types Command line Options
- java: use -Xverify:none -XX:+EnableMVT
Filing Bugs
- File openjdk bugs with synopsis starting with "[MVT]" and labels: "mvt"
...
- Experimental Appendix for Java Virtual Machine Specification for Value Classes
- http://cr.openjdk.java.net/~chegar/docs/sandbox.html // instructions for working with branch repositorieshttps://wiki.
- openjdk.java.net/display/valhalla/Minimal + Value +Types+and+Valhalla+value+types+command+line+options // MVT command-line optionsTypes Command line Options
- Youtube JVMLS 2017: Minimal Value Types: Origins and Programming Model
- Youtube JVMLS 2017: Minimal Value Types: Under the Hood
...
Overview
Content Tools
ThemeBuilder