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

Ioi Lam iklam at openjdk.org
Fri Jan 23 06:28:18 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).

This pull request has now been integrated.

Changeset: 7f2aa59f
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/7f2aa59f8220f302a3f8662eeca3291dcf86d2ad
Stats:     108 lines in 3 files changed: 107 ins; 0 del; 1 mod

8375654: Exclude all array classes from dynamic CDS archive

Reviewed-by: kvn, vlivanov

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

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


More information about the hotspot-runtime-dev mailing list