RFR: 8350485: C2: factor out common code in Node::grow() and Node::out_grow()

Tobias Hartmann thartmann at openjdk.org
Mon Mar 10 10:58:27 UTC 2025


On Thu, 6 Mar 2025 09:08:41 GMT, Saranya Natarajan <duke at openjdk.org> wrote:

> Node:grow() and Node::out_grow() are copy-pasted from each other and their core logic could be factored out into a third function or at least cleaned up. Hence,the fix includes a function Node::array_resize() that implements the core logic of Node::grow() and Node::out_grow(). 
> 
>  Link to Github action which had no failures :  https://github.com/sarannat/jdk/actions/runs/13677508359

Congratulations on your first PR, Saranya! :partying_face: 

I also left a code style comment but looks good to me otherwise.

src/hotspot/share/opto/node.cpp line 688:

> 686:   // Previously I was using only powers-of-2 which peaked at 128 edges.
> 687:   //if( new_max >= limit ) new_max = limit-1;
> 688:   if(!is_in){

Suggestion:

  if (!is_in) {


Same below.

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

Changes requested by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23928#pullrequestreview-2667389492
PR Review Comment: https://git.openjdk.org/jdk/pull/23928#discussion_r1985138147


More information about the hotspot-compiler-dev mailing list