RFR: 8286063: check compiler queue after calling AbstractCompiler::on_empty_queue

Doug Simon dnsimon at openjdk.java.net
Tue May 3 17:06:32 UTC 2022


On Tue, 3 May 2022 14:42:28 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> [JDK-8242440](https://bugs.openjdk.java.net/browse/JDK-8242440) added support for a JIT compiler to be notified when a `CompilerThread` has an empty compilation queue. It's possible for an implementation of `AbstractCompiler::on_empty_queue` to temporarily release `MethodCompileQueue_lock` (e.g. [here](https://github.com/openjdk/jdk/blob/357b1b18c20233f16fba872b79237e9459f5ba43/src/hotspot/share/jvmci/jvmciCompiler.cpp#L174)). This means a non-CompilerThread has a chance to enqueue a new compilation task. As such, the `CompilerThread` should check for this after calling `AbstractCompiler::on_empty_queue`.
>
> src/hotspot/share/compiler/compileBroker.cpp line 450:
> 
>> 448:       // so check again whether any tasks were added to the queue.
>> 449:       break;
>> 450:     }
> 
> So this is just optimization to avoid waiting 5 sec?

Yes. Normally it does not matter but in `-Xbatch` mode it means one compilation every 5 seconds and tests like `TestTrichotomyExpressions` time out.

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

PR: https://git.openjdk.java.net/jdk/pull/8517


More information about the hotspot-compiler-dev mailing list