[lworld] Integrated: 8375306: [lworld] Investigate alternatives to flatArrayOopDesc::obj_at implementation
Frederic Parain
fparain at openjdk.org
Wed Feb 18 12:41:55 UTC 2026
On Wed, 4 Feb 2026 14:41:09 GMT, Frederic Parain <fparain at openjdk.org> 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.
This pull request has now been integrated.
Changeset: 5d5a5940
Author: Frederic Parain <fparain at openjdk.org>
URL: https://git.openjdk.org/valhalla/commit/5d5a5940de7a7c019153057d736fc5a6d872bb6f
Stats: 379 lines in 55 files changed: 148 ins; 41 del; 190 mod
8375306: [lworld] Investigate alternatives to flatArrayOopDesc::obj_at implementation
Co-authored-by: Stefan Karlsson <stefank at openjdk.org>
Reviewed-by: coleenp, stefank, iwalulya
-------------
PR: https://git.openjdk.org/valhalla/pull/2033
More information about the valhalla-dev
mailing list