RFR: 8286063: check compiler queue after calling AbstractCompiler::on_empty_queue
Vladimir Kozlov
kvn at openjdk.java.net
Tue May 3 14:46:21 UTC 2022
On Tue, 3 May 2022 14:07:30 GMT, Doug Simon <dnsimon 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?
-------------
PR: https://git.openjdk.java.net/jdk/pull/8517
More information about the hotspot-compiler-dev
mailing list