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

Mandy Chung mchung at openjdk.java.net
Fri May 22 20:12:56 UTC 2020


On Fri, 22 May 2020 19:39:36 GMT, Frederic Parain <fparain 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/hotspot/share/classfile/javaClasses.cpp line 1023:
> 
>> 1022:         set_ref_type_mirror(ref_type_oop, ref_type_oop);
>> 1023:       }
>> 1024:     }
> 
> With this code, if the super type of the inline type is `j.l.Object`, `Class:refType` will remain `null`. I'm not sure
> that the VM code is ready to handle this situation. The only use case I've found is in
> `LibraryCallKit::inline_value_Class_conversion(vmIntrinsics::ID id)` and I'm not familiar with it (the compiler team
> might want to take a look at it).

The current compiler implementation is left from LW2.  It needs update for the new language model and I suspect it does
not depend on the ref type.

Are you okay if I integrate this change now and follow up with the compiler team separately?

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

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


More information about the valhalla-dev mailing list