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

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

Issue 851263002: [turbofan] Initial attempt to cleanup Node and related classes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/control-reducer.cc ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer.cc
diff --git a/src/compiler/graph-reducer.cc b/src/compiler/graph-reducer.cc
index 9a6b121ffbd224d2fe0e8bfed002fcf4ce312039..91049a4eb02e0d1587ea7b5ba6cfac640efb38d5 100644
--- a/src/compiler/graph-reducer.cc
+++ b/src/compiler/graph-reducer.cc
@@ -154,9 +154,11 @@ void GraphReducer::ReduceTop() {
// Otherwise {node} was replaced by a new node. Replace all old uses of
// {node} with {replacement}. New nodes created by this reduction can
// use {node}.
- node->ReplaceUsesIf(
- [node_count](Node* const node) { return node->id() < node_count; },
- replacement);
+ for (Edge edge : node->use_edges()) {
+ if (edge.from()->id() < node_count) {
+ edge.UpdateTo(replacement);
+ }
+ }
// Unlink {node} if it's no longer used.
if (node->uses().empty()) {
node->Kill();
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698