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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 // BasicBlock building: add a return at the end of {block}. | 212 // BasicBlock building: add a return at the end of {block}. |
213 void AddReturn(BasicBlock* block, Node* input); | 213 void AddReturn(BasicBlock* block, Node* input); |
214 | 214 |
215 // BasicBlock building: add a throw at the end of {block}. | 215 // BasicBlock building: add a throw at the end of {block}. |
216 void AddThrow(BasicBlock* block, Node* input); | 216 void AddThrow(BasicBlock* block, Node* input); |
217 | 217 |
218 void AddSuccessor(BasicBlock* block, BasicBlock* succ); | 218 void AddSuccessor(BasicBlock* block, BasicBlock* succ); |
219 | 219 |
220 BasicBlockVector* rpo_order() { return &rpo_order_; } | 220 BasicBlockVector* rpo_order() { return &rpo_order_; } |
| 221 const BasicBlockVector* rpo_order() const { return &rpo_order_; } |
221 | 222 |
222 BasicBlock* start() { return start_; } | 223 BasicBlock* start() { return start_; } |
223 BasicBlock* end() { return end_; } | 224 BasicBlock* end() { return end_; } |
224 | 225 |
225 Zone* zone() { return zone_; } | 226 Zone* zone() const { return zone_; } |
226 | 227 |
227 private: | 228 private: |
228 friend class Scheduler; | 229 friend class Scheduler; |
229 friend class CodeGenerator; | 230 friend class CodeGenerator; |
230 friend class ScheduleVisualizer; | 231 friend class ScheduleVisualizer; |
231 friend class BasicBlockInstrumentor; | 232 friend class BasicBlockInstrumentor; |
232 | 233 |
233 void SetControlInput(BasicBlock* block, Node* node); | 234 void SetControlInput(BasicBlock* block, Node* node); |
234 void SetBlockForNode(BasicBlock* block, Node* node); | 235 void SetBlockForNode(BasicBlock* block, Node* node); |
235 | 236 |
236 Zone* zone_; | 237 Zone* zone_; |
237 BasicBlockVector all_blocks_; // All basic blocks in the schedule. | 238 BasicBlockVector all_blocks_; // All basic blocks in the schedule. |
238 BasicBlockVector nodeid_to_block_; // Map from node to containing block. | 239 BasicBlockVector nodeid_to_block_; // Map from node to containing block. |
239 BasicBlockVector rpo_order_; // Reverse-post-order block list. | 240 BasicBlockVector rpo_order_; // Reverse-post-order block list. |
240 BasicBlock* start_; | 241 BasicBlock* start_; |
241 BasicBlock* end_; | 242 BasicBlock* end_; |
242 }; | 243 }; |
243 | 244 |
244 std::ostream& operator<<(std::ostream& os, const Schedule& s); | 245 std::ostream& operator<<(std::ostream& os, const Schedule& s); |
245 | 246 |
246 } // namespace compiler | 247 } // namespace compiler |
247 } // namespace internal | 248 } // namespace internal |
248 } // namespace v8 | 249 } // namespace v8 |
249 | 250 |
250 #endif // V8_COMPILER_SCHEDULE_H_ | 251 #endif // V8_COMPILER_SCHEDULE_H_ |
OLD | NEW |