Originally reported by [~ecaspole].
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 that I had planned to fix later with JDK-8284443 because I thought it wouldn't have an impact on performance. Turns out it does, so I'll fix it separately with this issue.