• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Valhalla
  4. Minimal Value Types

Minimal Value Types

  • Created by Karen Kinnear on Aug 08, 2017

Welcome to the Minimal Value Types early adopter's project

Target Audience

  • Power users 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

Programming Model

  • Create a POJO using an experimental javac, with an annotation 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 (TODO - link to javadoc)
  • Or spin your own byte codes
    • experimental MethodBuilder (TODO - link)
    • future: ASM support is planned

Repository and Build Instructions

Feature Subset

  • Derived Value Class is a new type which is:
    • immutable, identity-agnostic, non-nullable, non-synchronizable, final
    • non-polymorphic - it does not have a real superclass, does not inherit from java.lang.Object
  • Arrays of value types are flattened
  • Derived Value Class can contain primitives, other Derived Value Classes or references

Experimental JVMS appendix (TODO - add link)

  • Derived Value Class derivation rules
    • temporary name mangling: class Foo.class generates Foo$Value
  • Classfile extensions
    • temporary CONSTANT_Class: ";QFoo$Value", uses ";Q" as an escape to a derived value class name
    • field and method descriptors: "Q<value name>; in place of "L<reference name>;
  • Bytecodes
    • value types byte codes: vdefault, vwithfield, vload, vstore, vreturn, vaload, vastore
    • overloaded bytecodes: getfield, anewarray, multianewarray

Limitations

  • platforms: x64 Linux, x64 Mac OS X
  • no verifier (work-in-progress)
  • no VarHandles
  • no support for atomic fields containing value types
  • no JNI, unsafe, redefineclasses, reflection
  • -Xint and C2 only, no C1, no tiered-compilation
  • interpreter is not optimized, focus is on JIT optimization

References

(TODO - attach slide presentations)

Overview
Content Tools
ThemeBuilder
  • No labels

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 166, "requestCorrelationId": "805389c0042304dc"}