[lworld] RFR: 8245584: [lworld] LW3 core reflection update

Roger Riggs rriggs at openjdk.java.net
Fri May 22 13:16:16 UTC 2020

On Thu, 21 May 2020 22:09:50 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> This patch updates the core reflection for the new language model for inline classes.
> - `Class::isInlineClass` returns true for inline classes
> - `Class::valueType` returns the value projection of an inline class
> - `Class::referenceType` returns the reference projection if it's an inline class,
>     or this class if it's not an inline class
> If this class has no val type or ref type, `Class::valueType` and `Class::referenceType`
> return an empty `Optional`.   We can re-examine  if we should modernize Class API shape
> where  we can rather than holding to the tradition.
> I updated TestIntrinsics.java to use the new APIs for now to keep it compiled.
> This test will be updated when the intrinsification of the old API `Class::asPrimaryType`
> and `Class:asIndirectType` is removed.

src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java line 674:

> 673:             } else {
> 674:                 stringBuilder.append('L');
> 675:             }

This could be:
`stringBuilder.append(IsInlineClass(currentClass) ? 'Q' : 'L');`

There may be a usefor a utility function that  returns Q or L as appropriate, it appears a few time.


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

More information about the valhalla-dev mailing list