On Thu, 16 Apr 2026 23:09:52 GMT, Vladimir Kozlov <[email protected]> wrote:

> Improve startup and warmup time by making optimized native code for an 
> application instantly available when the HotSpot Java Virtual Machine starts. 
> Achieve this by compiling application code to native code in a training run, 
> storing the native code in the [AOT 
> cache](https://openjdk.org/jeps/483#Description) for use in subsequent 
> production runs.
> 
> More details in the [JEP](https://openjdk.org/jeps/544).
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/hotspot/share/code/aotCodeCache.cpp line 2056:

> 2054:     log_info(aot, codecache, nmethod)("%d (L%d) '%s' AOT%s is skipped: 
> method is not in AOT cache",
> 2055:              compile_id(), comp_level(), 
> method->name_and_sig_as_C_string(), (for_preload ? " preload" : ""));
> 2056:     assert(AOTCacheAccess::can_generate_aot_code(method), "sanity");

Why do we assert the opposite of the condition that led us into this branch and 
then return nullptr? If we intend to fail then surely we should be calling 
ShouldNotReachHere()

src/hotspot/share/code/aotCodeCache.cpp line 2066:

> 2064:              compile_id(), comp_level(), 
> method->name_and_sig_as_C_string(),
> 2065:              (for_preload ? " preload" : ""), 
> holder->class_loader_data()->loader_name());
> 2066:     assert(builtin_loader, "sanity");

Same question as above: ShouldNotReachHere()?

src/hotspot/share/code/aotCodeCache.cpp line 3524:

> 3522:   
> ADD_EXTERNAL_ADDRESS(MountUnmountDisabler::global_vthread_transition_disable_count_address());
> 3523: 
> 3524: #if INCLUDE_JFR

In libraryKit we create a few raw pointer constants

    makecon(TypeRawPtr::make(<address_expr>));

which don't seem to have a corresponding `ADD_EXTERNAL_ADDRESS`:

src/hotspot/share/opto/library_call.cpp:3086:
    Node* epoch_address = 
makecon(TypeRawPtr::make(JfrIntrinsicSupport::epoch_address()));

src/hotspot/share/opto/library_call.cpp:3120:
    Node* signaled_flag_address = 
makecon(TypeRawPtr::make(JfrIntrinsicSupport::signal_address()));

src/hotspot/share/opto/library_call.cpp:3375:
  Node* global_addr = makecon(TypeRawPtr::make((address)&VMContinuations));

src/hotspot/share/opto/library_call.cpp:3403:
  Node* epoch_generation_address = 
makecon(TypeRawPtr::make(JfrIntrinsicSupport::epoch_generation_address()));

I believe they all relate to JFR. Is there a reason to exclude them?

src/hotspot/share/compiler/abstractCompiler.hpp line 54:

> 52:   };
> 53: 
> 54:  public:

The above declaration is now redundant

src/hotspot/share/compiler/compilationPolicy.cpp line 112:

> 110:       requires_online_compilation = (ctd->init_deps_left_acquire() > 0);
> 111:     }
> 112:     // Skip compilation if next_level doesn't have CDT or CDT

CDT? --> CTD (x 2)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30778#discussion_r3188777830
PR Review Comment: https://git.openjdk.org/jdk/pull/30778#discussion_r3189809050
PR Review Comment: https://git.openjdk.org/jdk/pull/30778#discussion_r3194722998
PR Review Comment: https://git.openjdk.org/jdk/pull/30778#discussion_r3203236198
PR Review Comment: https://git.openjdk.org/jdk/pull/30778#discussion_r3203251695

Reply via email to