RFR: 8365407: Race condition in MethodTrainingData::verify() [v4]

Vladimir Kozlov kvn at openjdk.org
Thu Aug 21 18:32:51 UTC 2025


On Thu, 21 Aug 2025 17:45:02 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> src/hotspot/share/runtime/java.cpp line 522:
>> 
>>> 520:   if (AOTVerifyTrainingData) {
>>> 521:     EXCEPTION_MARK;
>>> 522:     CompilationPolicy::wait_replay_training_at_init(THREAD);
>> 
>> It is called on VM exit but name is `_at_init`. May be drop that from name.
>
> That's because `at_init` comes from `class initialization` events servicing. Those are enqueued after the class initialization is done. So, yes, it's at the shutdown, but the processing of class initializations is still happening.

This is low level knowledge nobody except you know (now I know). For other people who looks on this, it is confusing. `_at_init` gives nothing to understand what code does. I think `wait_replay_training_to_finish()` may be better.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26866#discussion_r2291838685


More information about the hotspot-dev mailing list