RFR: 8375654: Exclude all array classes from dynamic CDS archive
Ioi Lam
iklam at openjdk.org
Fri Jan 23 06:28:16 UTC 2026
On Thu, 22 Jan 2026 17:41:17 GMT, Vladimir Kozlov <kvn 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).
>
> Good.
Thanks @vnkozlov and @iwanowww for the review
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29356#issuecomment-3788518839
More information about the hotspot-runtime-dev
mailing list