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

Side by Side Diff: src/compiler/graph-reducer.cc

Issue 701473002: Make generic algorithm less generic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Jaro. Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/generic-algorithm.h ('k') | src/compiler/graph-replay.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/graph-reducer.h" 5 #include "src/compiler/graph-reducer.h"
6 6
7 #include <functional> 7 #include <functional>
8 8
9 #include "src/compiler/graph-inl.h" 9 #include "src/compiler/graph-inl.h"
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 break; 65 break;
66 } 66 }
67 } 67 }
68 } 68 }
69 } 69 }
70 70
71 71
72 // A helper class to reuse the node traversal algorithm. 72 // A helper class to reuse the node traversal algorithm.
73 struct GraphReducerVisitor FINAL : public NullNodeVisitor { 73 struct GraphReducerVisitor FINAL : public NullNodeVisitor {
74 explicit GraphReducerVisitor(GraphReducer* reducer) : reducer_(reducer) {} 74 explicit GraphReducerVisitor(GraphReducer* reducer) : reducer_(reducer) {}
75 GenericGraphVisit::Control Post(Node* node) { 75 void Post(Node* node) { reducer_->ReduceNode(node); }
76 reducer_->ReduceNode(node);
77 return GenericGraphVisit::CONTINUE;
78 }
79 GraphReducer* reducer_; 76 GraphReducer* reducer_;
80 }; 77 };
81 78
82 79
83 void GraphReducer::ReduceGraph() { 80 void GraphReducer::ReduceGraph() {
84 GraphReducerVisitor visitor(this); 81 GraphReducerVisitor visitor(this);
85 // Perform a post-order reduction of all nodes starting from the end. 82 // Perform a post-order reduction of all nodes starting from the end.
86 graph()->VisitNodeInputsFromEnd(&visitor); 83 graph()->VisitNodeInputsFromEnd(&visitor);
87 } 84 }
88 85
89 86
90 // TODO(titzer): partial graph reductions. 87 // TODO(titzer): partial graph reductions.
91 88
92 } // namespace compiler 89 } // namespace compiler
93 } // namespace internal 90 } // namespace internal
94 } // namespace v8 91 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/generic-algorithm.h ('k') | src/compiler/graph-replay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698