On Mon, 9 Feb 2026 22:02:37 GMT, Frederic Parain <[email protected]> wrote:

>> First batch of changes to remove potentially dangerous calls to 
>> objArrayOopDesc::obj_at().
>> Changes are more extensive than intended. In most cases, code modifications 
>> consist in using a refArrayOop type instead of a objArrayOop type, because 
>> most of the arrays the JVM deals with for its own purpose are always 
>> reference arrays (because they are arrays of identity type elements). The 
>> patch also adds a new API allowing the VM to request the allocation of a 
>> reference array.
>> Code dealing with user provided arrays must be ready to handle exceptions 
>> when accessing objArrays.
>> 
>> This is a short term fix, fixing a few bugs, and trying to make the code 
>> more robust using the meta-data types. For the long term, a better solution 
>> is needed. Accesses to both arrays and fields are becoming more and more 
>> complex because of the introduction of flattening, multiple layouts, 
>> additional properties. Forcing enforcement at each access would be expensive 
>> and wasteful, as the JVM usually operates on well-known objects or arrays. 
>> But because of the increasing complexity, having a way to quickly check the 
>> validity of an access would help making the VM code more robust.
>
> Frederic Parain has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 12 additional 
> commits since the last revision:
> 
>  - Comments update
>  - Rename new_default_refArray to new_refArray with overload
>  - Fixes issues mentioned in reviews
>  - Remove force_refarray and add array klass creation from ArrayDescription
>  - Fix merge
>  - Merge remote-tracking branch 'upstream/lworld' into refarray_factory
>  - Revert foreign methods signature changes
>  - Foreign API and other fixes
>  - CI fixes
>  - More fixes in serviceability code
>  - ... and 2 more: 
> https://git.openjdk.org/valhalla/compare/4b183ecd...bd5f33d0

This looks really good!

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

Marked as reviewed by coleenp (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2033#pullrequestreview-3781061976

Reply via email to