On Fri, 13 Mar 2026 11:35:18 GMT, Stefan Karlsson <[email protected]> wrote:
>> src/hotspot/share/oops/flatArrayOop.inline.hpp line 123:
>>
>>> 121: faklass->oop_oop_iterate_elements_range<narrowOop>(this, blk,
>>> start, end);
>>> 122: } else {
>>> 123: faklass->oop_oop_iterate_elements_range<oop>(this, blk, start,
>>> end);
>>
>> Potential follow-up:
>>
>> Would be nice to add covariant return types for `klass()` in our oopDesc
>> hierarchy. So we would have `flatArrayKlass* flatArrayOopDesc::klass()
>> const` here and could just write
>> `klass()->oop_oop_iterate_elements_range<...>(...)`
>
> WDYT:
> https://github.com/openjdk/valhalla/compare/lworld...stefank:valhalla:lworld_typed_klass
>
> I can open a PR if this seems OK.
Looks good to me.
_I'd like to eventually add this to the whole oopDesc hierarchy. But we should
do that in mainline._
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2207#discussion_r2930664478