RFR: 8348322: AOT cache creation crashes with "All cached hidden classes must be aot-linkable" when AOTInvokeDynamicLinking is disabled [v3]

Calvin Cheung ccheung at openjdk.org
Sat Mar 1 00:59:23 UTC 2025


On Sat, 1 Mar 2025 00:06:40 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> I removed the `CDSConfig::is_initing_classes_at_dump_time()` since the conditions are the same as `CDSConfig::is_dumping_method_handles()`. All the calls to `CDSConfig::is_initing_classes_at_dump_time()` have been updated accordingly.
>
> I think we should keep `is_initing_classes_at_dump_time()`, because it's used as a precondition for archiving initialized Java mirrors. Putting such code inside `is_dumping_method_handles()` would not make sense.
> 
> In fact, archived method handles require the ability to store initialized mirrors (for the hidden classes). So I think we should change `is_dumping_method_handles()` to this:
> 
> 
> // When we can dump initialized classes mirrors, we automatically enable the archiving of MethodHandles.
> // This will in turn enable the archiving of MethodTypes and hidden classes that are used in the
> // implementation of MethodHandles. Note: these hidden classes need to be stored in the initialized state,
> // as we don't have a mechanism to trigger their initialization on-demand.
> // Archived MethodHandles are required for higher-level optimizations such as AOT resolution of invokedynamic
> // and dynamic proxies.
> bool CDSConfig::is_dumping_method_handles() {
>   return is_initing_classes_at_dump_time();
> }

I added back the `CDSConfig::is_initing_classes_at_dump_time()` function and reverted most of previous changes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23546#discussion_r1976186871


More information about the hotspot-runtime-dev mailing list