RFR: 8340733: Add scope for relaxing constraint on JavaCalls from CompilerThread [v5]

Doug Simon dnsimon at openjdk.org
Thu Oct 10 07:42:12 UTC 2024


On Fri, 4 Oct 2024 16:34:54 GMT, Tomáš Zezula <duke at openjdk.org> wrote:

>> [JDK-8318694](https://bugs.openjdk.org/browse/JDK-8318694) limited the ability for JVMCI CompilerThreads to make Java upcalls. This is to mitigate against deadlock when an upcall does class loading. Class loading can easily create deadlock situations in -Xcomp or -Xbatch mode.
>> 
>> However, for Truffle, upcalls are unavoidable if Truffle partial evaluation occurs as part of JIT compilation inlining. This occurs when the Graal inliner sees a constant Truffle AST node which allows a Truffle-specific inlining extension to perform Truffle partial evaluation (PE) on the constant. Such PE involves upcalls to the Truffle runtime (running in Java).
>> 
>> This PR provides the escape hatch such that Truffle specific logic can put a compiler thread into "allow Java upcall" mode during the scope of the Truffle logic.
>
> Tomáš Zezula has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplified C2V_BLOCK.

Looks good to me.

src/hotspot/share/compiler/compilerThread.cpp line 58:

> 56: 
> 57: void CompilerThread::set_compiler(AbstractCompiler* c) {
> 58:   /*

The comment could be a little shorter:

  /*
   * Compiler threads need to make Java upcalls to the jargraal compiler.
   * Java upcalls are also needed by the InterpreterRuntime when using jargraal.
   */

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

Marked as reviewed by dnsimon (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21285#pullrequestreview-2359296330
PR Review Comment: https://git.openjdk.org/jdk/pull/21285#discussion_r1794843319


More information about the hotspot-compiler-dev mailing list