RFR: 8254269: simplify Node::disconnect_inputs [v2]

Xin Liu xliu at openjdk.java.net
Mon Oct 12 16:54:13 UTC 2020


On Mon, 12 Oct 2020 00:52:04 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> src/hotspot/share/opto/node.cpp line 916:
>> 
>>> 914:   for (; i < len() && in(i) != nullptr; ++i) {
>>> 915:     set_prec(i, nullptr);
>>> 916:   }
>> 
>> Something like next:
>>    for (uint i = req(); i < len(); ++i) {
>>      if (in(i) != nullptr) {
>>        set_prec(i, nullptr);
>>      }
>>    }
>
> This is trickier than I thought. `set_prec(i, nullptr)` will refill _in[i] with the last non-null value, or NULL.
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/node.cpp#L1030
> 
> It means iteration from req() to len() skip a node if there are more than one non-null precedences.

I will fix it in this issue.
https://bugs.openjdk.java.net/browse/JDK-8254369

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

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


More information about the hotspot-compiler-dev mailing list