JDK-8214352 : C1: Unnecessary "compilation bailout: block join failed" with JVMTI
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-27
  • Updated: 2023-08-15
  • Resolved: 2018-12-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.3Fixed 13 b01Fixed
Related Reports
Relates :  
Relates :  
Description
We have noticed some C1 compilation bailouts when using a JVMTI agent which enables the capability "can_access_local_variables".
This can be observed when using the following VM options (in debug build):
-XX:+PrintBailouts -agentlib:jdwp=transport=dt_socket,address=80,server=y,suspend=n

For example SPEC JVM98 compress:
2073  408 %     3       spec.benchmarks._201_compress.Compressor::compress @ 72 (328 bytes)   COMPILE SKIPPED: block join failed (retry at different tier)

We also see several "compilation bailout: block join failed" when running Octane benchmark.

This happens when BlockBegin::try_merge finds out that a Phi function for a local value in a loop has inputs with different types. We are obviously beyond the life range  (out of scope) and the local value is invalid at this point. The bailout can be avoided by invalidating corresponding Phi functions. We just need to skip them when processing exception entries later on.
In very rare cases, we may still bail out from LIRGenerator::move_to_phi where we already check for such Phi functions (since JDK-8151818).

Comments
Fix Request This small change improves C1's behavior when a JVMTI agent is attached. It has been tested in jdk13 for more than a month and much longer at SAP. Applies cleanly.
21-01-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/b3830528df29 User: mdoerr Date: 2018-12-14 09:01:05 +0000
14-12-2018