RFR: 8375654: Exclude all array classes from dynamic CDS archive
Vladimir Ivanov
vlivanov at openjdk.org
Thu Jan 22 18:58:27 UTC 2026
On Thu, 22 Jan 2026 02:49:17 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> 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).
Looks good.
-------------
Marked as reviewed by vlivanov (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/29356#pullrequestreview-3694026950
More information about the hotspot-runtime-dev
mailing list