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

Mandy Chung mchung at openjdk.java.net
Fri May 22 16:48:48 UTC 2020


On Fri, 22 May 2020 13:12:36 GMT, Roger Riggs <rriggs 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.

`Class::descriptorString` should be used for the cases when it has a `Class` object.

`ProxyGenerator` and `AccessorGenerator` should be updated to use `Class::descriptorString` and `TypeDescriptor` API
where it's appropriate.  I suggest to update these classes in jdk/jdk.  I will file a JBS issue to track this.

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

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



More information about the valhalla-dev mailing list