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 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 DCHECK(instr->reference_map() == NULL); | 552 DCHECK(instr->reference_map() == NULL); |
553 ReferenceMap* reference_map = new (zone()) ReferenceMap(zone()); | 553 ReferenceMap* reference_map = new (zone()) ReferenceMap(zone()); |
554 reference_map->set_instruction_position(index); | 554 reference_map->set_instruction_position(index); |
555 instr->set_reference_map(reference_map); | 555 instr->set_reference_map(reference_map); |
556 reference_maps_.push_back(reference_map); | 556 reference_maps_.push_back(reference_map); |
557 } | 557 } |
558 return index; | 558 return index; |
559 } | 559 } |
560 | 560 |
561 | 561 |
562 const InstructionBlock* InstructionSequence::GetInstructionBlock( | 562 InstructionBlock* InstructionSequence::GetInstructionBlock( |
563 int instruction_index) const { | 563 int instruction_index) const { |
564 DCHECK(instruction_blocks_->size() == block_starts_.size()); | 564 DCHECK(instruction_blocks_->size() == block_starts_.size()); |
565 auto begin = block_starts_.begin(); | 565 auto begin = block_starts_.begin(); |
566 auto end = std::lower_bound(begin, block_starts_.end(), instruction_index, | 566 auto end = std::lower_bound(begin, block_starts_.end(), instruction_index, |
567 std::less_equal<int>()); | 567 std::less_equal<int>()); |
568 size_t index = std::distance(begin, end) - 1; | 568 size_t index = std::distance(begin, end) - 1; |
569 auto block = instruction_blocks_->at(index); | 569 auto block = instruction_blocks_->at(index); |
570 DCHECK(block->code_start() <= instruction_index && | 570 DCHECK(block->code_start() <= instruction_index && |
571 instruction_index < block->code_end()); | 571 instruction_index < block->code_end()); |
572 return block; | 572 return block; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n"; | 753 os << "CST#" << i << ": v" << it->first << " = " << it->second << "\n"; |
754 } | 754 } |
755 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 755 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
756 RpoNumber rpo = RpoNumber::FromInt(i); | 756 RpoNumber rpo = RpoNumber::FromInt(i); |
757 const InstructionBlock* block = code.InstructionBlockAt(rpo); | 757 const InstructionBlock* block = code.InstructionBlockAt(rpo); |
758 CHECK(block->rpo_number() == rpo); | 758 CHECK(block->rpo_number() == rpo); |
759 | 759 |
760 os << "B" << block->rpo_number(); | 760 os << "B" << block->rpo_number(); |
761 os << ": AO#" << block->ao_number(); | 761 os << ": AO#" << block->ao_number(); |
762 if (block->IsDeferred()) os << " (deferred)"; | 762 if (block->IsDeferred()) os << " (deferred)"; |
| 763 if (!block->needs_frame()) os << " (no frame)"; |
| 764 if (block->must_construct_frame()) os << " (construct frame)"; |
| 765 if (block->must_deconstruct_frame()) os << " (deconstruct frame)"; |
763 if (block->IsLoopHeader()) { | 766 if (block->IsLoopHeader()) { |
764 os << " loop blocks: [" << block->rpo_number() << ", " | 767 os << " loop blocks: [" << block->rpo_number() << ", " |
765 << block->loop_end() << ")"; | 768 << block->loop_end() << ")"; |
766 } | 769 } |
767 os << " instructions: [" << block->code_start() << ", " | 770 os << " instructions: [" << block->code_start() << ", " |
768 << block->code_end() << ")\n predecessors:"; | 771 << block->code_end() << ")\n predecessors:"; |
769 | 772 |
770 for (auto pred : block->predecessors()) { | 773 for (auto pred : block->predecessors()) { |
771 os << " B" << pred.ToInt(); | 774 os << " B" << pred.ToInt(); |
772 } | 775 } |
(...skipping 24 matching lines...) Expand all Loading... |
797 os << " B" << succ.ToInt(); | 800 os << " B" << succ.ToInt(); |
798 } | 801 } |
799 os << "\n"; | 802 os << "\n"; |
800 } | 803 } |
801 return os; | 804 return os; |
802 } | 805 } |
803 | 806 |
804 } // namespace compiler | 807 } // namespace compiler |
805 } // namespace internal | 808 } // namespace internal |
806 } // namespace v8 | 809 } // namespace v8 |
OLD | NEW |