RFR: 8327963: C2: fix construction of memory graph around Initialize node to prevent incorrect execution if allocation is removed [v8]

Roland Westrelin roland at openjdk.org
Wed Jun 4 07:48:22 UTC 2025


On Tue, 27 May 2025 08:50:51 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/opto/multnode.cpp line 48:
> 
>> 46: ProjNode* MultiNode::proj_out_or_null(uint which_proj) const {
>> 47:   assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
>> 48:   assert(number_of_projs(which_proj) <= 1, "only when there's a single projection");
> 
> Does this hold for all `MultiNode`s under all circumstances? Or should we consider returning `nullptr` in this case?

So you're suggesting that this could return `nullptr` so the caller could then test for `nullptr` and have some fallback logic? I would stick with the assert: if C2 crashes because of this,  I think will be easier to diagnose an assert than an unexpected `nullptr` return.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24570#discussion_r2125914278


More information about the hotspot-compiler-dev mailing list