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

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

Issue 1366753003: [turbofan] Make Node::set_op safer via wrapper. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Expand to other reducers. Created 5 years, 3 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
Index: src/compiler/control-flow-optimizer.cc
diff --git a/src/compiler/control-flow-optimizer.cc b/src/compiler/control-flow-optimizer.cc
index 25e183e1f65b1d66ad4abd630bcec7e2fcbc6159..f3b92638622065b7407d4a9b0f7d46758a9f471e 100644
--- a/src/compiler/control-flow-optimizer.cc
+++ b/src/compiler/control-flow-optimizer.cc
@@ -245,7 +245,7 @@ bool ControlFlowOptimizer::TryBuildSwitch(Node* node) {
branch->NullAllInputs();
if_true->ReplaceInput(0, node);
}
- if_true->set_op(common()->IfValue(value));
+ NodeProperties::ChangeOp(if_true, common()->IfValue(value));
if_false->NullAllInputs();
Enqueue(if_true);
@@ -261,12 +261,12 @@ bool ControlFlowOptimizer::TryBuildSwitch(Node* node) {
return false;
}
DCHECK_LT(1u, values.size());
- node->set_op(common()->Switch(values.size() + 1));
+ NodeProperties::ChangeOp(node, common()->Switch(values.size() + 1));
Jarin 2015/09/24 14:00:41 I am wondering whether ChangeOp should not be the
Michael Starzinger 2015/09/24 14:21:28 Done.
node->ReplaceInput(0, index);
- if_true->set_op(common()->IfValue(value));
+ NodeProperties::ChangeOp(if_true, common()->IfValue(value));
if_true->ReplaceInput(0, node);
Enqueue(if_true);
- if_false->set_op(common()->IfDefault());
+ NodeProperties::ChangeOp(if_false, common()->IfDefault());
if_false->ReplaceInput(0, node);
Enqueue(if_false);
branch->NullAllInputs();

Powered by Google App Engine
This is Rietveld 408576698