On Wed, 14 Jan 2026 23:38:13 GMT, Quan Anh Mai <[email protected]> wrote:

> Hi,
> 
> The issue is that `PhaseMacroExpand::value_from_mem_phi` does not take into 
> consideration flat arrays, so it incorrectly returns the whole object for a 
> load from one of its fields. This results in a byte `Phi` with an input being 
> an `oop`, triggering the assert during `LRG::set_num_regs` because the size 
> of a `Phi` and its input are different.
> 
> Please take a look and leave your reviews, thanks a lot.

Nice, thanks for fixing this!

src/hotspot/share/opto/macro.cpp line 489:

> 487:   // Cannot look through init_value if it is an oop
> 488:   if (!init_value->is_InlineType()) {
> 489:     return nullptr;

I think I asked this before in another PR but I forgot in which context: 
Shouldn't `init_value` always be an `InlineTypeNode`? I think you then pointed 
by to my `TODO 8350865 [...]` comment in `LibraryCallKit::inline_newArray`. 
Once we fixed that, this check could go away. I think we have a few more such 
checks. Could you adapt the TODO in `LibraryCallKit::inline_newArray` with a 
reminder to update all those?

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

Marked as reviewed by thartmann (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/1909#pullrequestreview-3664117101
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1909#discussion_r2693143839

Reply via email to