[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:59 UTC 2020


On Wed, 8 Jul 2020 20:09:04 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> 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.

@RogerRiggs can you check out the delta patch:
   https://github.com/openjdk/valhalla/pull/102/commits/b295ac571e78c12e8bb80a4568aab0d79cdd3d06

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

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


More information about the valhalla-dev mailing list