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


> This patch fixes `LambdaMetaFactory` to allow inline value projection type to convert to its reference projection type.
> 
> `Class::isAssignableFrom` and `Class::asSubclass` are the APIs to determine if a given type can be safely cast to this
> Class.
> -  Class::isAssignableFrom tests if a given type can be converted to this Class via a widening reference conversion.
> - Class::asSubclass tests if a given type can be converted to this Class via a narrowing conversion.
> 
> The current thought is to keep  `Class::isAssignableFrom` and `Class::asSubclass` to respect the class file hierarchy
> and a cast is needed when converting from `V.val` to `V.ref`.   `LambdaMetaFactory` and other frameworks will need to
> extend the type adaptability check to support inline types.  I considered adding `Class::isConvertibleFrom` method but
> we should wait for more use cases proving the need of such convenience method.  This check can be done by calling
> `Class::referenceType` and `Class::valueType`.

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

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

Changes:
  - all: https://git.openjdk.java.net/valhalla/pull/102/files
  - new: https://git.openjdk.java.net/valhalla/pull/102/files/1cde585a..a646c135

Webrevs:
 - full: https://webrevs.openjdk.java.net/valhalla/102/webrev.01
 - incr: https://webrevs.openjdk.java.net/valhalla/102/webrev.00-01

  Stats: 635 lines in 18 files changed: 599 ins; 10 del; 26 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/102.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/102/head:pull/102

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


More information about the valhalla-dev mailing list