Project Valhalla

Project Valhalla is augmenting the Java object model with value objects, combining the abstractions of object-oriented programming with the performance characteristics of simple primitives. These features will be complemented with changes to Java’s generics to preserve performance gains through generic APIs.

This Project is sponsored by the HotSpot Group.

JEPs

Valhalla project features will be added to Java over multiple releases. This process is managed with JEPs, each of which facilitates the development and integration into the JDK of a cohesive set of changes.

There are five distinct feature sets under development:

  1. Value Objects, introducing class instances that lack identity

  2. Flattened Heap Layouts for Value Objects, supporting null-free flattened storage

  3. Enhanced Primitive Boxing, allowing primitives to be treated more like objects

  4. Null-Restricted and Nullable Types, providing language support for managing nulls

  5. Parametric JVM, preserving and optimizing generic class and method parameterizations at runtime

We’ve also worked on some supplementary tasks and features, including:

Background Documents

These documents present a more holistic view of the Valhalla project’s goals and design considerations.

Implementation

Development takes place in a public OpenJDK repository, with occasional early-access builds being published.

Interested developers are encouraged to experiment with these early releases.

Branches in the repository include lworld (the main line of Valhalla development), master (tracking mainline OpenJDK), jep* (staging areas for the production-ready implementations of JEPs), and various others prototyping proposed features.

Community

We welcome input from interested Java developers. Keep in mind that most theoretical ideas have been well explored over the last few years! The greatest help can be provided by those who try out concrete prototypes and can share their experiences with real-world code bases.