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 | 9 |
10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 // BasicBlock mutation: insert a switch into the end of {block}. | 237 // BasicBlock mutation: insert a switch into the end of {block}. |
238 void InsertSwitch(BasicBlock* block, BasicBlock* end, Node* sw, | 238 void InsertSwitch(BasicBlock* block, BasicBlock* end, Node* sw, |
239 BasicBlock** succ_blocks, size_t succ_count); | 239 BasicBlock** succ_blocks, size_t succ_count); |
240 | 240 |
241 // Exposed publicly for testing only. | 241 // Exposed publicly for testing only. |
242 void AddSuccessorForTesting(BasicBlock* block, BasicBlock* succ) { | 242 void AddSuccessorForTesting(BasicBlock* block, BasicBlock* succ) { |
243 return AddSuccessor(block, succ); | 243 return AddSuccessor(block, succ); |
244 } | 244 } |
245 | 245 |
| 246 const BasicBlockVector* all_blocks() const { return &all_blocks_; } |
246 BasicBlockVector* rpo_order() { return &rpo_order_; } | 247 BasicBlockVector* rpo_order() { return &rpo_order_; } |
247 const BasicBlockVector* rpo_order() const { return &rpo_order_; } | 248 const BasicBlockVector* rpo_order() const { return &rpo_order_; } |
248 | 249 |
249 BasicBlock* start() { return start_; } | 250 BasicBlock* start() { return start_; } |
250 BasicBlock* end() { return end_; } | 251 BasicBlock* end() { return end_; } |
251 | 252 |
252 Zone* zone() const { return zone_; } | 253 Zone* zone() const { return zone_; } |
253 | 254 |
254 private: | 255 private: |
255 friend class Scheduler; | 256 friend class Scheduler; |
256 friend class BasicBlockInstrumentor; | 257 friend class BasicBlockInstrumentor; |
| 258 friend class RawMachineAssembler; |
| 259 |
| 260 // Ensure split-edge form for a hand-assembled schedule. |
| 261 void EnsureSplitEdgeForm(); |
| 262 // Copy deferred block markers down as far as possible |
| 263 void PropagateDeferredMark(); |
257 | 264 |
258 void AddSuccessor(BasicBlock* block, BasicBlock* succ); | 265 void AddSuccessor(BasicBlock* block, BasicBlock* succ); |
259 void MoveSuccessors(BasicBlock* from, BasicBlock* to); | 266 void MoveSuccessors(BasicBlock* from, BasicBlock* to); |
260 | 267 |
261 void SetControlInput(BasicBlock* block, Node* node); | 268 void SetControlInput(BasicBlock* block, Node* node); |
262 void SetBlockForNode(BasicBlock* block, Node* node); | 269 void SetBlockForNode(BasicBlock* block, Node* node); |
263 | 270 |
264 Zone* zone_; | 271 Zone* zone_; |
265 BasicBlockVector all_blocks_; // All basic blocks in the schedule. | 272 BasicBlockVector all_blocks_; // All basic blocks in the schedule. |
266 BasicBlockVector nodeid_to_block_; // Map from node to containing block. | 273 BasicBlockVector nodeid_to_block_; // Map from node to containing block. |
267 BasicBlockVector rpo_order_; // Reverse-post-order block list. | 274 BasicBlockVector rpo_order_; // Reverse-post-order block list. |
268 BasicBlock* start_; | 275 BasicBlock* start_; |
269 BasicBlock* end_; | 276 BasicBlock* end_; |
270 | 277 |
271 DISALLOW_COPY_AND_ASSIGN(Schedule); | 278 DISALLOW_COPY_AND_ASSIGN(Schedule); |
272 }; | 279 }; |
273 | 280 |
274 std::ostream& operator<<(std::ostream&, const Schedule&); | 281 std::ostream& operator<<(std::ostream&, const Schedule&); |
275 | 282 |
276 } // namespace compiler | 283 } // namespace compiler |
277 } // namespace internal | 284 } // namespace internal |
278 } // namespace v8 | 285 } // namespace v8 |
279 | 286 |
280 #endif // V8_COMPILER_SCHEDULE_H_ | 287 #endif // V8_COMPILER_SCHEDULE_H_ |
OLD | NEW |