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

Ioi Lam iklam at openjdk.org
Tue Oct 1 06:30:42 UTC 2024


On Mon, 30 Sep 2024 13:17:53 GMT, Andrew Dinn <adinn 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 109 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
>>  - Merge branch 'jep-483-step-02-8338018-rename-class-prelinker-to-aot-cp-resolver' into jep-483-step-03-8329706-implement-xx-aot-class-linking
>>  - Merge branch 'jep-483-step-01-8338017-add-aot-command-line-aliases' into jep-483-step-02-8338018-rename-class-prelinker-to-aot-cp-resolver
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into jep-483-step-01-8338017-add-aot-command-line-aliases
>>  - 8340864: Remove unused lines related to vmClasses
>>    
>>    Reviewed-by: shade, kvn
>>  - 8340831: Simplify simple validation for class definition in MethodHandles.Lookup
>>    
>>    Reviewed-by: redestad
>>  - 8340838: Clean up MutableCallSite to use explicit release fence instead of AtomicInteger
>>    
>>    Reviewed-by: jrose, redestad, shade
>>  - 8340956: ProblemList 4 java/nio/channels/DatagramChannel tests on macosx-all
>>    
>>    Reviewed-by: liach, alanb, darcy, dfuchs
>>  - 8340228: Open source couple more miscellaneous AWT tests
>>    
>>    Reviewed-by: prr
>>  - 8340684: Reading from an input stream backed by a closed ZipFile has no test coverage
>>    
>>    Reviewed-by: lancea
>>  - ... and 99 more: https://git.openjdk.org/jdk/compare/6029b35f...563bccb3
>
> src/hotspot/share/cds/heapShared.cpp line 939:
> 
>> 937: 
>> 938:   _run_time_subgraph_info_table.serialize_header(soc);
>> 939:   soc->do_ptr(&_runtime_default_subgraph_info);
> 
> It would help to have a comment here explaining that 1) before the do_ptr call the specific subgraph_info passed into this call holds all the classes that need to be initialized on behalf of java.lang.Object 2) after the call it is includes all the extra classes that need initializing on behalf of some archived java.lang.Class mirror. This would help to clarify why it was picked as the holder for these extra classes (i.e. it is the obvious root class from which to start running initializations).
> 
> If field `_runtime_default_subgraph_info` was renamed to identify it as being the root subgraph associated with class java.lang.Object this would also be clearer (see related comment)

Actually, the `do_ptr()` call is a somewhat cryptic API for passing values and pointers between the assembly phase and the production run.

In this example, during the production run, before the `do_ptr()` call,  `_runtime_default_subgraph_info` is null. After the call, it points to the `ArchivedKlassSubGraphInfoRecord` that was created by `HeapShared::archive_subgraph_info()` during the assembly phase.

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

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


More information about the hotspot-dev mailing list