RFR: 8355442: Reference field lambda forms with type casts are not generated [v2]

Chen Liang liach at openjdk.org
Tue Apr 29 21:41:49 UTC 2025


On Tue, 29 Apr 2025 21:24:11 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   use var
>
> src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 626:
> 
>> 624:             FT_UNCHECKED_REF   = Wrapper.OBJECT.ordinal(),
>> 625:             FT_CHECKED_REF     = Wrapper.VOID.ordinal(),
>> 626:             FT_LIMIT           = Wrapper.COUNT;
> 
> I don't see why these changes are needed?

These avoid wasting space in the field lambda form array.

> src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java line 440:
> 
>> 438:                     throw new InternalError(b + " non-volatile " + ftype);
>> 439:                 forms.add(form);
>> 440:                 names.add(form.kind.defaultLambdaName);
> 
> I suppose the fact that static/non-static variants have the same name is okay since they will have a different number of parameters?

Yep, I left the comment at https://github.com/openjdk/jdk/pull/24887/files#diff-62978b9d88b0791f31c654103e6b97eea8bf711fa37ac4bf614847b26f44e0c1R761

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24887#discussion_r2067468413
PR Review Comment: https://git.openjdk.org/jdk/pull/24887#discussion_r2067469292


More information about the core-libs-dev mailing list