RFR: 8339112: Move JVM Klass flags out of AccessFlags [v2]

Coleen Phillimore coleenp at openjdk.org
Fri Aug 30 20:26:52 UTC 2024


On Fri, 30 Aug 2024 14:11:08 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/jvmci/vmStructs_jvmci.cpp line 274:
>> 
>>> 272:   nonstatic_field(Klass,                       _bitmap,                                       uintx)                                 \
>>> 273:   nonstatic_field(Klass,                       _hash_slot,                                    uint8_t)                               \
>>> 274:   nonstatic_field(Klass,                       _misc_flags._flags,                            u1)                                    \
>> 
>> Can we export `_misc_flags` instead, similar to `_access_flags`?
>> 
>> diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
>> index 9d65268f0fe..6170647186c 100644
>> --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
>> +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
>> @@ -268,10 +268,10 @@
>>    nonstatic_field(Klass,                       _java_mirror,                                  OopHandle)                             \
>>    nonstatic_field(Klass,                       _modifier_flags,                               jint)                                  \
>>    nonstatic_field(Klass,                       _access_flags,                                 AccessFlags)                           \
>> +  nonstatic_field(Klass,                       _misc_flags,                                   KlassFlags)                            \
>>    nonstatic_field(Klass,                       _class_loader_data,                            ClassLoaderData*)                      \
>>    nonstatic_field(Klass,                       _bitmap,                                       uintx)                                 \
>>    nonstatic_field(Klass,                       _hash_slot,                                    uint8_t)                               \
>> -  nonstatic_field(Klass,                       _misc_flags._flags,                            u1)                                    \
>>                                                                                                                                       \
>>    nonstatic_field(LocalVariableTableElement,   start_bci,                                     u2)                                    \
>>    nonstatic_field(LocalVariableTableElement,   length,                                        u2)                                    \
>> diff --git a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/...
>
> I don't think the JVMCI knows about the type KlassFlags - I used the same code that I used for InstanceKlass::_misc_flags._flags  (see above this).

I made the change to refactor the getMiscFlags function, but if you want to add knowledge of the KlassFlags class (and InstanceKlassFlags also), you could do that separately from this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1739381799


More information about the serviceability-dev mailing list