On Thu, 20 Mar 2025 04:46:21 GMT, Ioi Lam <ik...@openjdk.org> wrote:

> `-XX:+AOTClassLinking` requires the CDS archived full module graph (FMG).
> 
> - Before this PR, when  `--add-export` is specified,  FMG is disabled, so AOT 
> caches created with `-XX:+AOTClassLinking` cannot be loaded.
> - After this PR, if the exact same `--add-export` flags as specified across 
> the training/assembly/production phases, the FMG can be used, so we can use 
> so AOT caches created with `-XX:+AOTClassLinking`.
> 
> The change itself is straight-forward: just remember the `--add-export` flags 
> specified during AOT cache creation, and check the exact same ones are used 
> during the production run.
> 
> I did a fair amount of refactoring to change the "exact options specified" 
> checks in modules.cpp, so more such options can be easily added in the future 
> (we need to handle `--add-reads` and `--add-opens` in future RFEs).
> 
> (Note: this PR depends on #24122 )

Code changes look clean. I just have two minor comments on the tests.

test/hotspot/jtreg/runtime/cds/appcds/jigsaw/ExactOptionMatch.java line 91:

> 89: 
> 90:             // (4) Dump = specified twice, Run = specified twice (but in 
> different order)
> 91:             //     Should still be able to use FMG (values are sorted by 
> CDS).

How about add another test case where the values are specified in the same 
order?

test/lib/jdk/test/lib/cds/CDSModulePackager.java line 36:

> 34: import jdk.test.lib.cds.CDSJarUtils.JarOptions;
> 35: 
> 36: 

This file has no change other than the above blank line deletion.

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

PR Review: https://git.openjdk.org/jdk/pull/24124#pullrequestreview-2712297986
PR Review Comment: https://git.openjdk.org/jdk/pull/24124#discussion_r2011266430
PR Review Comment: https://git.openjdk.org/jdk/pull/24124#discussion_r2011265840

Reply via email to