RFR: 8314846: Do not store Klass::_secondary_super_cache in CDS archive

Ioi Lam iklam at openjdk.org
Mon Apr 22 15:55:33 UTC 2024


On Fri, 19 Apr 2024 06:51:33 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> This bug was found during Leyden development.
>> 
>> CDS's `ArchiveBuilder` expects the class metadata to stop mutating while we're inside the CDS dumping safepoint. However, `Klass::_secondary_super_cache` can be updated as a side effect of `Klass::is_subtype_of()`.
>> 
>> Currently, we don't call `Klass::is_subtype_of()`inside the CDS safepoint. However, it's likely that future optimizations will make such calls (as being done in the Leyden prototype). When that happens, the CDS dump will fail with a hard-to-debug failure (some class is found inside `_secondary_super_cache` that `ArchiveBuilder` doesn't know about.
>> 
>> There's no benefit in storing `Klass::_secondary_super_cache` in the CDS archive. So the safest thing to do is to stop scanning it during CDS dumping, and clear it to `nullptr` when the `Klass` is stored in the CDS archive.
>
> Makes sense.

Thanks @tstuefe @theRealAph for the review

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

PR Comment: https://git.openjdk.org/jdk/pull/18848#issuecomment-2069990483


More information about the hotspot-dev mailing list