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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
9 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
10 | 10 |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 for (const RpoNumber& successor_id : block->successors()) { | 628 for (const RpoNumber& successor_id : block->successors()) { |
629 const InstructionBlock* successor = InstructionBlockAt(successor_id); | 629 const InstructionBlock* successor = InstructionBlockAt(successor_id); |
630 // Expect precisely one predecessor: "block". | 630 // Expect precisely one predecessor: "block". |
631 CHECK(successor->PredecessorCount() == 1 && | 631 CHECK(successor->PredecessorCount() == 1 && |
632 successor->predecessors()[0] == block->rpo_number()); | 632 successor->predecessors()[0] == block->rpo_number()); |
633 } | 633 } |
634 } | 634 } |
635 } | 635 } |
636 } | 636 } |
637 | 637 |
| 638 void InstructionSequence::ValidateDeferredBlockExitPaths() { |
| 639 // A deferred block with more than one successor must have all its successors |
| 640 // deferred. |
| 641 for (const InstructionBlock* block : instruction_blocks()) { |
| 642 if (!block->IsDeferred() || block->SuccessorCount() <= 1) continue; |
| 643 for (RpoNumber successor_id : block->successors()) { |
| 644 CHECK(InstructionBlockAt(successor_id)->IsDeferred()); |
| 645 } |
| 646 } |
| 647 } |
| 648 |
638 void InstructionSequence::ValidateSSA() { | 649 void InstructionSequence::ValidateSSA() { |
639 // TODO(mtrofin): We could use a local zone here instead. | 650 // TODO(mtrofin): We could use a local zone here instead. |
640 BitVector definitions(VirtualRegisterCount(), zone()); | 651 BitVector definitions(VirtualRegisterCount(), zone()); |
641 for (const Instruction* instruction : *this) { | 652 for (const Instruction* instruction : *this) { |
642 for (size_t i = 0; i < instruction->OutputCount(); ++i) { | 653 for (size_t i = 0; i < instruction->OutputCount(); ++i) { |
643 const InstructionOperand* output = instruction->OutputAt(i); | 654 const InstructionOperand* output = instruction->OutputAt(i); |
644 int vreg = (output->IsConstant()) | 655 int vreg = (output->IsConstant()) |
645 ? ConstantOperand::cast(output)->virtual_register() | 656 ? ConstantOperand::cast(output)->virtual_register() |
646 : UnallocatedOperand::cast(output)->virtual_register(); | 657 : UnallocatedOperand::cast(output)->virtual_register(); |
647 CHECK(!definitions.Contains(vreg)); | 658 CHECK(!definitions.Contains(vreg)); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 } | 1004 } |
994 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 1005 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
995 printable.sequence_->PrintBlock(printable.register_configuration_, i); | 1006 printable.sequence_->PrintBlock(printable.register_configuration_, i); |
996 } | 1007 } |
997 return os; | 1008 return os; |
998 } | 1009 } |
999 | 1010 |
1000 } // namespace compiler | 1011 } // namespace compiler |
1001 } // namespace internal | 1012 } // namespace internal |
1002 } // namespace v8 | 1013 } // namespace v8 |
OLD | NEW |