Chromium Code Reviews

Side by Side Diff: src/compiler/graph-visualizer.cc

Issue 1287383003: Re-reland: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Updated to ToT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 708 matching lines...)
719 } 719 }
720 720
721 721
722 void GraphC1Visualizer::PrintLiveRange(LiveRange* range, const char* type, 722 void GraphC1Visualizer::PrintLiveRange(LiveRange* range, const char* type,
723 int vreg) { 723 int vreg) {
724 if (range != NULL && !range->IsEmpty()) { 724 if (range != NULL && !range->IsEmpty()) {
725 PrintIndent(); 725 PrintIndent();
726 os_ << vreg << ":" << range->relative_id() << " " << type; 726 os_ << vreg << ":" << range->relative_id() << " " << type;
727 if (range->HasRegisterAssigned()) { 727 if (range->HasRegisterAssigned()) {
728 AllocatedOperand op = AllocatedOperand::cast(range->GetAssignedOperand()); 728 AllocatedOperand op = AllocatedOperand::cast(range->GetAssignedOperand());
729 int assigned_reg = op.index();
730 if (op.IsDoubleRegister()) { 729 if (op.IsDoubleRegister()) {
731 os_ << " \"" << DoubleRegister::AllocationIndexToString(assigned_reg) 730 DoubleRegister assigned_reg = op.GetDoubleRegister();
732 << "\""; 731 os_ << " \"" << assigned_reg.ToString() << "\"";
733 } else { 732 } else {
734 DCHECK(op.IsRegister()); 733 DCHECK(op.IsRegister());
735 os_ << " \"" << Register::AllocationIndexToString(assigned_reg) << "\""; 734 Register assigned_reg = op.GetRegister();
735 os_ << " \"" << assigned_reg.ToString() << "\"";
736 } 736 }
737 } else if (range->spilled()) { 737 } else if (range->spilled()) {
738 auto top = range->TopLevel(); 738 auto top = range->TopLevel();
739 int index = -1; 739 int index = -1;
740 if (top->HasSpillRange()) { 740 if (top->HasSpillRange()) {
741 index = kMaxInt; // This hasn't been set yet. 741 index = kMaxInt; // This hasn't been set yet.
742 } else if (top->GetSpillOperand()->IsConstant()) { 742 } else if (top->GetSpillOperand()->IsConstant()) {
743 os_ << " \"const(nostack):" 743 os_ << " \"const(nostack):"
744 << ConstantOperand::cast(top->GetSpillOperand())->virtual_register() 744 << ConstantOperand::cast(top->GetSpillOperand())->virtual_register()
745 << "\""; 745 << "\"";
(...skipping 81 matching lines...)
827 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); 827 os << "#" << SafeId(i) << ":" << SafeMnemonic(i);
828 } 828 }
829 os << ")" << std::endl; 829 os << ")" << std::endl;
830 } 830 }
831 } 831 }
832 return os; 832 return os;
833 } 833 }
834 } // namespace compiler 834 } // namespace compiler
835 } // namespace internal 835 } // namespace internal
836 } // namespace v8 836 } // namespace v8
OLDNEW

Powered by Google App Engine