On Thu, 2 Jul 2026 09:20:52 GMT, Christian Hagedorn <[email protected]> 
wrote:

> The provided test fails with an assertion in `Parse::array_store()` due to 
> checking an old outdated type and the assert being off.
> 
> We improve the array type in `inline_array_null_guard()` here because we are 
> storing `null`:
> https://github.com/openjdk/valhalla/blob/6adeca933a1361c6f44f51c9c266bd1a20a42380/src/hotspot/share/opto/graphKit.cpp#L4041-L4045
> 
> We return the casted array but do not update `array_type` in the caller (i.e. 
> in `Parse::array_store()`). We then continue and hit this assert which also 
> seems wrong:
> https://github.com/openjdk/valhalla/blob/6adeca933a1361c6f44f51c9c266bd1a20a42380/src/hotspot/share/opto/parse2.cpp#L263
> 
> What we actually want to check is that we either have a known non-flat array, 
> in which case the `BoolNode` for the just emitted `flat_array_test()` folded 
> to a constant, which we can also check over the current array type, or that 
> we find a proper flat array check with a `FlatArrayCheckNode`.
> 
> I also squeezed in three unrelated comment updates in `graphKit.cpp` and 
> `type.cpp` provided by @marc-chevalier since it's not worth to file an extra 
> issue just for that.
> 
> Thanks,
> Christian
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Looks good to me!

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

Marked as reviewed by thartmann (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2614#pullrequestreview-4616546756

Reply via email to