RFR: 8059632: Method reference compilation uses incorrect qualifying type

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Oct 21 10:22:15 UTC 2022


On Fri, 21 Oct 2022 09:31:11 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

> Align with JLS 13.1 (the qualifying class or interface of the method invocation) by
>     referring to the type of the receiver rather than the type of the declaring 
>     class/interface in the bootstrap attribute

Looks very good to me. Nice unification of the code, the spec is quite clear on this (binary form of method references and method invocation should be the same).

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 3651:

> 3649:             // array clone can be qualified by the array type in later targets
> 3650:             Symbol qualifier;
> 3651:             if ((qualifier = qualifiedSymbolCache.get(site)) == null) {

I know this code has been moved here from Gen - I'd be very very curious to understand if the caching mechanism actually does anything meaningful performance-wise. Seems just a way to add more state.

-------------

Marked as reviewed by mcimadamore (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10809


More information about the compiler-dev mailing list