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