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/node-marker.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. | 15 // Forward declarations. |
16 class Graph; | 16 class Graph; |
17 class Node; | 17 class Node; |
18 | 18 |
19 | 19 |
20 // NodeIds are identifying numbers for nodes that can be used to index auxiliary | 20 // NodeIds are identifying numbers for nodes that can be used to index auxiliary |
21 // out-of-line data associated with each node. | 21 // out-of-line data associated with each node. |
22 typedef int32_t NodeId; | 22 typedef uint32_t NodeId; |
23 | 23 |
24 | 24 |
25 // Represents the result of trying to reduce a node in the graph. | 25 // Represents the result of trying to reduce a node in the graph. |
26 class Reduction final { | 26 class Reduction final { |
27 public: | 27 public: |
28 explicit Reduction(Node* replacement = nullptr) : replacement_(replacement) {} | 28 explicit Reduction(Node* replacement = nullptr) : replacement_(replacement) {} |
29 | 29 |
30 Node* replacement() const { return replacement_; } | 30 Node* replacement() const { return replacement_; } |
31 bool Changed() const { return replacement() != nullptr; } | 31 bool Changed() const { return replacement() != nullptr; } |
32 | 32 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 ZoneStack<NodeState> stack_; | 179 ZoneStack<NodeState> stack_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(GraphReducer); | 181 DISALLOW_COPY_AND_ASSIGN(GraphReducer); |
182 }; | 182 }; |
183 | 183 |
184 } // namespace compiler | 184 } // namespace compiler |
185 } // namespace internal | 185 } // namespace internal |
186 } // namespace v8 | 186 } // namespace v8 |
187 | 187 |
188 #endif // V8_COMPILER_GRAPH_REDUCER_H_ | 188 #endif // V8_COMPILER_GRAPH_REDUCER_H_ |
OLD | NEW |