RFR: 8350209: Preserve adapters in AOT cache [v7]

Vladimir Kozlov kvn at openjdk.org
Fri Apr 25 00:51:53 UTC 2025


On Fri, 25 Apr 2025 00:44:46 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> src/hotspot/share/code/aotCodeCache.cpp line 62:
>> 
>>> 60: }
>>> 61: 
>>> 62: static void exit_vm_on_store_failure() {
>> 
>> It's a bit confusing to see `exit_vm_on_load_failure()` and `exit_vm_on_store_failure()` to silently proceed unless a flag is explicitly specified.
>> 
>> Moreover, how reliable `AOTAdapterCaching = false` to fail-fast and avoid repreated load/store attempts? At least, I see that `AOTCodeCache` ctor cache `AOTAdapterCaching`, so it won't see the update.
>> 
>> How does it affect adapter code generation during assembly phase?
>
> We check failure state of AOT code cache when query about using adapters caching:
> 
>   bool for_use()  const { return _for_use  && !_failed; }
>   bool for_dump() const { return _for_dump && !_failed; }
>   static bool is_on() CDS_ONLY({ return _cache != nullptr && !_cache->closing(); }) NOT_CDS_RETURN_(false);
>   static bool is_on_for_use()  { return is_on() && _cache->for_use(); }
>   static bool is_on_for_dump() { return is_on() && _cache->for_dump(); }
> 
> 
> 
>   static bool is_dumping_adapters() { return is_on_for_dump() && _cache->adapter_caching(); }
>   static bool is_using_adapters()   { return is_on_for_use() && _cache->adapter_caching(); }

AOT adapters code caching and loading is guarded by these methods not by flag.

Setting AOTAdapterCaching to false on failure is simple indication that adapter caching is switched off for someone who will look on final state of flag.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24740#discussion_r2059413988


More information about the hotspot-compiler-dev mailing list