RFR: 8353014: Exclude AOT tooling classes from AOT cache [v4]

John R Rose jrose at openjdk.org
Fri Apr 4 22:32:03 UTC 2025


On Thu, 3 Apr 2025 23:59:29 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> When creating the AOT configuration file or the AOT cache file, we load a few "AOT tooling" classes that are not needed in the production run. This PR adds an API for filtering out such classes to reduce footprint.
>> 
>> In addition, with the upcoming [JDK-8325147](https://bugs.openjdk.org/browse/JDK-8325147) (Ahead-of-Time Method Profiling), profiles for the tooling classes will be also be excluded. This will prevent the JVM from compiling methods at start-up which aren't going to be used.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Thread safety: AOTClassFilter::is_aot_tooling_class() can potentially be called by multiple threads concurrently

CAS is very good because it can easily detect the error condition of two writers colliding.  But your final version is fine also; just use a tiny critical section and check pre- and post-states.  It's good that you confined the API to one thread; it's more risky to do things that other threads may or may not overhear.

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

PR Comment: https://git.openjdk.org/jdk/pull/24272#issuecomment-2779828675


More information about the hotspot-runtime-dev mailing list