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

Ioi Lam iklam at openjdk.org
Tue Sep 16 19:48:04 UTC 2025


On Tue, 16 Sep 2025 19:21:27 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>>>  The default value of AOTClassLinking is false, so if we come here, it must have been set in the command-line. I added an assert (so our ERGO code doesn't set it by mistake).
>> 
>> 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
>
>> 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)`

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

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


More information about the hotspot-dev mailing list