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

Jesper Steen Møller jespersm at openjdk.java.net
Thu Sep 16 23:26:56 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.

The change to the runtime in JDK-8174983 will allow boxing and unboxing: In lworld terms, I suppose this would map to turning a QFoo (primitive class on-stack) into an LFoo (reference to primitive class), and vice versa (although I'm not sure how null references would be handled). There are obvious reasons why this is a useful feature for LambdaMetafactory.

However, I find it odd for javac *not* to generate identical code for a callsite depending on whether or not the enclosing class is "reference-favoring" or not. This should only influence _uses_ of the type, not the type itself. Primitive class instance methods should still "operate on" instances (QFoo), not references to instance (LFoo).

So, I think that the javac should be consistent regarding the emitting of receiver-types, even if for the sake of the conceptual consistency itself.


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

More information about the valhalla-dev mailing list