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_BRANCH_CONDITION_ELIMINATION_H_ | 5 #ifndef V8_COMPILER_BRANCH_CONDITION_ELIMINATION_H_ |
6 #define V8_COMPILER_BRANCH_CONDITION_ELIMINATION_H_ | 6 #define V8_COMPILER_BRANCH_CONDITION_ELIMINATION_H_ |
7 | 7 |
8 #include "src/compiler/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
| 14 // Forward declarations. |
| 15 class CommonOperatorBuilder; |
14 class JSGraph; | 16 class JSGraph; |
15 | 17 |
16 | 18 |
17 class BranchElimination final : public AdvancedReducer { | 19 class BranchElimination final : public AdvancedReducer { |
18 public: | 20 public: |
19 BranchElimination(Editor* editor, JSGraph* js_graph, Zone* zone); | 21 BranchElimination(Editor* editor, JSGraph* js_graph, Zone* zone); |
20 ~BranchElimination() final; | 22 ~BranchElimination() final; |
21 | 23 |
22 Reduction Reduce(Node* node) final; | 24 Reduction Reduce(Node* node) final; |
23 | 25 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 PathConditionsForControlNodes(Zone* zone, size_t size_hint) | 68 PathConditionsForControlNodes(Zone* zone, size_t size_hint) |
67 : info_for_node_(size_hint, nullptr, zone) {} | 69 : info_for_node_(size_hint, nullptr, zone) {} |
68 const ControlPathConditions* Get(Node* node); | 70 const ControlPathConditions* Get(Node* node); |
69 void Set(Node* node, const ControlPathConditions* conditions); | 71 void Set(Node* node, const ControlPathConditions* conditions); |
70 | 72 |
71 private: | 73 private: |
72 ZoneVector<const ControlPathConditions*> info_for_node_; | 74 ZoneVector<const ControlPathConditions*> info_for_node_; |
73 }; | 75 }; |
74 | 76 |
75 Reduction ReduceBranch(Node* node); | 77 Reduction ReduceBranch(Node* node); |
| 78 Reduction ReduceDeoptimizeConditional(Node* node); |
76 Reduction ReduceIf(Node* node, bool is_true_branch); | 79 Reduction ReduceIf(Node* node, bool is_true_branch); |
77 Reduction ReduceLoop(Node* node); | 80 Reduction ReduceLoop(Node* node); |
78 Reduction ReduceMerge(Node* node); | 81 Reduction ReduceMerge(Node* node); |
79 Reduction ReduceStart(Node* node); | 82 Reduction ReduceStart(Node* node); |
80 Reduction ReduceOtherControl(Node* node); | 83 Reduction ReduceOtherControl(Node* node); |
81 | 84 |
82 Reduction TakeConditionsFromFirstControl(Node* node); | 85 Reduction TakeConditionsFromFirstControl(Node* node); |
83 Reduction UpdateConditions(Node* node, | 86 Reduction UpdateConditions(Node* node, |
84 const ControlPathConditions* conditions); | 87 const ControlPathConditions* conditions); |
85 | 88 |
86 Node* dead() const { return dead_; } | 89 Node* dead() const { return dead_; } |
| 90 Graph* graph() const; |
| 91 JSGraph* jsgraph() const { return jsgraph_; } |
| 92 CommonOperatorBuilder* common() const; |
87 | 93 |
| 94 JSGraph* const jsgraph_; |
88 PathConditionsForControlNodes node_conditions_; | 95 PathConditionsForControlNodes node_conditions_; |
89 Zone* zone_; | 96 Zone* zone_; |
90 Node* dead_; | 97 Node* dead_; |
91 }; | 98 }; |
92 | 99 |
93 } // namespace compiler | 100 } // namespace compiler |
94 } // namespace internal | 101 } // namespace internal |
95 } // namespace v8 | 102 } // namespace v8 |
96 | 103 |
97 #endif // V8_COMPILER_BRANCH_CONDITION_ELIMINATION_H_ | 104 #endif // V8_COMPILER_BRANCH_CONDITION_ELIMINATION_H_ |
OLD | NEW |