| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_DEAD_CODE_ELIMINATION_H_ | 5 #ifndef V8_COMPILER_DEAD_CODE_ELIMINATION_H_ |
| 6 #define V8_COMPILER_DEAD_CODE_ELIMINATION_H_ | 6 #define V8_COMPILER_DEAD_CODE_ELIMINATION_H_ |
| 7 | 7 |
| 8 #include "src/base/compiler-specific.h" |
| 8 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
| 10 #include "src/globals.h" |
| 9 | 11 |
| 10 namespace v8 { | 12 namespace v8 { |
| 11 namespace internal { | 13 namespace internal { |
| 12 namespace compiler { | 14 namespace compiler { |
| 13 | 15 |
| 14 // Forward declarations. | 16 // Forward declarations. |
| 15 class CommonOperatorBuilder; | 17 class CommonOperatorBuilder; |
| 16 | 18 |
| 17 | 19 |
| 18 // Propagates {Dead} control through the graph and thereby removes dead code. | 20 // Propagates {Dead} control through the graph and thereby removes dead code. |
| 19 // Note that this does not include trimming dead uses from the graph, and it | 21 // Note that this does not include trimming dead uses from the graph, and it |
| 20 // also does not include detecting dead code by any other means than seeing a | 22 // also does not include detecting dead code by any other means than seeing a |
| 21 // {Dead} control input; that is left to other reducers. | 23 // {Dead} control input; that is left to other reducers. |
| 22 class DeadCodeElimination final : public AdvancedReducer { | 24 class V8_EXPORT_PRIVATE DeadCodeElimination final |
| 25 : public NON_EXPORTED_BASE(AdvancedReducer) { |
| 23 public: | 26 public: |
| 24 DeadCodeElimination(Editor* editor, Graph* graph, | 27 DeadCodeElimination(Editor* editor, Graph* graph, |
| 25 CommonOperatorBuilder* common); | 28 CommonOperatorBuilder* common); |
| 26 ~DeadCodeElimination() final {} | 29 ~DeadCodeElimination() final {} |
| 27 | 30 |
| 28 Reduction Reduce(Node* node) final; | 31 Reduction Reduce(Node* node) final; |
| 29 | 32 |
| 30 private: | 33 private: |
| 31 Reduction ReduceEnd(Node* node); | 34 Reduction ReduceEnd(Node* node); |
| 32 Reduction ReduceLoopOrMerge(Node* node); | 35 Reduction ReduceLoopOrMerge(Node* node); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 46 Node* const dead_; | 49 Node* const dead_; |
| 47 | 50 |
| 48 DISALLOW_COPY_AND_ASSIGN(DeadCodeElimination); | 51 DISALLOW_COPY_AND_ASSIGN(DeadCodeElimination); |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 } // namespace compiler | 54 } // namespace compiler |
| 52 } // namespace internal | 55 } // namespace internal |
| 53 } // namespace v8 | 56 } // namespace v8 |
| 54 | 57 |
| 55 #endif // V8_COMPILER_DEAD_CODE_ELIMINATION_H_ | 58 #endif // V8_COMPILER_DEAD_CODE_ELIMINATION_H_ |
| OLD | NEW |