RFR: 8345678: compute_modifiers should not be in create_mirror

David Holmes dholmes at openjdk.org
Tue Dec 10 09:11:41 UTC 2024


On Mon, 9 Dec 2024 13:02:48 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/oops/typeArrayKlass.hpp line 76:
>> 
>>> 74:   void  copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
>>> 75: 
>>> 76:   // jvm support
>> 
>> "jvm support" for what? I'm not even sure why we need `compute_modifier_flags` for array types when they have a fixed value. Can't we just hardwire them and only call `compute_modifier_flags` for instanceKlasses?
>
> ObjArrayKlass computes the modifier flags based on the bottom_klass, and there is a place that calls compute_modifier_flags in an assert that requires the virtual function, albeit for an assert, otherwise I would have made it not a virtual function.

Okay I see now - the access modifier part of the modifiers for a reference array comes from the element type.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22618#discussion_r1877650366


More information about the hotspot-dev mailing list