RFR: 8345678: compute_modifiers should not be in create_mirror [v2]
David Holmes
dholmes at openjdk.org
Wed Dec 11 02:52:48 UTC 2024
On Tue, 10 Dec 2024 21:53:24 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/oops/arrayKlass.hpp line 123:
>>
>>> 121:
>>> 122: // jvm support
>>> 123: jint compute_modifier_flags() const;
>>
>> I would have expected this to be defined as a virtual function here and then overridden as needed by the various subclasses.
>
> I moved the TypeArrayKlass modifiers to apply to TypeArrayKlass, so they're not accidentally used for ObjArrayKlass, or any other new ArrayKlass that should have different modifiers. I made the virtual function be defined for the most specific class.
To be clear I would expect arrayKlass to define a pure virtual function for this, and then each subclass overrides as required. Otherwise you can't generally operate on an arrayKlass but must always know what subtype you are dealing with.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22618#discussion_r1879248142
More information about the serviceability-dev
mailing list