RFR: 8367613: Test compiler/runtime/TestDontCompileHugeMethods.java failed

Christian Hagedorn chagedorn at openjdk.org
Tue Sep 16 08:13:10 UTC 2025


On Tue, 16 Sep 2025 06:48:23 GMT, Man Cao <manc at openjdk.org> wrote:

> Hi,
> 
> Could anyone approve this change that exclude this test when running with `-Xcomp`? This avoids the test failure reported in [JDK-8367613](https://bugs.openjdk.org/browse/JDK-8367613).
> 
> For reasons I don't yet understand, the `HugeSwitch::shortMethod` method is not compiled under `-Xcomp  -XX:TieredStopAtLevel=1`. The method gets compiled with either `-Xcomp` or `-XX:TieredStopAtLevel=1`, but not both. I appreciate if anyone could provide insights on possible reasons.

When looking at the test, it seems that we want to verify that `shortMethod()` is compiled while `hugeSwitch()` is not. When running with `-Xcomp`, we will immediately compile `main()` and directly inline `shortMethod()` with C1 (with C2 we fail to inline with "failed initial checks" and thus will compile `shortMethod()` separately when calling it the first time). Therefore, with C1, we will not compile `shortMethod()` separately and the test fails. 

Excluding `-Xcomp` looks reasonable. An alternative would be to exclude `main()` from compilation. But I think for the purpose of this test, excluding `-Xcomp` seems better.

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27306#pullrequestreview-3228249028


More information about the hotspot-compiler-dev mailing list