| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/lithium.h" | 5 #include "src/lithium.h" |
| 6 | 6 |
| 7 #include "src/scopes.h" | 7 #include "src/scopes.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
| 10 #include "src/ia32/lithium-ia32.h" // NOLINT | 10 #include "src/ia32/lithium-ia32.h" // NOLINT |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 stream->Add("v%d", unalloc->virtual_register()); | 49 stream->Add("v%d", unalloc->virtual_register()); |
| 50 if (unalloc->basic_policy() == LUnallocated::FIXED_SLOT) { | 50 if (unalloc->basic_policy() == LUnallocated::FIXED_SLOT) { |
| 51 stream->Add("(=%dS)", unalloc->fixed_slot_index()); | 51 stream->Add("(=%dS)", unalloc->fixed_slot_index()); |
| 52 break; | 52 break; |
| 53 } | 53 } |
| 54 switch (unalloc->extended_policy()) { | 54 switch (unalloc->extended_policy()) { |
| 55 case LUnallocated::NONE: | 55 case LUnallocated::NONE: |
| 56 break; | 56 break; |
| 57 case LUnallocated::FIXED_REGISTER: { | 57 case LUnallocated::FIXED_REGISTER: { |
| 58 int reg_index = unalloc->fixed_register_index(); | 58 int reg_index = unalloc->fixed_register_index(); |
| 59 if (reg_index < 0 || | 59 if (reg_index < 0 || reg_index >= Register::kNumRegisters) { |
| 60 reg_index >= Register::kMaxNumAllocatableRegisters) { | |
| 61 stream->Add("(=invalid_reg#%d)", reg_index); | 60 stream->Add("(=invalid_reg#%d)", reg_index); |
| 62 } else { | 61 } else { |
| 63 const char* register_name = | 62 const char* register_name = |
| 64 Register::AllocationIndexToString(reg_index); | 63 Register::from_code(reg_index).ToString(); |
| 65 stream->Add("(=%s)", register_name); | 64 stream->Add("(=%s)", register_name); |
| 66 } | 65 } |
| 67 break; | 66 break; |
| 68 } | 67 } |
| 69 case LUnallocated::FIXED_DOUBLE_REGISTER: { | 68 case LUnallocated::FIXED_DOUBLE_REGISTER: { |
| 70 int reg_index = unalloc->fixed_register_index(); | 69 int reg_index = unalloc->fixed_register_index(); |
| 71 if (reg_index < 0 || | 70 if (reg_index < 0 || reg_index >= DoubleRegister::kMaxNumRegisters) { |
| 72 reg_index >= DoubleRegister::kMaxNumAllocatableRegisters) { | |
| 73 stream->Add("(=invalid_double_reg#%d)", reg_index); | 71 stream->Add("(=invalid_double_reg#%d)", reg_index); |
| 74 } else { | 72 } else { |
| 75 const char* double_register_name = | 73 const char* double_register_name = |
| 76 DoubleRegister::AllocationIndexToString(reg_index); | 74 DoubleRegister::from_code(reg_index).ToString(); |
| 77 stream->Add("(=%s)", double_register_name); | 75 stream->Add("(=%s)", double_register_name); |
| 78 } | 76 } |
| 79 break; | 77 break; |
| 80 } | 78 } |
| 81 case LUnallocated::MUST_HAVE_REGISTER: | 79 case LUnallocated::MUST_HAVE_REGISTER: |
| 82 stream->Add("(R)"); | 80 stream->Add("(R)"); |
| 83 break; | 81 break; |
| 84 case LUnallocated::MUST_HAVE_DOUBLE_REGISTER: | 82 case LUnallocated::MUST_HAVE_DOUBLE_REGISTER: |
| 85 stream->Add("(D)"); | 83 stream->Add("(D)"); |
| 86 break; | 84 break; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 99 stream->Add("[constant:%d]", index()); | 97 stream->Add("[constant:%d]", index()); |
| 100 break; | 98 break; |
| 101 case STACK_SLOT: | 99 case STACK_SLOT: |
| 102 stream->Add("[stack:%d]", index()); | 100 stream->Add("[stack:%d]", index()); |
| 103 break; | 101 break; |
| 104 case DOUBLE_STACK_SLOT: | 102 case DOUBLE_STACK_SLOT: |
| 105 stream->Add("[double_stack:%d]", index()); | 103 stream->Add("[double_stack:%d]", index()); |
| 106 break; | 104 break; |
| 107 case REGISTER: { | 105 case REGISTER: { |
| 108 int reg_index = index(); | 106 int reg_index = index(); |
| 109 if (reg_index < 0 || reg_index >= Register::kMaxNumAllocatableRegisters) { | 107 if (reg_index < 0 || reg_index >= Register::kNumRegisters) { |
| 110 stream->Add("(=invalid_reg#%d|R)", reg_index); | 108 stream->Add("(=invalid_reg#%d|R)", reg_index); |
| 111 } else { | 109 } else { |
| 112 stream->Add("[%s|R]", Register::AllocationIndexToString(reg_index)); | 110 stream->Add("[%s|R]", Register::from_code(reg_index).ToString()); |
| 113 } | 111 } |
| 114 break; | 112 break; |
| 115 } | 113 } |
| 116 case DOUBLE_REGISTER: { | 114 case DOUBLE_REGISTER: { |
| 117 int reg_index = index(); | 115 int reg_index = index(); |
| 118 if (reg_index < 0 || | 116 if (reg_index < 0 || reg_index >= DoubleRegister::kMaxNumRegisters) { |
| 119 reg_index >= DoubleRegister::kMaxNumAllocatableRegisters) { | |
| 120 stream->Add("(=invalid_double_reg#%d|R)", reg_index); | 117 stream->Add("(=invalid_double_reg#%d|R)", reg_index); |
| 121 } else { | 118 } else { |
| 122 stream->Add("[%s|R]", | 119 stream->Add("[%s|R]", DoubleRegister::from_code(reg_index).ToString()); |
| 123 DoubleRegister::AllocationIndexToString(reg_index)); | |
| 124 } | 120 } |
| 125 break; | 121 break; |
| 126 } | 122 } |
| 127 } | 123 } |
| 128 } | 124 } |
| 129 | 125 |
| 130 | 126 |
| 131 template<LOperand::Kind kOperandKind, int kNumCachedOperands> | 127 template<LOperand::Kind kOperandKind, int kNumCachedOperands> |
| 132 LSubKindOperand<kOperandKind, kNumCachedOperands>* | 128 LSubKindOperand<kOperandKind, kNumCachedOperands>* |
| 133 LSubKindOperand<kOperandKind, kNumCachedOperands>::cache = NULL; | 129 LSubKindOperand<kOperandKind, kNumCachedOperands>::cache = NULL; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 705 |
| 710 LPhase::~LPhase() { | 706 LPhase::~LPhase() { |
| 711 if (ShouldProduceTraceOutput()) { | 707 if (ShouldProduceTraceOutput()) { |
| 712 isolate()->GetHTracer()->TraceLithium(name(), chunk_); | 708 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
| 713 } | 709 } |
| 714 } | 710 } |
| 715 | 711 |
| 716 | 712 |
| 717 } // namespace internal | 713 } // namespace internal |
| 718 } // namespace v8 | 714 } // namespace v8 |
| OLD | NEW |