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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 } | 487 } |
488 os_ << " <|@\n"; | 488 os_ << " <|@\n"; |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 if (instructions != nullptr) { | 492 if (instructions != nullptr) { |
493 Tag LIR_tag(this, "LIR"); | 493 Tag LIR_tag(this, "LIR"); |
494 for (int j = instruction_block->first_instruction_index(); | 494 for (int j = instruction_block->first_instruction_index(); |
495 j <= instruction_block->last_instruction_index(); j++) { | 495 j <= instruction_block->last_instruction_index(); j++) { |
496 PrintIndent(); | 496 PrintIndent(); |
497 PrintableInstruction printable = { | 497 PrintableInstruction printable = {RegisterConfiguration::Turbofan(), |
498 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN), | 498 instructions->InstructionAt(j)}; |
499 instructions->InstructionAt(j)}; | |
500 os_ << j << " " << printable << " <|@\n"; | 499 os_ << j << " " << printable << " <|@\n"; |
501 } | 500 } |
502 } | 501 } |
503 } | 502 } |
504 } | 503 } |
505 | 504 |
506 | 505 |
507 void GraphC1Visualizer::PrintLiveRanges(const char* phase, | 506 void GraphC1Visualizer::PrintLiveRanges(const char* phase, |
508 const RegisterAllocationData* data) { | 507 const RegisterAllocationData* data) { |
509 Tag tag(this, "intervals"); | 508 Tag tag(this, "intervals"); |
(...skipping 22 matching lines...) Expand all Loading... |
532 } | 531 } |
533 } | 532 } |
534 | 533 |
535 void GraphC1Visualizer::PrintLiveRange(const LiveRange* range, const char* type, | 534 void GraphC1Visualizer::PrintLiveRange(const LiveRange* range, const char* type, |
536 int vreg) { | 535 int vreg) { |
537 if (range != nullptr && !range->IsEmpty()) { | 536 if (range != nullptr && !range->IsEmpty()) { |
538 PrintIndent(); | 537 PrintIndent(); |
539 os_ << vreg << ":" << range->relative_id() << " " << type; | 538 os_ << vreg << ":" << range->relative_id() << " " << type; |
540 if (range->HasRegisterAssigned()) { | 539 if (range->HasRegisterAssigned()) { |
541 AllocatedOperand op = AllocatedOperand::cast(range->GetAssignedOperand()); | 540 AllocatedOperand op = AllocatedOperand::cast(range->GetAssignedOperand()); |
| 541 const auto config = RegisterConfiguration::Turbofan(); |
542 if (op.IsRegister()) { | 542 if (op.IsRegister()) { |
543 os_ << " \"" << op.GetRegister().ToString() << "\""; | 543 os_ << " \"" << config->GetGeneralRegisterName(op.register_code()) |
| 544 << "\""; |
544 } else if (op.IsDoubleRegister()) { | 545 } else if (op.IsDoubleRegister()) { |
545 os_ << " \"" << op.GetDoubleRegister().ToString() << "\""; | 546 os_ << " \"" << config->GetDoubleRegisterName(op.register_code()) |
| 547 << "\""; |
546 } else { | 548 } else { |
547 DCHECK(op.IsFloatRegister()); | 549 DCHECK(op.IsFloatRegister()); |
548 os_ << " \"" << op.GetFloatRegister().ToString() << "\""; | 550 os_ << " \"" << config->GetFloatRegisterName(op.register_code()) |
| 551 << "\""; |
549 } | 552 } |
550 } else if (range->spilled()) { | 553 } else if (range->spilled()) { |
551 const TopLevelLiveRange* top = range->TopLevel(); | 554 const TopLevelLiveRange* top = range->TopLevel(); |
552 int index = -1; | 555 int index = -1; |
553 if (top->HasSpillRange()) { | 556 if (top->HasSpillRange()) { |
554 index = kMaxInt; // This hasn't been set yet. | 557 index = kMaxInt; // This hasn't been set yet. |
555 } else if (top->GetSpillOperand()->IsConstant()) { | 558 } else if (top->GetSpillOperand()->IsConstant()) { |
556 os_ << " \"const(nostack):" | 559 os_ << " \"const(nostack):" |
557 << ConstantOperand::cast(top->GetSpillOperand())->virtual_register() | 560 << ConstantOperand::cast(top->GetSpillOperand())->virtual_register() |
558 << "\""; | 561 << "\""; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 os << "]"; | 669 os << "]"; |
667 } | 670 } |
668 os << std::endl; | 671 os << std::endl; |
669 } | 672 } |
670 } | 673 } |
671 return os; | 674 return os; |
672 } | 675 } |
673 } // namespace compiler | 676 } // namespace compiler |
674 } // namespace internal | 677 } // namespace internal |
675 } // namespace v8 | 678 } // namespace v8 |
OLD | NEW |