RFR: JDK-8316991: Reduce nullable allocation merges [v9]

Cesar Soares Lucas cslucas at openjdk.org
Thu Mar 28 20:03:34 UTC 2024


On Wed, 27 Mar 2024 17:55:26 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> src/hotspot/share/opto/escape.cpp line 472:
>> 
>>> 470: 
>>> 471:       // Don't handle arrays.
>>> 472:       if (alloc->Opcode() != Op_Allocate) {
>> 
>> Turn it into `alloc->Opcode() == Op_AllocateArray` or put `assert(alloc->Opcode() == Op_AllocateArray, "")` inside the branch.
>
> I suggest to add assert inside branch to catch the case when we add an other Allocate subclass.
> 
> Also `ptn->ideal_node()->is_Allocate()` check at the line 468 is not needed because `as_Allocate()` has such assert check.

Thanks. Fixed. Going up in next push.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15825#discussion_r1543572052


More information about the hotspot-dev mailing list