[lworld] RFR: 8372113: [lworld] Fix various issues with TypeAryPtr and TypeAryKlassPtr [v3]
Quan Anh Mai
qamai at openjdk.org
Thu Dec 4 06:44:24 UTC 2025
On Thu, 4 Dec 2025 06:38:06 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Hi,
>>
>> This PR fixes various issues with `TypeAryPtr` and `TypeAryKlassPtr`. It starts with me trying to tighten the properties (`flat`, `null_free`, etc) of these classes, then fixing all the revealed issues until there are no crashes or wrong results left.
>>
>> Please take a look and leave your reviews, thanks a lot.
>
> Quan Anh Mai has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>
> - whitespace
> - fix more issues
> - Merge branch 'lworld' into AryKlassPtrfactory
> - Fix test failures
> - Tighten the type system around array properties and fix related issues
I have fixed the first and the third issue.
The first one is because while we process a `MergeMemNode`, the IGVN can kill other nodes, including yet-to-process `MergeMemNode`s, just skipping dead nodes, then.
The third one is kind of interesting. When creating a refined `ObjArrayKlass`, we fall back to ref array if the corresponding flat layout is not present, which means that if the element type is not a `LooselyConsistentValue`, `ValueClass::newNullRestrictedNonAtomicArray` will make a ref array. This seems counter-intuitive, it should have fallen back to a null-restricted atomic array instead. This kind of falling back also makes reasoning about arrays easier, as we will have fewer states to think about. It also makes the logic more intuitive, because it raised my eyebrows when `ciObjArrayKlass::make` creates a ref (and obviously atomic) array when asked for a non-atomic array, but a flat (and also atomic) array when asked for an atomic array. As a result, I think it is reasonable to adapt `ValueClass::newNullRestrictedNonAtomicArray` to return a null-restricted atomic array when the non-atomic layout is not present.
Unfortunately, I have not been able to reproduce or had any clue about the second issue :(
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1755#issuecomment-3610546439
More information about the valhalla-dev
mailing list