[lworld] RFR: 8271959: [lworld] Convert Optional and VBS classes to value class
Erik Joelsson
erikj at openjdk.org
Tue Feb 21 21:35:51 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.
There are two major ways you could approach this.
1. Define new top level targets for compiling the value classes and the subsequent jar files.
2. Modify make/CompileJavaModules.gmk to add a second optional compilation and jar file generation which would be part of the top level <module>-java target.
You went with option 1. Both have pros and cons, so it kind of depends on what you expect to need to do, as a developer. Do you think you need the fine granular top level target support for selective building?
Another aspect is that if you reuse the CompileJavaModules.gmk and run it again with a different outputdir, I think you will be rebuilding quite a lot of things unnecessarily. My understanding is that you only really need the value classes from the this second round of compilation.
make/Main.gmk line 227:
> 225: SRCS:=$$($1-value-jar-bin-class-files), \
> 226: JAR:=ValueClass_$1.jar, \
> 227: ))
This would need to go into a separate new makefile. It's not possible to inline a Setup* macro in a recipe.
-------------
PR: https://git.openjdk.org/valhalla/pull/816
More information about the valhalla-dev
mailing list