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

Dean Long dlong at openjdk.org
Fri Dec 12 23:40:51 UTC 2025


On Thu, 11 Dec 2025 15:31:55 GMT, Roland Westrelin <roland 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?

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

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


More information about the hotspot-compiler-dev mailing list