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

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Valhalla
  4. L-World Value Types

Page History

Versions Compared

Old Version 5

changes.mady.by.user David Simms

Saved on Jul 23, 2018

compared with

New Version 6

changes.mady.by.user Karen Kinnear

Saved on Jul 24, 2018

  • Previous Change: Difference between versions 4 and 5
  • Next Change: Difference between versions 6 and 7
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: more limitations, minor edits.

...

  • The L-World Value Types project is a series of early prototypes for Value Types
    • builds on work of the previous Minimal Values Types prototype (MVT)
      • provides a new type which is: immutable, identity-agnostic, non-nullable, non-synchronizable, final
      • Value Types contained in References, other Value Types or in Arrays are flatten-able
      • Value Types can contain primitives or references
    • Allows value types to inter-operate with Object or "L-Type" descriptors

...

The previous MVT prototype maintain maintained completely separate descriptors, "Q-Types", where value type signatures began with "Q" (similar to how Object descriptors begin with "L", i.e. "L-Types"). Data movement and manipulation of value types under the MVT prototype all required separate byte-codes. There were at one point 13 new internal byte codes, known as "v-bytecodes" since they are all started with "v". These are no more. What we have today, is an attempt to incorporate value types into L-type system to maximize backward compatibility with existing Objects and Interfaces, an "L-World" if you will:

  • Value Types may be referred to by the same "L-Type" descriptors the VM has always operated on:
    • may pass a vale value type as an objecta java.lang.Object or interface, through existing APIs
    • may implement interfaces with value types
    • identity-less: 
      • synchronization will fail with exception: IllegalMonitorStateException
      • reference equality with "==" (if_acmp<eq|ne>) always returns false, value equality requires using the "equals()" method
  • There are only two new byte-codes, otherwise existing byte-codes have been engineered to accept and maintain value type characteristics (identity-less, flattenedflattenable, pass by value):
    • "default" - will create a new default value
    • "withfield"- allows updating value type fields via a copy-on-write semantic, i.e. new value based on the old value combined with new field value.

...

  • Experimental source support via javac with "__ByValue" class declaration modifier
  • Value Types cannot be used as parameterized types, i.e. current generic type declarations do not support primitives, nor value types at this point in time
  • Type migration, including partial recompilation is not support supported at this point

How to Try L-World Value Types:

...

Programming Model

CMH: Example code

Sample JMH benchmarks: http://mail.openjdk.java.net/pipermail/valhalla-dev/2018-June/004380.html

Run Experimental L-World

  • java -XX:+EnableValhalla <Test>
  • Further experimental flags can be found here

...

  • Send email to valhalla-dev@openjdk.java.net with bugs or small use cases for optimization

Limitations

  • platforms: x64 Linux, x64 Mac OS X, Windows
  • no support for value class with no instance fields
  • no support for atomic fields containing value types (work-in-progress for an update)
  • no support for @Contended value type fields
  • static fields are not flattenable
  • no AOT, CDS, ZGC, redefineclassesserviceability agent
  • -Xint and C2 only, no C1, no tiered-compilation, no Graal
  • unsafe field accessor APIs are not supported for value types
  • interpreter is not optimized, focus is on JIT optimization
  • Need additional USE CASES for optimizations
  • Working on additional test cases

...

Overview
Content Tools
ThemeBuilder

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.

  • Adaptavist ThemeBuilder Powered by Atlassian Confluence 7.4.1
  • Adaptavist ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Adaptavist ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 438, "requestCorrelationId": "dbf65cf404185a7c"}