[lworld] RFR: 8366973: [lworld] Deopt/recompilation cycle due to call to method with unloaded return type

Tobias Hartmann thartmann at openjdk.org
Tue Sep 9 11:42:35 UTC 2025


In some benchmarks we hit an endless deopt/recompilation cycle because of this bailout in C2 when we compile a method with an unloaded return type:
https://github.com/openjdk/valhalla/blob/858be30119bd5bc37a69d16042523f53bea71a36/src/hotspot/share/ci/ciTypeFlow.cpp#L766-L772

It's a regression / limitation from [JDK-8301007](https://bugs.openjdk.org/browse/JDK-8301007) that I had planned to fix later with [JDK-8284443](https://bugs.openjdk.org/browse/JDK-8284443) because I thought it wouldn't have an impact on performance. Turns out it does, so I'll fix it with this issue similar to what we do in `PhaseMacroExpand::expand_mh_intrinsic_return`.

For testing, I added a new `PreloadClasses` debug flag that's enabled by default. Disabling it will disable preloading of all classes from the LoadableDescriptors attributes. Running testing with this caught some more issues that I fixed in this PR as well. I'll add it to our (internal) stress testing job separately.

I also fixed some inconsistency in the preload logging and adjusted the corresponding tests.

Thanks,
Tobias

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

Commit messages:
 - And even more
 - Merge branch 'lworld' into JDK-8366973
 - Aaand more fixes
 - Some more fixes
 - Fixed EA
 - First prototype

Changes: https://git.openjdk.org/valhalla/pull/1554/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1554&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8366973
  Stats: 317 lines in 25 files changed: 207 ins; 18 del; 92 mod
  Patch: https://git.openjdk.org/valhalla/pull/1554.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1554/head:pull/1554

PR: https://git.openjdk.org/valhalla/pull/1554


More information about the valhalla-dev mailing list