RFR: 8268553: [lworld] CI must return secondary mirror when accessing CONSTANT_Class with Q-signature

Tobias Hartmann thartmann at openjdk.java.net
Fri Jul 9 08:54:17 UTC 2021


On Thu, 10 Jun 2021 13:01:41 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> Please review this small change in CI to return the secondary mirror when accessing a CONSTANT_Class_info entry containing a Q-signature.
> This change fixes all compiler tests failures in the lqagain branch but the ones depending on intrinsics (Class::getSuperclass intrinsic and Class::isAssignableFrom intrinsics need to be fixed in a separate changeset).
> 
> Thank you,
> 
> Fred

src/hotspot/share/ci/ciEnv.cpp line 700:

> 698:     assert (klass->is_instance_klass() || klass->is_array_klass(),
> 699:             "must be an instance or array klass ");
> 700:     if (tag.is_unresolved_klass()) {

This is too strict because `klass->is_loaded()` can be true even if `tag.is_unresolved_klass()`. This leads to C2 adding uncommon traps to trigger resolution in the interpreter. However, I've observed cases were the interpreter never resolved the constant and `tag.is_unresolved_klass()` remained true, leading to continuous deoptimizations in C2 compiled code. I'm not sure if that is expected behavior or if there is a bug in the interpreter but the CI code should be fixed in any case. I'll do that with [JDK-8267932](https://bugs.openjdk.java.net/browse/JDK-8267932).

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

PR: https://git.openjdk.java.net/valhalla/pull/442


More information about the valhalla-dev mailing list