[lworld] RFR: 8273301: [lworld] Bootstrap of instance-capturing lambda fails for reference favoring primitive types.

Mandy Chung mchung at openjdk.java.net
Fri Sep 17 00:14:54 UTC 2021

On Thu, 2 Sep 2021 20:10:36 GMT, Jesper Steen Møller <jespersm at openjdk.org> wrote:

> Fix the test by adjusting bootstrap parameters, like it was fixed in JDK-8271583.

I discussed with Dan offline to follow up my question in what cases javac should emit `(LFoo;)LR;` vs `(QFoo;)LR;`.   For the lambda case, having the receiver type as `QFoo;` is a good thing to do as it's an instance method of the enclosing class. 

For a method reference `o::m` where `o` is of primitive reference type, the factory type would be `(LFoo;)LR;`.   I have a test case that verifies the emitted code is:

28: invokedynamic #38,  0             // InvokeDynamic #1:get:(LX;)Ljava/util/function/Supplier;


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

More information about the valhalla-dev mailing list