| 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/graph-visualizer.h" | 5 #include "src/compiler/graph-visualizer.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "src/compiler/generic-algorithm.h" | 10 #include "src/compiler/generic-algorithm.h" |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 586 |
| 587 PrintIndent(); | 587 PrintIndent(); |
| 588 os_ << "flags\n"; | 588 os_ << "flags\n"; |
| 589 | 589 |
| 590 if (current->dominator() != NULL) { | 590 if (current->dominator() != NULL) { |
| 591 PrintBlockProperty("dominator", current->dominator()->id()); | 591 PrintBlockProperty("dominator", current->dominator()->id()); |
| 592 } | 592 } |
| 593 | 593 |
| 594 PrintIntProperty("loop_depth", current->loop_depth()); | 594 PrintIntProperty("loop_depth", current->loop_depth()); |
| 595 | 595 |
| 596 if (instructions->code_start(current) >= 0) { | 596 const InstructionBlock* instruction_block = |
| 597 int first_index = instructions->first_instruction_index(current); | 597 instructions->InstructionBlockAt(current->GetRpoNumber()); |
| 598 int last_index = instructions->last_instruction_index(current); | 598 if (instruction_block->code_start() >= 0) { |
| 599 int first_index = instruction_block->first_instruction_index(); |
| 600 int last_index = instruction_block->last_instruction_index(); |
| 599 PrintIntProperty("first_lir_id", LifetimePosition::FromInstructionIndex( | 601 PrintIntProperty("first_lir_id", LifetimePosition::FromInstructionIndex( |
| 600 first_index).Value()); | 602 first_index).Value()); |
| 601 PrintIntProperty("last_lir_id", LifetimePosition::FromInstructionIndex( | 603 PrintIntProperty("last_lir_id", LifetimePosition::FromInstructionIndex( |
| 602 last_index).Value()); | 604 last_index).Value()); |
| 603 } | 605 } |
| 604 | 606 |
| 605 { | 607 { |
| 606 Tag states_tag(this, "states"); | 608 Tag states_tag(this, "states"); |
| 607 Tag locals_tag(this, "locals"); | 609 Tag locals_tag(this, "locals"); |
| 608 int total = 0; | 610 int total = 0; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 if (FLAG_trace_turbo_types && current->control_input() != NULL) { | 669 if (FLAG_trace_turbo_types && current->control_input() != NULL) { |
| 668 os_ << " "; | 670 os_ << " "; |
| 669 PrintType(current->control_input()); | 671 PrintType(current->control_input()); |
| 670 } | 672 } |
| 671 os_ << " <|@\n"; | 673 os_ << " <|@\n"; |
| 672 } | 674 } |
| 673 } | 675 } |
| 674 | 676 |
| 675 if (instructions != NULL) { | 677 if (instructions != NULL) { |
| 676 Tag LIR_tag(this, "LIR"); | 678 Tag LIR_tag(this, "LIR"); |
| 677 for (int j = instructions->first_instruction_index(current); | 679 for (int j = instruction_block->first_instruction_index(); |
| 678 j <= instructions->last_instruction_index(current); j++) { | 680 j <= instruction_block->last_instruction_index(); j++) { |
| 679 PrintIndent(); | 681 PrintIndent(); |
| 680 os_ << j << " " << *instructions->InstructionAt(j) << " <|@\n"; | 682 os_ << j << " " << *instructions->InstructionAt(j) << " <|@\n"; |
| 681 } | 683 } |
| 682 } | 684 } |
| 683 } | 685 } |
| 684 } | 686 } |
| 685 | 687 |
| 686 | 688 |
| 687 void GraphC1Visualizer::PrintAllocator(const char* phase, | 689 void GraphC1Visualizer::PrintAllocator(const char* phase, |
| 688 const RegisterAllocator* allocator) { | 690 const RegisterAllocator* allocator) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 781 |
| 780 | 782 |
| 781 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac) { | 783 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac) { |
| 782 Zone tmp_zone(ac.allocator_->code()->zone()->isolate()); | 784 Zone tmp_zone(ac.allocator_->code()->zone()->isolate()); |
| 783 GraphC1Visualizer(os, &tmp_zone).PrintAllocator(ac.phase_, ac.allocator_); | 785 GraphC1Visualizer(os, &tmp_zone).PrintAllocator(ac.phase_, ac.allocator_); |
| 784 return os; | 786 return os; |
| 785 } | 787 } |
| 786 } | 788 } |
| 787 } | 789 } |
| 788 } // namespace v8::internal::compiler | 790 } // namespace v8::internal::compiler |
| OLD | NEW |