[lworld] RFR: 8375306: [lworld] Investigate alternatives to flatArrayOopDresc::obj_at implementation
Stefan Karlsson
stefank at openjdk.org
Fri Feb 6 12:27:16 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().
Just to be clear, this PR is just a sub-set of all usages of obj_at and obj_at_put that needs to be fixed?
While looking through the patch I saw two things that I'd want to see if we can clean up:
1) You always pass down `ArrayKlass::ArrayProperties::DEFAULT` to `new_refArray`, so that can be confined to that function:
https://github.com/stefank/valhalla/commit/6770b92d77cd3e9a5e04e9abc2e33eb3f4005206
2) You've introduced a `force_refarray` parameter and passes in `false` in a lot of places without being explicit about what the argument signifies. This makes the call-sites harder to read, so I first wanted to suggest that you change this to `false /* force_refarray */`. However, then I figured that it really would be nice if we could completely get rid of that parameter instead. This is what I came up with:
https://github.com/stefank/valhalla/commit/68a5601904b27c59e3e62d4b1971b6a80c3b888b
Could you take a look and see if that makes sense?
The branch for this is here:
https://github.com/stefank/valhalla/tree/refarray_factory_stefank
and diff against lworld:
https://github.com/openjdk/valhalla/compare/lworld...stefank:valhalla:refarray_factory_stefank
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/2033#issuecomment-3860139337
More information about the valhalla-dev
mailing list