[lworld] RFR: 8269956: [lworld] javac should generate `ldc LPoint; ` for class literal Point.class [v2]

Srikanth Adayapalam sadayapalam at openjdk.java.net
Tue Jul 27 12:54:48 UTC 2021

On Tue, 27 Jul 2021 12:50:20 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

>> Adjust meaning of type name in class literal expressions. Adjust tests accordingly
> Srikanth Adayapalam has updated the pull request incrementally with one additional commit since the last revision:
>   Address review comments (reinstate original code by backing out unneeded calls to asValueType() in addHelperClasses method invocation)

test/jdk/valhalla/valuetypes/StaticFactoryMethodHandleTest.java line 69:

> 67:         MethodType mtype0 = MethodType.methodType(DefaultConstructor.class.asValueType());
> 68:         MethodHandle mh0 = staticInitFactory(DefaultConstructor.val.class, mtype0);
> 69:         DefaultConstructor o0 = (DefaultConstructor)mh0.invokeExact();

While the preferred change is go from Point.class to Point.class.asValueType(), here is one of the few places I had to resort to Point.val.class - This is because we don't have a spec for Class#asValueType() similar to Object#getClass() where the compiler munges the return type of the method. As a result, code won't compile unless I change it to Point.val.class format


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

More information about the valhalla-dev mailing list