[lworld] RFR: JDK-8247663: [lworld] LambdaMetaFactory should allow an inline value projection type to convert to its reference projection type [v2]

Mandy Chung mchung at openjdk.java.net
Wed Jul 8 20:26:57 UTC 2020

On Wed, 8 Jul 2020 18:21:43 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Mandy Chung has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev
>> excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since
>> the last revision:
>>  - Merge
>>  - revision per Roger's feedback
>>  - lambda metafactory supports inline widening/narrowing
> src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java line 402:
>> 401:         }
>> 402:
>> 403:         if (!fromType.isInlineClass() && !toType.isInlineClass()) {
> Since fromType.valueType is an Optional<Class<?>> the code could be rearranged to use is Present() and not double check
> for inline so many times. If it is a performance issue it should be refactored to do the complete check of one case
> before the other.

I simplified the check.  I also uncovered a bug in the spec for `Class::valueType` and `Class::referenceType` and
included a spec fix in this patch.


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

More information about the valhalla-dev mailing list