RFR: 8330157: C2: Add a stress flag for bailouts
Daniel Skantz
duke at openjdk.org
Tue Jun 11 07:18:46 UTC 2024
This patch adds a diagnostic/stress flag for C2 bailouts. It can be used to support testing of existing bailouts to prevent issues like [JDK-8318445](https://bugs.openjdk.org/browse/JDK-8318445), and can test for issues only seen at runtime such as [JDK-8326376](https://bugs.openjdk.org/browse/JDK-8326376). It can also be useful if we want to add more bailouts ([JDK-8318900](https://bugs.openjdk.org/browse/JDK-8318900)).
We check two invariants.
a) Bailouts should be successful starting from any given `failing()` check.
b) The VM should not record a bailout when one is pending (in which case we have continued to optimize for too long).
a), b) are checked by randomly starting a bailout at calls to `failing()` with a user-given probability.
The added flag should not have any effect in debug mode.
Testing:
T1-5, with flag and without it. We want to check that this does not cause any test failures without the flag set, and no unexpected failures with it. Tests failing because of timeout or because an error is printed to output when compilation fails can be expected in some cases.
-------------
Commit messages:
- undo raised initialization; skip if stress seed is not initialized yet.
- remove unused var
- revert last
- lower stress seed init again
- make test quicker
- remove warning check entirely
- import
- fix test condition
- whitespace
- add a basic test
- ... and 6 more: https://git.openjdk.org/jdk/compare/83b34410...9245b2c6
Changes: https://git.openjdk.org/jdk/pull/19646/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19646&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8330157
Stats: 146 lines in 12 files changed: 125 ins; 0 del; 21 mod
Patch: https://git.openjdk.org/jdk/pull/19646.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19646/head:pull/19646
PR: https://git.openjdk.org/jdk/pull/19646
More information about the hotspot-compiler-dev
mailing list