[LW2] Q-mirror, method handle, and reflection support for Q-type

Tobias Hartmann tobias.hartmann at oracle.com
Wed Nov 28 12:28:30 UTC 2018


Hi Mandy,

> 2. Class::forName, Object::getClass, Member::getDeclaringClass
>    returns L-mirror in this version as Point.class 

But with your patch, it seems that MyValue.class != MyValue.class.asValueType() and also
MyValue.class != MyValue.class.asBoxType().

We now seem to have 3 types:
class compiler.valhalla.valuetypes.MyValue
class compiler.valhalla.valuetypes.MyValue/val
class compiler.valhalla.valuetypes.MyValue/box

This breaks TestNewAcmp.java which gets the parameter types of a method via getParameterTypes() and
then compares them to MyValue.class. This now returns false for a method with signature (MyValue v).

On 27.11.18 19:57, Mandy Chung wrote:
> It also fixes hotspot/jtreg/compiler/valhalla/valuetypes
> and hotspot/jtreg/runtime/valhalla/valuetypes tests to use
> Q-mirror in the method type correctly.

The changes to the compiler tests look good to me but I think TestNewAcmp.java and
TestNullableValueTypes.java need to be fixed as well:
http://cr.openjdk.java.net/~thartmann/valhalla/lworld/qmirror_fixes/webrev.00/

But even with these fixes, I still see:

Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException:
java.lang.NoSuchMethodException: no such method:
compiler.valhalla.valuetypes.getNull/0x00000008000cec40.getNull()MyValue1/invokeStatic
	at java.base/jdk.experimental.value.MethodHandleBuilder.loadCode(MethodHandleBuilder.java:110)
	at java.base/jdk.experimental.value.MethodHandleBuilder.loadCode(MethodHandleBuilder.java:77)
	at java.base/jdk.experimental.value.MethodHandleBuilder.loadCode(MethodHandleBuilder.java:72)
	at compiler.valhalla.valuetypes.TestNullableValueTypes.<clinit>(TestNullableValueTypes.java:229)
	... 9 more

Am I missing something?

I've also noticed that the webrev patch does not contain all the changes:
http://cr.openjdk.java.net/~mchung/valhalla/webrevs/q-mirror.01/q-mirror.changeset

For example, it misses the changes to the compiler tests. Maybe it also misses other parts and
that's why I'm still seeing these failures.

Thanks,
Tobias




More information about the valhalla-dev mailing list