RFR: 8254269: simplify Node::disconnect_inputs

Claes Redestad redestad at openjdk.java.net
Sat Oct 10 15:18:09 UTC 2020


On Sat, 10 Oct 2020 14:53:23 GMT, Xin Liu <xliu at openjdk.org> wrote:

> 8254269: simplify Node::disconnect_inputs

Nice cleanup! A few suggestions inline, but looks good as-is, too.

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

> 899:
> 900:   for( uint i = 0; i < cnt; ++i ) {
> 901:     if( in(i) == nullptr ) continue;

Perhaps a matter of preference, but this could now be simplified to:
if (in(i) != nullptr) {
  set_req(i, nullptr);
}

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

> 907:     uint max = len();
> 908:     for( uint i = 0; i < max; ++i ) {
> 909:       if( in(i) == nullptr ) continue;

Same here

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

Marked as reviewed by redestad (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/589


More information about the hotspot-compiler-dev mailing list