RFR: 8367366: Do not support -XX:+AOTClassLinking for dynamic CDS archive [v2]

Ashutosh Mehra asmehra at openjdk.org
Tue Sep 16 20:12:12 UTC 2025


On Tue, 16 Sep 2025 19:45:05 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>>> The settings of optimization levels, including all the settings in setup_compiler_args(), should be moved to CDSConfig::ergo_initialize(). If we see any inconsistent settings, they should be correct with FLAG_SET_ERGO() (and we don't exit the VM).
>> 
>> Agree.
>
>> Here AOTClassLinking is set and checked in check_vm_args_consistency()
> https://github.com/openjdk/leyden/blob/master/src/hotspot/share/cds/cdsConfig.cpp#L636
> 
> Hmm, for convoluted cases like this, we will actually turn on AOTClassLinking ergomomically for dynamic dump
> 
> java -XX:ArchiveClassesAtExit=foo.jsa -cp HelloWorld.jar -XX:AOTMode=on -XX:AOTCache=hw.aot HelloWorld
> 
> 
> I've removed the assert and print the warning only if `FLAG_IS_CMDLINE(AOTClassLinking)`

@iklam 
> java -XX:ArchiveClassesAtExit=foo.jsa -cp HelloWorld.jar -XX:AOTMode=on -XX:AOTCache=hw.aot HelloWorld

What would this command do? Generate `hw.aot` or `foo.jsa`? I think this is, as you said, a convoluted case and it is best to not allow the user to mix the two workflows.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27242#discussion_r2353544448


More information about the hotspot-dev mailing list