RFR: 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events

Richard Reingruber rrich at openjdk.java.net
Wed Jun 30 08:14:21 UTC 2021


This change moves the first uncommon trap in `GraphKit::builtin_throw()` to the block where it is actually needed because it has a return statement.

Other paths reach the second uncommon trap at the end of `GraphKit::builtin_throw()`. On these paths the first UCT is not needed.

The change improves performance if the VM can post exceptions to JVMTI agents.
E.g. I found that the change improves the score for the compiler.compiler benchmark of SPECjvm2008 by 4% if the JDWP agent is loaded (see attachment in JBS).

Note that with the change we can trap with `Deoptimization::Action_maybe_recompile` if we don't throw a preallocated exception where before we would have trapped with `Deoptimization::Action_none` if it was for posting the exception to JVMTI. I'd think this is preferable.

The fix passed our CI testing: JCK and JTREG, also in Xcomp mode, SPECjvm2008, SPECjbb2015, Renaissance Suite,
SAP specific tests with fastdebug and release builds on all platforms.

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

Commit messages:
 - Merge branch 'master'
 - 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw for JVMTI exception events

Changes: https://git.openjdk.java.net/jdk/pull/4623/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4623&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269574
  Stats: 14 lines in 1 file changed: 7 ins; 7 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4623.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4623/head:pull/4623

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


More information about the hotspot-compiler-dev mailing list