RFR: 8321033: Avoid casting Array to GrowableArray

Matias Saavedra Silva matsaave at openjdk.org
Tue Jun 4 20:53:20 UTC 2024


`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.

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

Commit messages:
 - 8321033: Avoid casting Array to GrowableArray

Changes: https://git.openjdk.org/jdk/pull/19549/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19549&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321033
  Stats: 41 lines in 2 files changed: 27 ins; 1 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/19549.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19549/head:pull/19549

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


More information about the hotspot-runtime-dev mailing list