| 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/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 int assigned_reg = op->index(); | 717 int assigned_reg = op->index(); |
| 718 if (op->IsDoubleRegister()) { | 718 if (op->IsDoubleRegister()) { |
| 719 os_ << " \"" << DoubleRegister::AllocationIndexToString(assigned_reg) | 719 os_ << " \"" << DoubleRegister::AllocationIndexToString(assigned_reg) |
| 720 << "\""; | 720 << "\""; |
| 721 } else { | 721 } else { |
| 722 DCHECK(op->IsRegister()); | 722 DCHECK(op->IsRegister()); |
| 723 os_ << " \"" << Register::AllocationIndexToString(assigned_reg) << "\""; | 723 os_ << " \"" << Register::AllocationIndexToString(assigned_reg) << "\""; |
| 724 } | 724 } |
| 725 } else if (range->IsSpilled()) { | 725 } else if (range->IsSpilled()) { |
| 726 int index = -1; | 726 int index = -1; |
| 727 if (range->TopLevel()->GetSpillRange()->id() != -1) { | 727 if (range->TopLevel()->GetSpillRange() != nullptr && |
| 728 range->TopLevel()->GetSpillRange()->id() != -1) { |
| 728 index = range->TopLevel()->GetSpillRange()->id(); | 729 index = range->TopLevel()->GetSpillRange()->id(); |
| 729 } else { | 730 } else { |
| 730 index = range->TopLevel()->GetSpillOperand()->index(); | 731 index = range->TopLevel()->GetSpillOperand()->index(); |
| 731 } | 732 } |
| 732 if (range->TopLevel()->Kind() == DOUBLE_REGISTERS) { | 733 if (range->TopLevel()->Kind() == DOUBLE_REGISTERS) { |
| 733 os_ << " \"double_stack:" << index << "\""; | 734 os_ << " \"double_stack:" << index << "\""; |
| 734 } else if (range->TopLevel()->Kind() == GENERAL_REGISTERS) { | 735 } else if (range->TopLevel()->Kind() == GENERAL_REGISTERS) { |
| 735 os_ << " \"stack:" << index << "\""; | 736 os_ << " \"stack:" << index << "\""; |
| 736 } else { | 737 } else { |
| 737 os_ << " \"const(nostack):" << index << "\""; | 738 os_ << " \"const(nostack):" << index << "\""; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 | 786 |
| 786 | 787 |
| 787 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac) { | 788 std::ostream& operator<<(std::ostream& os, const AsC1VAllocator& ac) { |
| 788 Zone tmp_zone(ac.allocator_->code()->zone()->isolate()); | 789 Zone tmp_zone(ac.allocator_->code()->zone()->isolate()); |
| 789 GraphC1Visualizer(os, &tmp_zone).PrintAllocator(ac.phase_, ac.allocator_); | 790 GraphC1Visualizer(os, &tmp_zone).PrintAllocator(ac.phase_, ac.allocator_); |
| 790 return os; | 791 return os; |
| 791 } | 792 } |
| 792 } | 793 } |
| 793 } | 794 } |
| 794 } // namespace v8::internal::compiler | 795 } // namespace v8::internal::compiler |
| OLD | NEW |