Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: src/compiler/graph-visualizer.cc

Issue 1050803002: [turbofan] cleanup InstructionOperand a little (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/gap-resolver.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-visualizer.cc
diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc
index 339750985201ee54ff42b54ddefe3b1b885fa0f1..5d255f064ec2c32fce563097778c9f989aab214d 100644
--- a/src/compiler/graph-visualizer.cc
+++ b/src/compiler/graph-visualizer.cc
@@ -708,7 +708,7 @@ void GraphC1Visualizer::PrintLiveRange(LiveRange* range, const char* type) {
PrintIndent();
os_ << range->id() << " " << type;
if (range->HasRegisterAssigned()) {
- InstructionOperand op = range->GetAssignedOperand();
+ AllocatedOperand op = AllocatedOperand::cast(range->GetAssignedOperand());
int assigned_reg = op.index();
if (op.IsDoubleRegister()) {
os_ << " \"" << DoubleRegister::AllocationIndexToString(assigned_reg)
@@ -718,18 +718,21 @@ void GraphC1Visualizer::PrintLiveRange(LiveRange* range, const char* type) {
os_ << " \"" << Register::AllocationIndexToString(assigned_reg) << "\"";
}
} else if (range->IsSpilled()) {
+ auto top = range->TopLevel();
int index = -1;
- if (range->TopLevel()->HasSpillRange()) {
+ if (top->HasSpillRange()) {
index = kMaxInt; // This hasn't been set yet.
+ } else if (top->GetSpillOperand()->IsConstant()) {
+ os_ << " \"const(nostack):"
+ << ConstantOperand::cast(top->GetSpillOperand())->virtual_register()
+ << "\"";
} else {
- index = range->TopLevel()->GetSpillOperand()->index();
- }
- if (range->TopLevel()->Kind() == DOUBLE_REGISTERS) {
- os_ << " \"double_stack:" << index << "\"";
- } else if (range->TopLevel()->Kind() == GENERAL_REGISTERS) {
- os_ << " \"stack:" << index << "\"";
- } else {
- os_ << " \"const(nostack):" << index << "\"";
+ index = AllocatedOperand::cast(top->GetSpillOperand())->index();
+ if (top->Kind() == DOUBLE_REGISTERS) {
+ os_ << " \"double_stack:" << index << "\"";
+ } else if (top->Kind() == GENERAL_REGISTERS) {
+ os_ << " \"stack:" << index << "\"";
+ }
}
}
int parent_index = -1;
« no previous file with comments | « src/compiler/gap-resolver.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698