RFR: 8321033: Avoid casting Array to GrowableArray [v7]

Matias Saavedra Silva matsaave at openjdk.org
Mon Jun 17 14:35:32 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.

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 10 additional commits since the last revision:

 - Merge branch 'master' into reads_8321033
 - Fixed build failure
 - Moved state bool into initializer list
 - Reverted assert
 - Added assert to ensure reads is empty
 - Calvin comment
 - Ioi comments
 - Merge branch 'master' into reads_8321033
 - Changed generic pointer to union
 - 8321033: Avoid casting Array to GrowableArray

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/19549/files
  - new: https://git.openjdk.org/jdk/pull/19549/files/434554ab..eadcb9e5

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=19549&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=19549&range=05-06

  Stats: 3216 lines in 163 files changed: 2296 ins; 459 del; 461 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