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

Vladimir Kozlov kvn at openjdk.org
Tue Sep 16 01:18:16 UTC 2025


On Tue, 16 Sep 2025 01:02:07 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> 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.

Okay.

An other thing. I think you need to issue warning only if `AOTClassLinking` is set on command line.

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

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


More information about the hotspot-dev mailing list