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

Nils Eliasson neliasso at openjdk.java.net
Thu Jul 1 18:17:02 UTC 2021


On Tue, 29 Jun 2021 12:48:23 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

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

Looks good.

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

Marked as reviewed by neliasso (Reviewer).

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


More information about the hotspot-compiler-dev mailing list