RFR: 8293187: Store initialized Enum classes in AOTCache [v3]

Ioi Lam iklam at openjdk.org
Wed Sep 18 01:09:09 UTC 2024


On Tue, 17 Sep 2024 20:55:19 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

>> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
>> 
>>  - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' of /jdk3/yak/open into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap
>>  - @vnkozlov comments
>>  - Clean up; removed unrelated changes in classPrinter.cpp
>>  - more cleanup
>>  - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' of /jdk3/yak/open into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap
>>  - More clean up for JDK-8293187
>>  - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' of /jdk3/yak/open into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap
>>  - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap
>>  - Merge branch 'jep-483-step-03-8329706-implement-xx-aot-class-linking' into jep-483-step-04-8293187-support-sun-invoke-util-wrapper-in-cds-archive-heap
>>  - Simplified implemented by AOTClassInitializer.
>>  - ... and 1 more: https://git.openjdk.org/jdk/compare/bcddf963...e15e76cd
>
> src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp line 242:
> 
>> 240: // - classes that were AOT-initialized by AOTClassInitializer
>> 241: // - the classes of all objects that are reachable from the archived mirrors of
>> 242: //   the AOT-linked classes for <class_loader>.
> 
> It seems this function covers the first two categories, but not the AOT-linked classes. Is that correct?

Correct. Not all aot-linked classes are initialized by this function. Most them are initialized on first use.

> src/hotspot/share/oops/instanceKlass.cpp line 846:
> 
>> 844:     // If we have a preinit mirror, we may come to here if a supertype is not
>> 845:     // yet initialized. It will still be quicker than usual, as we will skip the
>> 846:     // execution of <clinit> of this class.
> 
> How do we ensure clinit is skipped in this case?

There's a test like this inside `InstanceKlass::call_class_initializer()`


  if (has_aot_initialized_mirror() && CDSConfig::is_loading_heap()) {
    return;

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20958#discussion_r1764256468
PR Review Comment: https://git.openjdk.org/jdk/pull/20958#discussion_r1764257341


More information about the hotspot-dev mailing list