| Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 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 | 
|  | 3 | // found in the LICENSE file. | 
|  | 4 |  | 
|  | 5 | #ifndef V8_COMPILER_LOAD_ELIMINATION_H_ | 
|  | 6 | #define V8_COMPILER_LOAD_ELIMINATION_H_ | 
|  | 7 |  | 
|  | 8 | #include "src/compiler/graph-reducer.h" | 
|  | 9 |  | 
|  | 10 | namespace v8 { | 
|  | 11 | namespace internal { | 
|  | 12 | namespace compiler { | 
|  | 13 |  | 
| Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 14 | class CommonOperatorBuilder; | 
|  | 15 | class Graph; | 
|  | 16 |  | 
| Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 17 | class LoadElimination final : public AdvancedReducer { | 
| Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 18 | public: | 
| Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 19 | explicit LoadElimination(Editor* editor, Graph* graph, | 
|  | 20 | CommonOperatorBuilder* common) | 
|  | 21 | : AdvancedReducer(editor), graph_(graph), common_(common) {} | 
| Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 22 | ~LoadElimination() final; | 
| Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 23 |  | 
| Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 24 | Reduction Reduce(Node* node) final; | 
| Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 25 |  | 
|  | 26 | private: | 
| Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 27 | CommonOperatorBuilder* common() const { return common_; } | 
|  | 28 | Graph* graph() { return graph_; } | 
|  | 29 |  | 
| Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 30 | Reduction ReduceLoadField(Node* node); | 
| Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 31 | Graph* graph_; | 
|  | 32 | CommonOperatorBuilder* common_; | 
| Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 33 | }; | 
|  | 34 |  | 
|  | 35 | }  // namespace compiler | 
|  | 36 | }  // namespace internal | 
|  | 37 | }  // namespace v8 | 
|  | 38 |  | 
|  | 39 | #endif  // V8_COMPILER_LOAD_ELIMINATION_H_ |