[lworld] RFR: 8375306: [lworld] Investigate alternatives to flatArrayOopDesc::obj_at implementation [v4]

Frederic Parain fparain at openjdk.org
Tue Feb 17 20:00:21 UTC 2026


On Mon, 16 Feb 2026 13:09:49 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

>> Frederic Parain has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fixes from Stefan's comments
>>  - Fix more use sites and some TRAPS returns
>
> src/hotspot/share/prims/foreignGlobals.inline.hpp line 36:
> 
>> 34: template<typename T>
>> 35: void ForeignGlobals::parse_register_array(objArrayOop jarray, StorageType type_index, GrowableArray<T>& array, T (*converter)(int)) {
>> 36:   refArrayOop refarray = refArrayOopDesc::cast(jarray);
> 
> why not use `oop_cast` as below? And probably remove `flatArrayOopDesc::cast` so we don't introduce new uses of `flatArrayOopDesc::cast`. Eventually get rid of `refArrayOopDesc::cast` (it is already used in so many places).

I've created a different CR to address the cast methods duplication: JDK-8377466

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/2033#discussion_r2818812666


More information about the valhalla-dev mailing list