> 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).
Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision: Update summary ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/2614/files - new: https://git.openjdk.org/valhalla/pull/2614/files/2e385166..183ae08f Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2614&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2614&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/2614.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2614/head:pull/2614 PR: https://git.openjdk.org/valhalla/pull/2614
