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

Andrew Dinn adinn at openjdk.org
Tue Oct 1 09:59:47 UTC 2024


On Tue, 1 Oct 2024 06:15:19 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/heapShared.cpp line 1009:
>> 
>>> 1007: //
>>> 1008: // The set of classes that are required to be initialized for the archived
>>> 1009: // java mirrors are recorded in _runtime_default_subgraph_info (which probably
>> 
>> _runtime_default_subgraph_info is derived from _default_subgraph_info, the latter being the subgraph associated with class java.lang.Object. Perhaps using the prefix `root` or `jlobject` would make this clearer i.e. `_root_subgraph_info` and `_runtime_root_subgraph_info` or `_jlobject_subgraph_info` and `_runtime_jlobject_subgraph_info`.
>
> `root` may be a little over-loaded, because we have `HeapShared::get_root(int)` to get an arbitrary object with an integer index.
> 
> I renamed the various field/functions to `special_subgraph`, and added a comment about what this subgraph contains. What do you think?
> 
> Also, the two `subgraph_info` fields are renamed to the following:
> 
> 
>   static KlassSubGraphInfo* _dump_time_special_subgraph;              // for collecting info during dump time
>   static ArchivedKlassSubGraphInfoRecord* _run_time_special_subgraph; // for initializing classes during run time.

I agree `root` is too ambiguous. I think renaming the fields and methods to use `special_subgraph` works well and the comments make it very clear how the dump time and runtime subgraphs are used.

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

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


More information about the hotspot-dev mailing list