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

Unified Diff: src/compiler/node-properties.cc

Issue 1172773003: [turbofan] Deprecate NodeProperties::ReplaceWithValue. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « src/compiler/node-properties.h ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-properties.cc
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc
index 0aeea93161e1aa814b56edb95dc6257bd023ba1a..eb216781d18fae37fd765194873cb4677e11c456 100644
--- a/src/compiler/node-properties.cc
+++ b/src/compiler/node-properties.cc
@@ -169,26 +169,25 @@ void NodeProperties::MergeControlToEnd(Graph* graph,
// static
-void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect,
- Node* control) {
- if (!effect && node->op()->EffectInputCount() > 0) {
- effect = NodeProperties::GetEffectInput(node);
- }
- if (control == nullptr && node->op()->ControlInputCount() > 0) {
- control = NodeProperties::GetControlInput(node);
- }
-
+void NodeProperties::ReplaceUses(Node* node, Node* value, Node* effect,
+ Node* success, Node* exception) {
// Requires distinguishing between value, effect and control edges.
for (Edge edge : node->use_edges()) {
if (IsControlEdge(edge)) {
- DCHECK_EQ(IrOpcode::kIfSuccess, edge.from()->opcode());
- DCHECK_NOT_NULL(control);
- edge.from()->ReplaceUses(control);
- edge.UpdateTo(NULL);
+ if (edge.from()->opcode() == IrOpcode::kIfSuccess) {
+ DCHECK_NOT_NULL(success);
+ edge.UpdateTo(success);
+ } else if (edge.from()->opcode() == IrOpcode::kIfException) {
+ DCHECK_NOT_NULL(exception);
+ edge.UpdateTo(exception);
+ } else {
+ UNREACHABLE();
+ }
} else if (IsEffectEdge(edge)) {
DCHECK_NOT_NULL(effect);
edge.UpdateTo(effect);
} else {
+ DCHECK_NOT_NULL(value);
edge.UpdateTo(value);
}
}
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698