OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_SCHEDULE_H_ | 5 #ifndef V8_COMPILER_SCHEDULE_H_ |
6 #define V8_COMPILER_SCHEDULE_H_ | 6 #define V8_COMPILER_SCHEDULE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 bool deferred() const { return deferred_; } | 145 bool deferred() const { return deferred_; } |
146 void set_deferred(bool deferred) { deferred_ = deferred; } | 146 void set_deferred(bool deferred) { deferred_ = deferred; } |
147 | 147 |
148 int32_t dominator_depth() const { return dominator_depth_; } | 148 int32_t dominator_depth() const { return dominator_depth_; } |
149 void set_dominator_depth(int32_t depth) { dominator_depth_ = depth; } | 149 void set_dominator_depth(int32_t depth) { dominator_depth_ = depth; } |
150 | 150 |
151 BasicBlock* dominator() const { return dominator_; } | 151 BasicBlock* dominator() const { return dominator_; } |
152 void set_dominator(BasicBlock* dominator) { dominator_ = dominator; } | 152 void set_dominator(BasicBlock* dominator) { dominator_ = dominator; } |
153 | 153 |
| 154 BasicBlock* rpo_next() const { return rpo_next_; } |
| 155 void set_rpo_next(BasicBlock* rpo_next) { rpo_next_ = rpo_next; } |
| 156 |
154 BasicBlock* loop_header() const { return loop_header_; } | 157 BasicBlock* loop_header() const { return loop_header_; } |
155 void set_loop_header(BasicBlock* loop_header); | 158 void set_loop_header(BasicBlock* loop_header); |
156 | 159 |
157 BasicBlock* loop_end() const { return loop_end_; } | 160 BasicBlock* loop_end() const { return loop_end_; } |
158 void set_loop_end(BasicBlock* loop_end); | 161 void set_loop_end(BasicBlock* loop_end); |
159 | 162 |
160 int32_t loop_depth() const { return loop_depth_; } | 163 int32_t loop_depth() const { return loop_depth_; } |
161 void set_loop_depth(int32_t loop_depth); | 164 void set_loop_depth(int32_t loop_depth); |
162 | 165 |
163 RpoNumber GetAoNumber() const { return RpoNumber::FromInt(ao_number_); } | 166 RpoNumber GetAoNumber() const { return RpoNumber::FromInt(ao_number_); } |
164 int32_t ao_number() const { return ao_number_; } | 167 int32_t ao_number() const { return ao_number_; } |
165 void set_ao_number(int32_t ao_number) { ao_number_ = ao_number; } | 168 void set_ao_number(int32_t ao_number) { ao_number_ = ao_number; } |
166 | 169 |
167 RpoNumber GetRpoNumber() const { return RpoNumber::FromInt(rpo_number_); } | 170 RpoNumber GetRpoNumber() const { return RpoNumber::FromInt(rpo_number_); } |
168 int32_t rpo_number() const { return rpo_number_; } | 171 int32_t rpo_number() const { return rpo_number_; } |
169 void set_rpo_number(int32_t rpo_number); | 172 void set_rpo_number(int32_t rpo_number); |
170 | 173 |
171 // Loop membership helpers. | 174 // Loop membership helpers. |
172 inline bool IsLoopHeader() const { return loop_end_ != NULL; } | 175 inline bool IsLoopHeader() const { return loop_end_ != NULL; } |
173 bool LoopContains(BasicBlock* block) const; | 176 bool LoopContains(BasicBlock* block) const; |
174 | 177 |
175 private: | 178 private: |
176 int32_t ao_number_; // assembly order number of the block. | 179 int32_t ao_number_; // assembly order number of the block. |
177 int32_t rpo_number_; // special RPO number of the block. | 180 int32_t rpo_number_; // special RPO number of the block. |
178 bool deferred_; // true if the block contains deferred code. | 181 bool deferred_; // true if the block contains deferred code. |
179 int32_t dominator_depth_; // Depth within the dominator tree. | 182 int32_t dominator_depth_; // Depth within the dominator tree. |
180 BasicBlock* dominator_; // Immediate dominator of the block. | 183 BasicBlock* dominator_; // Immediate dominator of the block. |
| 184 BasicBlock* rpo_next_; // Link to next block in special RPO order. |
181 BasicBlock* loop_header_; // Pointer to dominating loop header basic block, | 185 BasicBlock* loop_header_; // Pointer to dominating loop header basic block, |
182 // NULL if none. For loop headers, this points to | 186 // NULL if none. For loop headers, this points to |
183 // enclosing loop header. | 187 // enclosing loop header. |
184 BasicBlock* loop_end_; // end of the loop, if this block is a loop header. | 188 BasicBlock* loop_end_; // end of the loop, if this block is a loop header. |
185 int32_t loop_depth_; // loop nesting, 0 is top-level | 189 int32_t loop_depth_; // loop nesting, 0 is top-level |
186 | 190 |
187 Control control_; // Control at the end of the block. | 191 Control control_; // Control at the end of the block. |
188 Node* control_input_; // Input value for control. | 192 Node* control_input_; // Input value for control. |
189 NodeVector nodes_; // nodes of this block in forward order. | 193 NodeVector nodes_; // nodes of this block in forward order. |
190 | 194 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 DISALLOW_COPY_AND_ASSIGN(Schedule); | 287 DISALLOW_COPY_AND_ASSIGN(Schedule); |
284 }; | 288 }; |
285 | 289 |
286 std::ostream& operator<<(std::ostream& os, const Schedule& s); | 290 std::ostream& operator<<(std::ostream& os, const Schedule& s); |
287 | 291 |
288 } // namespace compiler | 292 } // namespace compiler |
289 } // namespace internal | 293 } // namespace internal |
290 } // namespace v8 | 294 } // namespace v8 |
291 | 295 |
292 #endif // V8_COMPILER_SCHEDULE_H_ | 296 #endif // V8_COMPILER_SCHEDULE_H_ |
OLD | NEW |