[lworld] RFR: 8245584: [lworld] LW3 core reflection update
Mandy Chung
mchung at openjdk.java.net
Fri May 22 20:10:29 UTC 2020
On Fri, 22 May 2020 19:24:16 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/oops/instanceKlass.cpp line 2775:
>
>> 2774: int dest_index = 0;
>> 2775: dest[dest_index++] = is_value() ? 'Q' : 'L';
>> 2776:
>
> Should use `JVM_SIGNATURE_CLASS` and `JVM_SIGNATURE_VALUETYPE` instead of hard-coded characters.
OK. Will change this before I integrate.
diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
index c9b05990f41..b34421d7ccf 100644
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -2772,7 +2772,7 @@ const char* InstanceKlass::signature_name() const {
// Add L or Q as type indicator
int dest_index = 0;
- dest[dest_index++] = is_value() ? 'Q' : 'L';
+ dest[dest_index++] = is_value() ? JVM_SIGNATURE_VALUETYPE : JVM_SIGNATURE_CLASS;
// Add the actual class name
for (int src_index = 0; src_index < src_length; ) {
-------------
PR: https://git.openjdk.java.net/valhalla/pull/53
More information about the valhalla-dev
mailing list