RFR: 8268033: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"

Emanuel Peter duke at openjdk.java.net
Tue Jan 25 16:42:50 UTC 2022


…th "fatal error: Not compilable at tier 3: CodeBuffer overflow"

**Problem:**
When `BzhiTestI2L.java` is compiled with flag `-Xcomp` and `-XX:+VerifyOops`, it happens that also `sun.security.util.KnownOIDs::<clinit>` is compiled. This class is an `enum` with many string values. This generates a rather large code size for the `<clinit>` method. The additional code for verifying oops pushes it over the CodeBuffer limit (`NMethodSizeLimit`). Because of the overflow, the compilation hits a bailout. Because of `-XX:+AbortVMOnCompilationFailure` this aborts the test, it fails.

**Analysis:**
We can not control the size of library classes/enums, and the size of the generated code from the respective `<clinit>`.
`-Xcomp` and `-XX:+VerifyOops` are helpful flags for tests in general.
However, it does not make sense to require all methods to be compiled.

**Solution:**
Restrict compilation to the relevant classes in the test files.

**Alternative Solutions:**
1. Increase `NMethodSizeLimit`. The concrete value would be arbitrary, and if any class/enum exceeds it in the future, this same test bug reappears.
2. Drop `-XX:+AbortVMOnCompilationFailure`. This would accept bailouts, and the test would pass despite bailouts. This helps with the current testing bug. But in the future, unexpected bailouts would not be detected. This is problematic, because the test compiles code with the WhiteBox API, to check if it compiles correctly. Thus, bailouts are an important sign that something might have gone wrong.

The Test now passes (initialized with the same parameters as reported in issue).

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

Commit messages:
 - removed test from -Xcomp quarantine list
 - 8268033: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"

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

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


More information about the hotspot-compiler-dev mailing list