[lworld] RFR: 8378000: [lworld] Move ArrayProperties to its own class [v2]

Paul Hübner phubner at openjdk.org
Mon Feb 16 16:29:49 UTC 2026


On Mon, 16 Feb 2026 16:24:23 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> src/hotspot/share/c1/c1_Runtime1.cpp line 1211:
>> 
>>> 1209:           k = ek->array_klass(CHECK);
>>> 1210:           if (!k->is_typeArray_klass() && !k->is_refArray_klass() && !k->is_flatArray_klass()) {
>>> 1211:             k = ObjArrayKlass::cast(k)->klass_with_properties(ArrayProperties(), THREAD);
>> 
>> Summarizing the discussion we had offline: I like this refactor overall and I think it makes the code much easier to understand, but `ArrayProperties()` meaning `DEFAULT` is less maintainable than before in my opinion. It looks like there are no properties.
>> 
>> I suggest making a private constructor and a static `from_default` or  `infer` or `infer_default`. We had a discussion previously on the name `DEFAULT` name not being ideal/slightly misleading. Perhaps it is time to address it?
>
> FTR, your proposal would look something like this (maybe with another name):
> https://github.com/openjdk/valhalla/commit/64a2230025118e68cee0aca742c261597c78e2dd
> 
> What do you and others think?

I think that's already much better regardless of the name we land on in the end. I'd still vote for `infer` or personally.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/2114#discussion_r2813225521


More information about the valhalla-dev mailing list