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

Side by Side Diff: src/compiler/branch-elimination.cc

Issue 2585713002: [turbofan] Use Node input iterators where possible (Closed)
Patch Set: Use == instead of DCHECK_EQ because of missing operator<< for iterators Created 3 years, 12 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/escape-analysis-reducer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/branch-elimination.h" 5 #include "src/compiler/branch-elimination.h"
6 6
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 #include "src/compiler/simplified-operator.h" 9 #include "src/compiler/simplified-operator.h"
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Here we rely on having only reducible loops: 136 // Here we rely on having only reducible loops:
137 // The loop entry edge always dominates the header, so we can just use 137 // The loop entry edge always dominates the header, so we can just use
138 // the information from the loop entry edge. 138 // the information from the loop entry edge.
139 return TakeConditionsFromFirstControl(node); 139 return TakeConditionsFromFirstControl(node);
140 } 140 }
141 141
142 142
143 Reduction BranchElimination::ReduceMerge(Node* node) { 143 Reduction BranchElimination::ReduceMerge(Node* node) {
144 // Shortcut for the case when we do not know anything about some 144 // Shortcut for the case when we do not know anything about some
145 // input. 145 // input.
146 for (int i = 0; i < node->InputCount(); i++) { 146 for (Node* input : node->inputs()) {
147 if (node_conditions_.Get(node->InputAt(i)) == nullptr) { 147 if (node_conditions_.Get(input) == nullptr) {
148 return UpdateConditions(node, nullptr); 148 return UpdateConditions(node, nullptr);
149 } 149 }
150 } 150 }
151 151
152 const ControlPathConditions* first = node_conditions_.Get(node->InputAt(0)); 152 const ControlPathConditions* first = node_conditions_.Get(node->InputAt(0));
153 // Make a copy of the first input's conditions and merge with the conditions 153 // Make a copy of the first input's conditions and merge with the conditions
154 // from other inputs. 154 // from other inputs.
155 ControlPathConditions* conditions = 155 ControlPathConditions* conditions =
156 new (zone_->New(sizeof(ControlPathConditions))) 156 new (zone_->New(sizeof(ControlPathConditions)))
157 ControlPathConditions(*first); 157 ControlPathConditions(*first);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 Graph* BranchElimination::graph() const { return jsgraph()->graph(); } 305 Graph* BranchElimination::graph() const { return jsgraph()->graph(); }
306 306
307 CommonOperatorBuilder* BranchElimination::common() const { 307 CommonOperatorBuilder* BranchElimination::common() const {
308 return jsgraph()->common(); 308 return jsgraph()->common();
309 } 309 }
310 310
311 } // namespace compiler 311 } // namespace compiler
312 } // namespace internal 312 } // namespace internal
313 } // namespace v8 313 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/escape-analysis-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698