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

Unified Diff: src/compiler/control-flow-optimizer.cc

Issue 935033004: Introduce and test NodeProperties::CollectControlProjections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/node-properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/control-flow-optimizer.cc
diff --git a/src/compiler/control-flow-optimizer.cc b/src/compiler/control-flow-optimizer.cc
index c75d09f0cef09f3edc8297c13ce3ef451abb98f5..1a2b4cdfd8cb29524be1c29f9aa185da0be102bb 100644
--- a/src/compiler/control-flow-optimizer.cc
+++ b/src/compiler/control-flow-optimizer.cc
@@ -68,19 +68,14 @@ void ControlFlowOptimizer::VisitBranch(Node* node) {
Node* if_false;
Node* if_true;
while (true) {
- // TODO(turbofan): use NodeProperties::CollectSuccessorProjections() here
- // once available.
- auto it = branch->uses().begin();
- DCHECK(it != branch->uses().end());
- if_true = *it++;
- DCHECK(it != branch->uses().end());
- if_false = *it++;
- DCHECK(it == branch->uses().end());
- if (if_true->opcode() != IrOpcode::kIfTrue) std::swap(if_true, if_false);
+ Node* control_projections[2];
+ NodeProperties::CollectControlProjections(branch, control_projections, 2);
+ if_true = control_projections[0];
+ if_false = control_projections[1];
DCHECK_EQ(IrOpcode::kIfTrue, if_true->opcode());
DCHECK_EQ(IrOpcode::kIfFalse, if_false->opcode());
- it = if_false->uses().begin();
+ auto it = if_false->uses().begin();
if (it == if_false->uses().end()) break;
Node* branch1 = *it++;
if (branch1->opcode() != IrOpcode::kBranch) break;
« no previous file with comments | « no previous file | src/compiler/node-properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698