Index: src/compiler/control-reducer.cc |
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc |
index e738ccf24e82f874447cb4584a78b8c488e71a57..236ce4b77ef725306f308c3b96771e5041db07a3 100644 |
--- a/src/compiler/control-reducer.cc |
+++ b/src/compiler/control-reducer.cc |
@@ -107,7 +107,7 @@ class ControlReducerImpl { |
// We use a stack of (Node, UseIter) pairs to avoid O(n^2) traversal. |
typedef std::pair<Node*, UseIter> FwIter; |
- ZoneVector<FwIter> fw_stack(zone_); |
+ ZoneDeque<FwIter> fw_stack(zone_); |
fw_stack.push_back(FwIter(start, start->uses().begin())); |
while (!fw_stack.empty()) { |
@@ -123,11 +123,8 @@ class ControlReducerImpl { |
marked.SetReachableFromEnd(added); |
AddBackwardsReachableNodes(marked, nodes, nodes.size() - 1); |
- // Reset the use iterators for the entire stack. |
- for (size_t i = 0; i < fw_stack.size(); i++) { |
- FwIter& iter = fw_stack[i]; |
- fw_stack[i] = FwIter(iter.first, iter.first->uses().begin()); |
- } |
+ // The use list of {succ} might have changed. |
+ fw_stack[fw_stack.size() - 1] = FwIter(succ, succ->uses().begin()); |
pop = false; // restart traversing successors of this node. |
break; |
} |