OLD | NEW |
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/graph.h" | 8 #include "src/compiler/node-marker.h" |
9 #include "src/zone-containers.h" | 9 #include "src/zone-containers.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 namespace compiler { | 13 namespace compiler { |
14 | 14 |
| 15 // Forward declarations. |
| 16 class Graph; |
| 17 class Node; |
| 18 |
| 19 |
15 // Represents the result of trying to reduce a node in the graph. | 20 // Represents the result of trying to reduce a node in the graph. |
16 class Reduction FINAL { | 21 class Reduction FINAL { |
17 public: | 22 public: |
18 explicit Reduction(Node* replacement = NULL) : replacement_(replacement) {} | 23 explicit Reduction(Node* replacement = NULL) : replacement_(replacement) {} |
19 | 24 |
20 Node* replacement() const { return replacement_; } | 25 Node* replacement() const { return replacement_; } |
21 bool Changed() const { return replacement() != NULL; } | 26 bool Changed() const { return replacement() != NULL; } |
22 | 27 |
23 private: | 28 private: |
24 Node* replacement_; | 29 Node* replacement_; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 ZoneStack<NodeState> stack_; | 94 ZoneStack<NodeState> stack_; |
90 | 95 |
91 DISALLOW_COPY_AND_ASSIGN(GraphReducer); | 96 DISALLOW_COPY_AND_ASSIGN(GraphReducer); |
92 }; | 97 }; |
93 | 98 |
94 } // namespace compiler | 99 } // namespace compiler |
95 } // namespace internal | 100 } // namespace internal |
96 } // namespace v8 | 101 } // namespace v8 |
97 | 102 |
98 #endif // V8_COMPILER_GRAPH_REDUCER_H_ | 103 #endif // V8_COMPILER_GRAPH_REDUCER_H_ |
OLD | NEW |