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

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

Issue 1188433010: [turbofan] Move graph trimming functionality to dedicated GraphTrimmer. (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 unified diff | Download patch
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/graph-reducer.cc » ('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 #ifndef V8_COMPILER_GRAPH_REDUCER_H_ 5 #ifndef V8_COMPILER_GRAPH_REDUCER_H_
6 #define V8_COMPILER_GRAPH_REDUCER_H_ 6 #define V8_COMPILER_GRAPH_REDUCER_H_
7 7
8 #include "src/compiler/node-marker.h" 8 #include "src/compiler/node-marker.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
(...skipping 29 matching lines...) Expand all
40 // language-specific reductions (e.g. reduction based on types or constant 40 // language-specific reductions (e.g. reduction based on types or constant
41 // folding of low-level operators) can be integrated into the graph reduction 41 // folding of low-level operators) can be integrated into the graph reduction
42 // phase. 42 // phase.
43 class Reducer { 43 class Reducer {
44 public: 44 public:
45 virtual ~Reducer() {} 45 virtual ~Reducer() {}
46 46
47 // Try to reduce a node if possible. 47 // Try to reduce a node if possible.
48 virtual Reduction Reduce(Node* node) = 0; 48 virtual Reduction Reduce(Node* node) = 0;
49 49
50 // Ask this reducer to finish operation, returns {true} if the reducer is
51 // done, while {false} indicates that the graph might need to be reduced
52 // again.
53 // TODO(turbofan): Remove this once the dead node trimming is in the
54 // GraphReducer.
55 virtual bool Finish();
56
57 // Helper functions for subclasses to produce reductions for a node. 50 // Helper functions for subclasses to produce reductions for a node.
58 static Reduction NoChange() { return Reduction(); } 51 static Reduction NoChange() { return Reduction(); }
59 static Reduction Replace(Node* node) { return Reduction(node); } 52 static Reduction Replace(Node* node) { return Reduction(node); }
60 static Reduction Changed(Node* node) { return Reduction(node); } 53 static Reduction Changed(Node* node) { return Reduction(node); }
61 }; 54 };
62 55
63 56
64 // An advanced reducer can also edit the graphs by changing and replacing nodes 57 // An advanced reducer can also edit the graphs by changing and replacing nodes
65 // other than the one currently being reduced. 58 // other than the one currently being reduced.
66 class AdvancedReducer : public Reducer { 59 class AdvancedReducer : public Reducer {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 ZoneStack<NodeState> stack_; 172 ZoneStack<NodeState> stack_;
180 173
181 DISALLOW_COPY_AND_ASSIGN(GraphReducer); 174 DISALLOW_COPY_AND_ASSIGN(GraphReducer);
182 }; 175 };
183 176
184 } // namespace compiler 177 } // namespace compiler
185 } // namespace internal 178 } // namespace internal
186 } // namespace v8 179 } // namespace v8
187 180
188 #endif // V8_COMPILER_GRAPH_REDUCER_H_ 181 #endif // V8_COMPILER_GRAPH_REDUCER_H_
OLDNEW
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/graph-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698