diff options
Diffstat (limited to 'deps/v8/src/compiler/graph-reducer.cc')
-rw-r--r-- | deps/v8/src/compiler/graph-reducer.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/deps/v8/src/compiler/graph-reducer.cc b/deps/v8/src/compiler/graph-reducer.cc index 91b4b51c91b..d9bc9d6c22b 100644 --- a/deps/v8/src/compiler/graph-reducer.cc +++ b/deps/v8/src/compiler/graph-reducer.cc @@ -161,6 +161,11 @@ void GraphReducer::ReduceTop() { // Check if the reduction is an in-place update of the {node}. Node* const replacement = reduction.replacement(); if (replacement == node) { + for (Node* const user : node->uses()) { + DCHECK_IMPLIES(user == node, state_.Get(node) != State::kVisited); + Revisit(user); + } + // In-place update of {node}, may need to recurse on an input. Node::Inputs node_inputs = node->inputs(); for (int i = 0; i < node_inputs.count(); ++i) { @@ -178,12 +183,6 @@ void GraphReducer::ReduceTop() { // Check if we have a new replacement. if (replacement != node) { Replace(node, replacement, max_id); - } else { - // Revisit all uses of the node. - for (Node* const user : node->uses()) { - // Don't revisit this node if it refers to itself. - if (user != node) Revisit(user); - } } } |