...
- 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
...
- Code samples
- See directory jdk/test/valhalla/mvt in your repository
- e.g. MethodHandlesTest
- See directory jdk/test/valhalla/mvt in your repository
Run Experimental MVT
- java -Xverify:none -XX:+EnableMVT <Test>
- Command-line flags: Minimal Value Types Command-line Optionsjava: use -Xverify:none -XX:+EnableMVT
Filing Bugs
- File openjdk bugs with synopsis starting with "[MVT]" and labels: "mvt"
...
- Minimal Value Types 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