RFR: 8297290: Use int indices to reference CDS archived primitive mirrors [v3]

Ioi Lam iklam at openjdk.org
Wed Nov 23 00:24:23 UTC 2022


On Tue, 22 Nov 2022 20:30:41 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:

>> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>> 
>>  - Merge branch 'master' into 8297290-simplify-cds-primitive-mirror-storage
>>  - @calvinccheung comments
>>  - fixed spaces
>>  - 8297290: Simplify the storage for CDS archived primitive mirrors
>
> src/hotspot/share/memory/universe.cpp line 93:
> 
>> 91: OopHandle Universe::_mirrors[T_VOID+1];
>> 92: #if INCLUDE_CDS_JAVA_HEAP
>> 93: int Universe::_archived_mirror_indices[T_VOID+1];
> 
> a minor suggestion - I feel it would be better to name it as `_archived_basic_type_mirror_indices` as it only stores mirrors for primitive types. Same for the other functions accessing `_archived_mirror_indices` i.e. `set_archived_mirror_index` -> `set_archived_basic_type_mirror_index` and `update_archived_mirrors` -> `update_archived_basic_type_mirrors`.

I renamed the field/functions as you suggested. Now they are consistent with existing functions like `Universe::initialize_basic_type_mirrors()`

I think eventually they should be named to `primitive_type_mirrors` since we don't use them for the reference types. But there are a few functions that are unrelated to this RFE, so I'll probably do the renaming in a subsequent RFE.

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

PR: https://git.openjdk.org/jdk/pull/11256


More information about the hotspot-runtime-dev mailing list