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

Ioi Lam iklam at openjdk.org
Tue Sep 16 01:06:12 UTC 2025


On Tue, 16 Sep 2025 00:31:31 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   @ashu-mehra comment -- print warning if -XX:+AOTClassLinking is enabled for dynamic dump
>
> src/hotspot/share/cds/cdsConfig.cpp line 762:
> 
>> 760:     log_warning(cds)("AOTClassLinking is not supported for dynamic CDS archive");
>> 761:     FLAG_SET_ERGO(AOTClassLinking, false);
>> 762:   }
> 
> Can you do it in `CDSConfig::check_vm_args_consistency()` instead, where `AOTClassLinking` is set ergonomically?

At that point, `is_dumping_dynamic_archive()` will always return zero, as we don't know if we can dump the dynamic archive until `CDSConfig::ergo_init_classic_archive_paths()`, which is called much later.

The calling sequence is:

- `CDSConfig::check_vm_args_consistency()`
- `CDSConfig::ergo_initialize ()`-> `ergo_init_classic_archive_paths()`
- `CDSConfig::prepare_for_dumping()`

Today we are doing ergo setting of AOT flags inside `check_vm_args_consistency()`. I think we should move that to the end of `CDSConfig::ergo_initialize()`. Since that's a bigger scope, maybe I should do that in a follow-up PR?

The current PR still works as intended, because `AOTClassLinking` acts as a master switch that will turn off all other AOT optimizations for dynamic dump, regardless of the values of `AOTInvokeDynamicLinking`, etc.

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

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


More information about the hotspot-dev mailing list