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 #include "src/compiler/schedule.h" | 5 #include "src/compiler/schedule.h" |
6 | 6 |
7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 | 10 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 nodeid_to_block_.resize(node->id() + 1); | 385 nodeid_to_block_.resize(node->id() + 1); |
386 } | 386 } |
387 nodeid_to_block_[node->id()] = block; | 387 nodeid_to_block_[node->id()] = block; |
388 } | 388 } |
389 | 389 |
390 | 390 |
391 std::ostream& operator<<(std::ostream& os, const Schedule& s) { | 391 std::ostream& operator<<(std::ostream& os, const Schedule& s) { |
392 for (BasicBlock* block : | 392 for (BasicBlock* block : |
393 ((s.RpoBlockCount() == 0) ? *s.all_blocks() : *s.rpo_order())) { | 393 ((s.RpoBlockCount() == 0) ? *s.all_blocks() : *s.rpo_order())) { |
394 if (block->rpo_number() == -1) { | 394 if (block->rpo_number() == -1) { |
395 os << "--- BLOCK B" << block->id().ToInt() << " (block id)"; | 395 os << "--- BLOCK id:" << block->id().ToInt(); |
396 } else { | 396 } else { |
397 os << "--- BLOCK B" << block->rpo_number(); | 397 os << "--- BLOCK B" << block->rpo_number(); |
398 } | 398 } |
399 if (block->deferred()) os << " (deferred)"; | 399 if (block->deferred()) os << " (deferred)"; |
400 if (block->PredecessorCount() != 0) os << " <- "; | 400 if (block->PredecessorCount() != 0) os << " <- "; |
401 bool comma = false; | 401 bool comma = false; |
402 for (BasicBlock const* predecessor : block->predecessors()) { | 402 for (BasicBlock const* predecessor : block->predecessors()) { |
403 if (comma) os << ", "; | 403 if (comma) os << ", "; |
404 comma = true; | 404 comma = true; |
405 if (predecessor->rpo_number() == -1) { | 405 if (predecessor->rpo_number() == -1) { |
406 os << "B" << predecessor->id().ToInt(); | 406 os << "id:" << predecessor->id().ToInt(); |
407 } else { | 407 } else { |
408 os << "B" << predecessor->rpo_number(); | 408 os << "B" << predecessor->rpo_number(); |
409 } | 409 } |
410 } | 410 } |
411 os << " ---\n"; | 411 os << " ---\n"; |
412 for (Node* node : *block) { | 412 for (Node* node : *block) { |
413 os << " " << *node; | 413 os << " " << *node; |
414 if (NodeProperties::IsTyped(node)) { | 414 if (NodeProperties::IsTyped(node)) { |
415 Type* type = NodeProperties::GetType(node); | 415 Type* type = NodeProperties::GetType(node); |
416 os << " : "; | 416 os << " : "; |
417 type->PrintTo(os); | 417 type->PrintTo(os); |
418 } | 418 } |
419 os << "\n"; | 419 os << "\n"; |
420 } | 420 } |
421 BasicBlock::Control control = block->control(); | 421 BasicBlock::Control control = block->control(); |
422 if (control != BasicBlock::kNone) { | 422 if (control != BasicBlock::kNone) { |
423 os << " "; | 423 os << " "; |
424 if (block->control_input() != nullptr) { | 424 if (block->control_input() != nullptr) { |
425 os << *block->control_input(); | 425 os << *block->control_input(); |
426 } else { | 426 } else { |
427 os << "Goto"; | 427 os << "Goto"; |
428 } | 428 } |
429 os << " -> "; | 429 os << " -> "; |
430 comma = false; | 430 comma = false; |
431 for (BasicBlock const* successor : block->successors()) { | 431 for (BasicBlock const* successor : block->successors()) { |
432 if (comma) os << ", "; | 432 if (comma) os << ", "; |
433 comma = true; | 433 comma = true; |
434 if (successor->rpo_number() == -1) { | 434 if (successor->rpo_number() == -1) { |
435 os << "B" << successor->id().ToInt(); | 435 os << "id:" << successor->id().ToInt(); |
436 } else { | 436 } else { |
437 os << "B" << successor->rpo_number(); | 437 os << "B" << successor->rpo_number(); |
438 } | 438 } |
439 } | 439 } |
440 os << "\n"; | 440 os << "\n"; |
441 } | 441 } |
442 } | 442 } |
443 return os; | 443 return os; |
444 } | 444 } |
445 | 445 |
446 } // namespace compiler | 446 } // namespace compiler |
447 } // namespace internal | 447 } // namespace internal |
448 } // namespace v8 | 448 } // namespace v8 |
OLD | NEW |