RFR: 8355003: Implement Ahead-of-Time Method Profiling

Igor Veresov iveresov at openjdk.org
Sun Apr 27 00:34:45 UTC 2025


On Sat, 26 Apr 2025 22:11:58 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Improve warm-up time by making profile data from a previous run of an application instantly available, when the HotSpot Java Virtual Machine starts. Specifically, enhance the [AOT cache](https://openjdk.org/jeps/483) to store method execution profiles from training runs, reducing profiling delays in subsequent production runs.
>> 
>> More details in the JEP: https://bugs.openjdk.org/browse/JDK-8325147
>
> src/hotspot/share/ci/ciMethod.cpp line 1147:
> 
>> 1145: // heuristic (e.g. post call nop instructions; see InlineSkippedInstructionsCounter)
>> 1146: int ciMethod::inline_instructions_size() {
>> 1147:   if (_inline_instructions_size == -1) {
> 
> Why repeat this condition and not put new code under existing one?

The caching logic sets the `_inline_instructions_size` if the value is found in the archive. The normal logic doesn't need to run if this happens. 
Something like:

  if (_value == -1) {
       _value = get_from_cache();
  }
  if (_value == -1) { // didn't get it from the cache
    _value = compute_value();
  }

So basically to delineate the caching logic from the normal path. Does it make sense?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24886#discussion_r2061875051


More information about the hotspot-compiler-dev mailing list