RFR: 8360163: Create annotations to mark dumping method handles and runtime setup required classes [v3]
David Holmes
dholmes at openjdk.org
Tue Jul 1 00:53:50 UTC 2025
On Mon, 30 Jun 2025 22:11:57 GMT, Chen Liang <liach at openjdk.org> wrote:
>> I have updated this patch to avoid a redundant `runtimeSetup` annotation - we have agreed that the requirement for setup is a side effect of initialization, and such methods in AOTCI classes must be automatically recognized. This latest revision implements that model.
>>
>> I intentionally avoided handling Class and ClassLoader `resetArchivedStates` and `MethodType::assemblySetup` - we talked about a generic `assemblyCleanup` method, but I did not find out where is the best place to call such a method in the assembly phase. We cna handle this in a subsequent patch.
>>
>> In particular, please review the new AOT.md design document - I split it from the AOTCI annotation to prevent jamming; we can put general AOT information there when we have more AOT-specific annotations.
>>
>> ---
>>
>> Old description:
>> Currently, the list of classes that have <clinit> interdependencies and those that need runtimeSetup are maintained in a hardcoded list in CDS. This makes it risky for core library developers as they might introduce new interdependencies and observe CDS to fail. By moving the mechanism of these lists to core library annotations as a first step, we can gradually expose the AOT contracts as program semantics described by internal annotations, and also helps us to explore how we can expose these functionalities to the public later.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>
> Missed comment updates
Just a drive-by comment ...
src/hotspot/share/cds/aotClassInitializer.cpp line 247:
> 245:
> 246: if (CDSConfig::is_dumping_method_handles()) {
> 247: // The list of @AOTClassInitializer was created with the help of CDSHeapVerifier.
Given there is no longer a list these left over comments seem out of place here. Perhaps the `has_aot_initialization` method should document how it was determined which classes to annotate and what additional constraints there are. Though that could also be left for the documentation in AOT.md, rather than the code.
-------------
PR Review: https://git.openjdk.org/jdk/pull/25922#pullrequestreview-2973142829
PR Review Comment: https://git.openjdk.org/jdk/pull/25922#discussion_r2176188797
More information about the core-libs-dev
mailing list