RFR: 8373343: C2: verify AddP base input only set for heap addresses
Roland Westrelin
roland at openjdk.org
Mon Dec 15 14:03:25 UTC 2025
On Fri, 12 Dec 2025 23:37:58 GMT, Dean Long <dlong at openjdk.org> wrote:
>> The base input of `AddP` is expected to only be set for heap accesses
>> but I noticed some inconsistencies so I added an assert in the `AddP`
>> constructor and fixed issues that it caught. AFAFICT, the
>> inconsistencies shouldn't create issues.
>
> src/hotspot/share/opto/macro.cpp line 1211:
>
>> 1209:
>> 1210: Node* PhaseMacroExpand::make_store(Node* ctl, Node* mem, Node* base, int offset, Node* value, BasicType bt) {
>> 1211: Node* adr = basic_plus_adr(top(), base, offset);
>
> Doesn't this cause an assert if make_load or make_store is used with a heap oop? Isn't that a problem for code like PhaseMacroExpand::initialize_object() that calls make_store() with an object?
`make_load`/`make_store` happen to be only called for non oop accesses. I could rename then to `make_raw_load`/`make_raw_store` to avoid any confusion. What do you think?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28769#discussion_r2619561157
More information about the hotspot-compiler-dev
mailing list