[lworld] RFR: 8271959: [lworld] Convert Optional and VBS classes to value class

Roger Riggs rriggs at openjdk.org
Tue Feb 21 21:35:52 UTC 2023


On Thu, 26 Jan 2023 01:38:03 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> Make copies of classes to be made value classes in src/java.base/valueclasses/classes 
> Modify CompileJavaModules.gmk to trigger builds of values classes and construct a .jar for each module.
> Add the jar files to $JAVA_HOME/lib/valueclasses/<module\>-valueclasses.jar 
> 
> Modify hotspot arguments.cpp to scan for patch jar files when --enable-preview and -XX:+EnableValhalla.
> For each jar, the equivalent of --patch-module <module>=<path-to-jar> is added and the system properties `jdk.module.patch.<n>` include jar file paths.

The initial set of value classes (listed in `make/modules/java.base/gensrc/GensrcValueClasses.gmk`) are generated from the regular versions of those classes with the `value` keyword inserted in the class declaration.

    java/util/Optional.java \
    java/util/OptionalInt.java \
    java/util/OptionalLong.java \
    java/util/OptionalDouble.java \
    java/time/LocalDate.java \
    java/time/LocalDateTime.java \
    java/time/LocalTime.java \
    java/time/Duration.java \
    java/time/Instant.java \
    java/time/MonthDay.java \
    java/time/ZonedDateTime.java \
    java/time/OffsetDateTime.java \
    java/time/OffsetTime.java \
    java/time/YearMonth.java \
    java/time/Year.java \
    java/time/Period.java \

-------------

PR: https://git.openjdk.org/valhalla/pull/816



More information about the valhalla-dev mailing list