On Thu, 12 Feb 2026 13:13:23 GMT, Axel Boldt-Christmas <[email protected]> 
wrote:

>> 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/f860c81b...bd5f33d0
>
> src/hotspot/share/oops/objArrayKlass.cpp line 421:
> 
>> 419:     assert(is_refArray_klass() || is_flatArray_klass(), "Must be a 
>> concrete array klass");
>> 420:     return this;
>> 421:   }
> 
> If a understand this patch correctly, we now allow having both RefArrays and 
> FlatArrays with the same properties. (We really only care about DEFAULT, but 
> never the less).
> 
> Why is this exit condition correct, and not something like:
> ```c++
>   if (properties() == props &&
>       ((ad._layout_kind == LayoutKind::REFERENCE && is_refArray_klass()) ||
>        (ad._layout_kind != LayoutKind::REFERENCE && is_flatArray_klass()))) {
>     return this;
>   }

Right. The exit condition was missing the test that the array klass was of the 
expected kind.
The exit condition has been updated, comparing directly the KlassKind of the 
current arrayKlass against the _kind field of the ArrayDescription.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2033#discussion_r2800876541

Reply via email to