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_CONTROL_REDUCER_H_ | 5 #ifndef V8_COMPILER_CONTROL_REDUCER_H_ |
6 #define V8_COMPILER_CONTROL_REDUCER_H_ | 6 #define V8_COMPILER_CONTROL_REDUCER_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
11 | 11 |
12 class JSGraph; | 12 class JSGraph; |
13 class CommonOperatorBuilder; | 13 class CommonOperatorBuilder; |
14 class Node; | 14 class Node; |
15 | 15 |
16 class ControlReducer { | 16 class ControlReducer { |
17 public: | 17 public: |
18 // Perform branch folding and dead code elimination on the graph. | 18 // Perform branch folding and dead code elimination on the graph. |
19 static void ReduceGraph(Zone* zone, JSGraph* graph, | 19 static void ReduceGraph(Zone* zone, JSGraph* graph, |
20 CommonOperatorBuilder* builder); | 20 CommonOperatorBuilder* builder); |
21 | 21 |
22 // Trim nodes in the graph that are not reachable from end. | 22 // Trim nodes in the graph that are not reachable from end. |
23 static void TrimGraph(Zone* zone, JSGraph* graph); | 23 static void TrimGraph(Zone* zone, JSGraph* graph); |
24 | 24 |
25 // Testing interface. | 25 // Testing interface. |
26 static Node* ReducePhiForTesting(JSGraph* graph, | 26 static Node* ReducePhiForTesting(JSGraph* graph, |
27 CommonOperatorBuilder* builder, Node* node); | 27 CommonOperatorBuilder* builder, Node* node); |
28 static Node* ReduceBranchForTesting(JSGraph* graph, | 28 static Node* ReduceIfNodeForTesting(JSGraph* graph, |
29 CommonOperatorBuilder* builder, | 29 CommonOperatorBuilder* builder, |
30 Node* node); | 30 Node* node); |
31 static Node* ReduceMergeForTesting(JSGraph* graph, | 31 static Node* ReduceMergeForTesting(JSGraph* graph, |
32 CommonOperatorBuilder* builder, | 32 CommonOperatorBuilder* builder, |
33 Node* node); | 33 Node* node); |
34 }; | 34 }; |
35 } | 35 } |
36 } | 36 } |
37 } // namespace v8::internal::compiler | 37 } // namespace v8::internal::compiler |
38 | 38 |
39 #endif // V8_COMPILER_CONTROL_REDUCER_H_ | 39 #endif // V8_COMPILER_CONTROL_REDUCER_H_ |
OLD | NEW |