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 #include "src/compiler/instruction.h" | 5 #include "src/compiler/instruction.h" |
6 | 6 |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 | 10 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 329 } |
330 | 330 |
331 | 331 |
332 InstructionBlock::InstructionBlock(Zone* zone, const BasicBlock* block) | 332 InstructionBlock::InstructionBlock(Zone* zone, const BasicBlock* block) |
333 : successors_(static_cast<int>(block->SuccessorCount()), | 333 : successors_(static_cast<int>(block->SuccessorCount()), |
334 BasicBlock::RpoNumber::Invalid(), zone), | 334 BasicBlock::RpoNumber::Invalid(), zone), |
335 predecessors_(static_cast<int>(block->PredecessorCount()), | 335 predecessors_(static_cast<int>(block->PredecessorCount()), |
336 BasicBlock::RpoNumber::Invalid(), zone), | 336 BasicBlock::RpoNumber::Invalid(), zone), |
337 phis_(zone), | 337 phis_(zone), |
338 id_(block->id()), | 338 id_(block->id()), |
| 339 ao_number_(block->GetAoNumber()), |
339 rpo_number_(block->GetRpoNumber()), | 340 rpo_number_(block->GetRpoNumber()), |
340 loop_header_(GetRpo(block->loop_header())), | 341 loop_header_(GetRpo(block->loop_header())), |
341 loop_end_(GetLoopEndRpo(block)), | 342 loop_end_(GetLoopEndRpo(block)), |
342 code_start_(-1), | 343 code_start_(-1), |
343 code_end_(-1) { | 344 code_end_(-1), |
| 345 deferred_(block->deferred()) { |
344 // Map successors and precessors | 346 // Map successors and precessors |
345 size_t index = 0; | 347 size_t index = 0; |
346 for (BasicBlock::Successors::const_iterator it = block->successors_begin(); | 348 for (BasicBlock::Successors::const_iterator it = block->successors_begin(); |
347 it != block->successors_end(); ++it, ++index) { | 349 it != block->successors_end(); ++it, ++index) { |
348 successors_[index] = (*it)->GetRpoNumber(); | 350 successors_[index] = (*it)->GetRpoNumber(); |
349 } | 351 } |
350 index = 0; | 352 index = 0; |
351 for (BasicBlock::Predecessors::const_iterator | 353 for (BasicBlock::Predecessors::const_iterator |
352 it = block->predecessors_begin(); | 354 it = block->predecessors_begin(); |
353 it != block->predecessors_end(); ++it, ++index) { | 355 it != block->predecessors_end(); ++it, ++index) { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 int i = 0; | 599 int i = 0; |
598 for (ConstantMap::const_iterator it = code.constants_.begin(); | 600 for (ConstantMap::const_iterator it = code.constants_.begin(); |
599 it != code.constants_.end(); ++i, ++it) { | 601 it != code.constants_.end(); ++i, ++it) { |
600 os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n"; | 602 os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n"; |
601 } | 603 } |
602 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 604 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
603 BasicBlock::RpoNumber rpo = BasicBlock::RpoNumber::FromInt(i); | 605 BasicBlock::RpoNumber rpo = BasicBlock::RpoNumber::FromInt(i); |
604 const InstructionBlock* block = code.InstructionBlockAt(rpo); | 606 const InstructionBlock* block = code.InstructionBlockAt(rpo); |
605 CHECK(block->rpo_number() == rpo); | 607 CHECK(block->rpo_number() == rpo); |
606 | 608 |
607 os << "RPO#" << block->rpo_number() << ": B" << block->id(); | 609 os << "RPO#" << block->rpo_number(); |
| 610 os << ": AO#" << block->ao_number(); |
| 611 os << ": B" << block->id(); |
| 612 if (block->IsDeferred()) os << " (deferred)"; |
608 if (block->IsLoopHeader()) { | 613 if (block->IsLoopHeader()) { |
609 os << " loop blocks: [" << block->rpo_number() << ", " | 614 os << " loop blocks: [" << block->rpo_number() << ", " |
610 << block->loop_end() << ")"; | 615 << block->loop_end() << ")"; |
611 } | 616 } |
612 os << " instructions: [" << block->code_start() << ", " | 617 os << " instructions: [" << block->code_start() << ", " |
613 << block->code_end() << ")\n predecessors:"; | 618 << block->code_end() << ")\n predecessors:"; |
614 | 619 |
615 for (auto pred : block->predecessors()) { | 620 for (auto pred : block->predecessors()) { |
616 const InstructionBlock* pred_block = code.InstructionBlockAt(pred); | 621 const InstructionBlock* pred_block = code.InstructionBlockAt(pred); |
617 os << " B" << pred_block->id(); | 622 os << " B" << pred_block->id(); |
(...skipping 28 matching lines...) Expand all Loading... |
646 os << " B" << succ_block->id(); | 651 os << " B" << succ_block->id(); |
647 } | 652 } |
648 os << "\n"; | 653 os << "\n"; |
649 } | 654 } |
650 return os; | 655 return os; |
651 } | 656 } |
652 | 657 |
653 } // namespace compiler | 658 } // namespace compiler |
654 } // namespace internal | 659 } // namespace internal |
655 } // namespace v8 | 660 } // namespace v8 |
OLD | NEW |