RFR: 8355798: Implement JEP 514: Ahead-of-Time Command Line Ergonomics [v7]
Dan Heidinga
heidinga at openjdk.org
Tue May 13 14:15:57 UTC 2025
On Tue, 13 May 2025 03:06:44 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> This is the implementation of the draft [JEP: Ahead-of-time Command Line Ergonomics](https://bugs.openjdk.org/browse/JDK-8350022)
>>
>> - Implemented new flag `AOTCacheOutput`, which can be used to create an AOT cache using the "one-command workflow"
>> - Added processing of the `JAVA_AOT_OPTIONS` environment variable that can supply extra VM options when creating an AOT cache
>> - Added `%p` substitution for `AOTCache`, `AOTCacheOutput`, and `AOTConfiguration` options
>>
>> Please see the [JEP](https://bugs.openjdk.org/browse/JDK-8350022) and [CSR](https://bugs.openjdk.org/browse/JDK-8356010) for detailed specification.
>>
>> Examples:
>>
>>
>> # Create an AOT cache with a single command:
>> $ java -cp HelloWorld.jar -XX:AOTMode=record -XX:AOTCacheOutput=foo.aot HelloWorld
>> Hello World
>> Temporary AOTConfiguration recorded: foo.aot.config
>> Launching child process /usr/bin/java to assemble AOT cache foo.aot using configuration foo.aot.config
>> Picked up JAVA_TOOL_OPTIONS: -Djava.class.path=HelloWorld.jar -XX:AOTCacheOutput=foo.aot -XX:AOTConfiguration=foo.aot.config -XX:AOTMode=create
>> Reading AOTConfiguration foo.aot.config and writing AOTCache foo.aot
>> AOTCache creation is complete: foo.aot 10240000 bytes
>>
>> # Create logging file for the AOT cache assembly phase
>> $ export AOT_TOOL_COMMAND=-Xlog:cds:file=log.txt
>> $ java -cp HelloWorld.jar -XX:AOTMode=record -XX:AOTCacheOutput=foo.aot HelloWorld
>>
>>
>> Note: the child process is launched with Java API because the HotSpot native APIs are not sufficient (no way to set env vars for child process).
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> Added param to makefile function SetupAOT for choosing onestep vs twostep
src/java.base/share/man/java.md line 4073:
> 4071: - `-XX:AOTMode=record` is specified, or
> 4072: - `-XX:AOTCacheOutput` is specified, and `-XX:AOTMode=auto` is specified, or
> 4073: - `-XX:AOTCacheOutput` is specified, and `-XX:AOTMode` is not specidied.
Suggestion:
- `-XX:AOTCacheOutput` is specified, and `-XX:AOTMode` is not specified.
src/java.base/share/man/java.md line 4084:
> 4082: - `record`: Execute the application in the Training phase.
> 4083: At least one of `-XX:AOTConfiguration=`*configfile* and/or
> 4084: `-XX:AOTCache=`*cachefile* must be specified.
Suggestion:
`-XX:AOTCache=`*cachefile* or `-XX:AOTCacheOutput=`*cachefile* must be specified.
AOTCacheOutput is also a valid configuration for mode record, right?
src/java.base/share/man/java.md line 4087:
> 4085: If `-XX:AOTConfiguration=`*configfile* is specified, the JVM gathers
> 4086: statistical data and stores them into *configfile*.
> 4087: If `-XX:AOTCache=`*cachefile* is specified, a second JVM process is launched
Suggestion:
If `-XX:AOTCache=`*cachefile* or `-XX:AOTCacheOutput=`*cachefile* is specified, a second JVM process is launched
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24942#discussion_r2086925261
PR Review Comment: https://git.openjdk.org/jdk/pull/24942#discussion_r2086929891
PR Review Comment: https://git.openjdk.org/jdk/pull/24942#discussion_r2086934364
More information about the core-libs-dev
mailing list