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

Thomas Stuefe stuefe at openjdk.org
Fri Apr 19 06:53:56 UTC 2024


On Thu, 18 Apr 2024 22:19:31 GMT, Ioi Lam <iklam 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.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18848#pullrequestreview-2010653912


More information about the hotspot-dev mailing list