OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_STORE_STORE_ELIMINATION_H_ | 5 #ifndef V8_COMPILER_STORE_STORE_ELIMINATION_H_ |
6 #define V8_COMPILER_STORE_STORE_ELIMINATION_H_ | 6 #define V8_COMPILER_STORE_STORE_ELIMINATION_H_ |
7 | 7 |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/graph-reducer.h" | |
10 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/zone-containers.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace compiler { | 14 namespace compiler { |
15 | 15 |
16 // Forward declarations. | |
17 class CommonOperatorBuilder; | |
18 class JSGraph; | |
19 | |
20 class StoreStoreElimination final { | 16 class StoreStoreElimination final { |
21 public: | 17 public: |
22 StoreStoreElimination(JSGraph* js_graph, Zone* temp_zone); | 18 static void Run(JSGraph* js_graph, Zone* temp_zone); |
23 ~StoreStoreElimination(); | |
24 void Run(); | |
25 | |
26 private: | |
27 static bool IsEligibleNode(Node* node); | |
28 void ReduceEligibleNode(Node* node); | |
29 JSGraph* jsgraph() const { return jsgraph_; } | |
30 Zone* temp_zone() const { return temp_zone_; } | |
31 | |
32 JSGraph* const jsgraph_; | |
33 Zone* const temp_zone_; | |
34 }; | 19 }; |
35 | 20 |
36 } // namespace compiler | 21 } // namespace compiler |
37 } // namespace internal | 22 } // namespace internal |
38 } // namespace v8 | 23 } // namespace v8 |
39 | 24 |
40 #endif // V8_COMPILER_STORE_STORE_ELIMINATION_H_ | 25 #endif // V8_COMPILER_STORE_STORE_ELIMINATION_H_ |
OLD | NEW |