RFR: 8321033: Avoid casting Array to GrowableArray [v2]
Ioi Lam
iklam at openjdk.org
Thu Jun 13 21:01:15 UTC 2024
On Thu, 13 Jun 2024 20:12:49 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> `ModuleEntry::_reads` is declared as an GrowableArray<ModuleEntry*>*, but when stored in a CDS archive, it's assigned to an Array<ModuleEntry*>*. To ensure better type safety, `ModuleEntry::_reads` is changed to a generic pointer which uses two different getters and setters as well as two booleans to ensure the value is interpreted correctly. This was chosen to avoid introducing a new field to the ModuleEntry class, as another pointer and further alignment would increase the size of the ModuleEntry array. Verified with tier1-5 tests.
>
> Matias Saavedra Silva 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 three additional commits since the last revision:
>
> - Merge branch 'master' into reads_8321033
> - Changed generic pointer to union
> - 8321033: Avoid casting Array to GrowableArray
LGTM. Just one nit.
Oops, noticed one thing:
`_reads_is_archived` is used only in debug code. Declaration and references to it should be inside `DEBUG_ONLY`.
-------------
Marked as reviewed by iklam (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19549#pullrequestreview-2116976332
Changes requested by iklam (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19549#pullrequestreview-2117021448
More information about the hotspot-runtime-dev
mailing list