RFR: 8373343: C2: verify AddP base input only set for heap addresses [v2]

Dean Long dlong at openjdk.org
Fri Dec 19 23:44:56 UTC 2025


On Fri, 19 Dec 2025 13:16:21 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/memnode.cpp line 2570:
>> 
>>> 2568:             assert(tkls2->offset() == 0, "not a load of java_mirror");
>>> 2569: #endif
>>> 2570:             return adr2->in(AddPNode::Address);
>> 
>> What should the value of adr2->in(AddPNode::Offset) be at this point? 0 or java_mirror_offset()?  Do we need to check it?
>
> I added a couple asserts here.

If adr2->in(AddPNode::Address) is also an AddP, it's actually adr2->in(AddPNode::Address)->in(AddPNode::Offset) I'm concerned about, but maybe checking it with something like Ideal_base_and_offset() is probably overkill given the TypeKlassPtr::offset() should be derived from that info.  In other words, the offset from the type should combine any non-zero offsets from Address and Offset edges.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28769#discussion_r2636591633


More information about the hotspot-dev mailing list