[lworld] RFR: 8378000: [lworld] Move ArrayProperties to its own class [v5]
Joel Sikström
jsikstro at openjdk.org
Wed Feb 25 19:04:33 UTC 2026
On Wed, 25 Feb 2026 16:14:01 GMT, Frederic Parain <fparain at openjdk.org> wrote:
>> src/hotspot/share/oops/objArrayKlass.cpp line 425:
>>
>>> 423: if (next_refined_array_klass() == nullptr) {
>>> 424: ObjArrayKlass* first = this;
>>> 425: if (!is_refArray_klass() && !is_flatArray_klass() && (props.is_null_restricted() || props.is_non_atomic())) {
>>
>> The check for this was `props != ArrayKlass::ArrayProperties::DEFAULT` before this, which included the INVALID state. I ran this through tier1-2 with the assert `assert(!props.is_invalid(), "surely");`, which did not hit.
>>
>> I'd appreciate feedback on if we still want to check for the invalid property here!
>
> This method should never be called with an INVALID property set.
> Only the `ObjArrayklass` instance representing the Java type is allowed to have an INVALID property set (in fact it must because it is an unrefined array type).
> The method `ObjArrayKlass::klass_from_description()` is used to find or create a refined array type, and refined array types must have a valid array property set.
> I'd suggest to add the assert you mentioned to ensure no INVALID props argument is passed.
> I'd also suggest to keep the test like this:
> ` if (!is_refArray_klass() && !is_flatArray_klass() && (props != ArrayProperties::Default())) {`
> because it would still be correct after the introduction of new properties for final arrays and volatile arrays.
I agree with you. I reverted to the original check and added the assert.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2114#discussion_r2854827476
More information about the valhalla-dev
mailing list