Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: src/compiler/control-reducer.cc

Issue 789773002: [turbofan] Fix control reducer bug with NTLs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress-ntl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/control-reducer.cc
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc
index 236ce4b77ef725306f308c3b96771e5041db07a3..e738ccf24e82f874447cb4584a78b8c488e71a57 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;
- ZoneDeque<FwIter> fw_stack(zone_);
+ ZoneVector<FwIter> fw_stack(zone_);
fw_stack.push_back(FwIter(start, start->uses().begin()));
while (!fw_stack.empty()) {
@@ -123,8 +123,11 @@ class ControlReducerImpl {
marked.SetReachableFromEnd(added);
AddBackwardsReachableNodes(marked, nodes, nodes.size() - 1);
- // The use list of {succ} might have changed.
- fw_stack[fw_stack.size() - 1] = FwIter(succ, succ->uses().begin());
+ // 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());
+ }
pop = false; // restart traversing successors of this node.
break;
}
« no previous file with comments | « no previous file | test/mjsunit/regress-ntl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698