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

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

Issue 541643002: [turbofan] Properly delete nodes in the GraphReducer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Kill Created 6 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
« no previous file with comments | « src/compiler/compiler.gyp ('k') | src/compiler/graph-reducer-unittest.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 794348a935f769fa7432971c322264905967f2fc..36a54e0491c5436cf3ad51405bf469c019b86a6d 100644
--- a/src/compiler/graph-reducer.cc
+++ b/src/compiler/graph-reducer.cc
@@ -49,8 +49,8 @@ void GraphReducer::ReduceNode(Node* node) {
// If {node} was replaced by an old node, unlink {node} and assume that
// {replacement} was already reduced and finish.
if (replacement->id() < before) {
- node->RemoveAllInputs();
node->ReplaceUses(replacement);
+ node->Kill();
return;
}
// Otherwise, {node} was replaced by a new node. Replace all old uses of
@@ -59,7 +59,9 @@ void GraphReducer::ReduceNode(Node* node) {
node->ReplaceUsesIf(
std::bind2nd(std::ptr_fun(&NodeIdIsLessThan), before), replacement);
// Unlink {node} if it's no longer used.
- if (node->uses().empty()) node->RemoveAllInputs();
+ if (node->uses().empty()) {
+ node->Kill();
+ }
// Rerun all the reductions on the {replacement}.
skip = reducers_.end();
node = replacement;
@@ -90,6 +92,7 @@ void GraphReducer::ReduceGraph() {
// TODO(titzer): partial graph reductions.
-}
-}
-} // namespace v8::internal::compiler
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/compiler/compiler.gyp ('k') | src/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698