RFR(S): 8225317: [lworld] Fix Class::asPrimaryType and isAssignableFrom C2 intrinsics after JDK-8223351

Tobias Hartmann tobias.hartmann at oracle.com
Thu Jun 13 13:00:32 UTC 2019


Hi,

please review the following fix:
https://bugs.openjdk.java.net/browse/JDK-8225317
http://cr.openjdk.java.net/~thartmann/8225317/webrev.00/

Changes:
- The asPrimaryType and asIndirectType intrinsics should return 'this' if the receiver is not a
value type mirror.
- The isAssignableFrom intrinsic incorrectly returns true for
MyValue1.class.isAssignableFrom(MyValue1.class.asIndirectType()). The problem is that the subtype
check passes because MyValue and MyValue? have the same klass. We need to additionally check if the
mirrors are equal if the supertype mirror is a "primary type".
- I've also refactored the value mirror check into an own method (at some point we need to rename
"value class" to "inline class" but that's out of the scope of this patch).

Thanks,
Tobias


More information about the valhalla-dev mailing list