RFR: 8375654: Exclude all array classes from dynamic CDS archive

Ioi Lam iklam at openjdk.org
Thu Jan 22 04:13:50 UTC 2026


In `A` is a subtype of `B`,  it's possible for an `ObjArrayKlass` for `A[]` to be archived in the dynamic CDS archive and its `_secondary_supers` contains a pointer to an `ObjArrayKlass` for `B[]` that's also archived in the dynamic archive. 

This scenario used to be supported, but since [JDK-8374639](https://bugs.openjdk.org/browse/JDK-8374639), if `B` is archived in the static CDS archive, at runtime a different `B[]` is created dynamically. As a result, we can no longer typecast an instance of `A[]` into an instance of `B[]`.

Since `ObjArrayKlasses` are cheap to allocate at runtime, the easiest fix is to simply not store any  `ObjArrayKlass` in the dynamic CDS archive.

(I also added missing copyright header to a problem list file used by CDS/AOT testing).

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

Commit messages:
 - 8375654: Exclude all array classes from dynamic CDS archive

Changes: https://git.openjdk.org/jdk/pull/29356/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29356&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8375654
  Stats: 108 lines in 3 files changed: 107 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/29356.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29356/head:pull/29356

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


More information about the hotspot-runtime-dev mailing list