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_LOOP_ANALYSIS_H_ | 5 #ifndef V8_COMPILER_LOOP_ANALYSIS_H_ |
6 #define V8_COMPILER_LOOP_ANALYSIS_H_ | 6 #define V8_COMPILER_LOOP_ANALYSIS_H_ |
7 | 7 |
8 #include "src/base/iterator.h" | 8 #include "src/base/iterator.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 int LoopNum(Loop* loop) const { | 82 int LoopNum(Loop* loop) const { |
83 return 1 + static_cast<int>(loop - &all_loops_[0]); | 83 return 1 + static_cast<int>(loop - &all_loops_[0]); |
84 } | 84 } |
85 | 85 |
86 // Return a range which can iterate over the header nodes of {loop}. | 86 // Return a range which can iterate over the header nodes of {loop}. |
87 NodeRange HeaderNodes(Loop* loop) { | 87 NodeRange HeaderNodes(Loop* loop) { |
88 return NodeRange(&loop_nodes_[0] + loop->header_start_, | 88 return NodeRange(&loop_nodes_[0] + loop->header_start_, |
89 &loop_nodes_[0] + loop->body_start_); | 89 &loop_nodes_[0] + loop->body_start_); |
90 } | 90 } |
91 | 91 |
| 92 // Return the header control node for a loop. |
| 93 Node* HeaderNode(Loop* loop); |
| 94 |
92 // Return a range which can iterate over the body nodes of {loop}. | 95 // Return a range which can iterate over the body nodes of {loop}. |
93 NodeRange BodyNodes(Loop* loop) { | 96 NodeRange BodyNodes(Loop* loop) { |
94 return NodeRange(&loop_nodes_[0] + loop->body_start_, | 97 return NodeRange(&loop_nodes_[0] + loop->body_start_, |
95 &loop_nodes_[0] + loop->body_end_); | 98 &loop_nodes_[0] + loop->body_end_); |
96 } | 99 } |
97 | 100 |
98 // Return a range which can iterate over the nodes of {loop}. | 101 // Return a range which can iterate over the nodes of {loop}. |
99 NodeRange LoopNodes(Loop* loop) { | 102 NodeRange LoopNodes(Loop* loop) { |
100 return NodeRange(&loop_nodes_[0] + loop->header_start_, | 103 return NodeRange(&loop_nodes_[0] + loop->header_start_, |
101 &loop_nodes_[0] + loop->body_end_); | 104 &loop_nodes_[0] + loop->body_end_); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Build a loop tree for the entire graph. | 146 // Build a loop tree for the entire graph. |
144 static LoopTree* BuildLoopTree(Graph* graph, Zone* temp_zone); | 147 static LoopTree* BuildLoopTree(Graph* graph, Zone* temp_zone); |
145 }; | 148 }; |
146 | 149 |
147 | 150 |
148 } // namespace compiler | 151 } // namespace compiler |
149 } // namespace internal | 152 } // namespace internal |
150 } // namespace v8 | 153 } // namespace v8 |
151 | 154 |
152 #endif // V8_COMPILER_LOOP_ANALYSIS_H_ | 155 #endif // V8_COMPILER_LOOP_ANALYSIS_H_ |
OLD | NEW |