RFR: 8317269: Store old classes in linked state in AOT cache [v2]

Ioi Lam iklam at openjdk.org
Mon Sep 1 01:27:24 UTC 2025


On Mon, 1 Sep 2025 01:03:17 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> I don't think we share safepoints anymore (?)
>
> This code is used by places like this in methodData.cpp:
> 
> 
> static bool is_excluded(Klass* k) {
> #if INCLUDE_CDS
>   if (CDSConfig::is_at_cds_safepoint()) {
>     // Check for CDS exclusion only at CDS safe point.
>     if (k->is_instance_klass() && !InstanceKlass::cast(k)->is_loaded()) {
>       log_debug(aot, training)("Purged %s from MDO: unloaded class", k->name()->as_C_string());
>       return true;
>     } else {
>       bool excluded = SystemDictionaryShared::should_be_excluded(k);
>       if (excluded) {
>         log_debug(aot, training)("Purged %s from MDO: excluded class", k->name()->as_C_string());
>       }
>       return excluded;
>     }
>   }
> #endif
>   return false;
> }
> 
> 
> This function is usually called with GC safepoints (for class unloading, etc). If that's the case, we must not call `SystemDictionaryShared::should_be_excluded(k)`, because the exclusion check is not yet complete.
> 
> So we need to distinguish whether the current safepoint is CDS or not.

I added an assert for this. See commit db57b101267f407535ffdc1f3cb685738d898f80

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26754#discussion_r2312729461


More information about the hotspot-dev mailing list