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

Doug Simon dnsimon at openjdk.org
Wed Sep 25 06:02:13 UTC 2024


> [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.

Doug Simon has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:

  added CompilerThreadCanCallJavaScope

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21171/files
  - new: https://git.openjdk.org/jdk/pull/21171/files/258492da..c3e23c0e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21171&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21171&range=00-01

  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/21171.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21171/head:pull/21171

PR: https://git.openjdk.org/jdk/pull/21171


More information about the hotspot-compiler-dev mailing list