| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/register-configuration.h" | 5 #include "src/register-configuration.h" |
| 6 #include "src/globals.h" | 6 #include "src/globals.h" |
| 7 #include "src/macro-assembler.h" | 7 #include "src/macro-assembler.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 static const char* const kDoubleRegisterNames[] = { | 36 static const char* const kDoubleRegisterNames[] = { |
| 37 #define REGISTER_NAME(R) #R, | 37 #define REGISTER_NAME(R) #R, |
| 38 DOUBLE_REGISTERS(REGISTER_NAME) | 38 DOUBLE_REGISTERS(REGISTER_NAME) |
| 39 #undef REGISTER_NAME | 39 #undef REGISTER_NAME |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 STATIC_ASSERT(RegisterConfiguration::kMaxGeneralRegisters >= | 42 STATIC_ASSERT(RegisterConfiguration::kMaxGeneralRegisters >= |
| 43 Register::kNumRegisters); | 43 Register::kNumRegisters); |
| 44 STATIC_ASSERT(RegisterConfiguration::kMaxDoubleRegisters >= | 44 STATIC_ASSERT(RegisterConfiguration::kMaxFPRegisters >= |
| 45 DoubleRegister::kMaxNumRegisters); | 45 DoubleRegister::kMaxNumRegisters); |
| 46 | 46 |
| 47 class ArchDefaultRegisterConfiguration : public RegisterConfiguration { | 47 class ArchDefaultRegisterConfiguration : public RegisterConfiguration { |
| 48 public: | 48 public: |
| 49 explicit ArchDefaultRegisterConfiguration(CompilerSelector compiler) | 49 explicit ArchDefaultRegisterConfiguration(CompilerSelector compiler) |
| 50 : RegisterConfiguration(Register::kNumRegisters, | 50 : RegisterConfiguration(Register::kNumRegisters, |
| 51 DoubleRegister::kMaxNumRegisters, | 51 DoubleRegister::kMaxNumRegisters, |
| 52 #if V8_TARGET_ARCH_IA32 | 52 #if V8_TARGET_ARCH_IA32 |
| 53 kMaxAllocatableGeneralRegisterCount, | 53 kMaxAllocatableGeneralRegisterCount, |
| 54 kMaxAllocatableDoubleRegisterCount, | 54 kMaxAllocatableDoubleRegisterCount, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 num_allocatable_general_registers_(num_allocatable_general_registers), | 145 num_allocatable_general_registers_(num_allocatable_general_registers), |
| 146 num_allocatable_double_registers_(num_allocatable_double_registers), | 146 num_allocatable_double_registers_(num_allocatable_double_registers), |
| 147 num_allocatable_aliased_double_registers_( | 147 num_allocatable_aliased_double_registers_( |
| 148 num_allocatable_aliased_double_registers), | 148 num_allocatable_aliased_double_registers), |
| 149 allocatable_general_codes_mask_(0), | 149 allocatable_general_codes_mask_(0), |
| 150 allocatable_double_codes_mask_(0), | 150 allocatable_double_codes_mask_(0), |
| 151 allocatable_general_codes_(allocatable_general_codes), | 151 allocatable_general_codes_(allocatable_general_codes), |
| 152 allocatable_double_codes_(allocatable_double_codes), | 152 allocatable_double_codes_(allocatable_double_codes), |
| 153 general_register_names_(general_register_names), | 153 general_register_names_(general_register_names), |
| 154 double_register_names_(double_register_names) { | 154 double_register_names_(double_register_names) { |
| 155 DCHECK(num_general_registers_ <= RegisterConfiguration::kMaxGeneralRegisters); |
| 156 DCHECK(num_double_registers_ <= RegisterConfiguration::kMaxFPRegisters); |
| 155 for (int i = 0; i < num_allocatable_general_registers_; ++i) { | 157 for (int i = 0; i < num_allocatable_general_registers_; ++i) { |
| 156 allocatable_general_codes_mask_ |= (1 << allocatable_general_codes_[i]); | 158 allocatable_general_codes_mask_ |= (1 << allocatable_general_codes_[i]); |
| 157 } | 159 } |
| 158 for (int i = 0; i < num_allocatable_double_registers_; ++i) { | 160 for (int i = 0; i < num_allocatable_double_registers_; ++i) { |
| 159 allocatable_double_codes_mask_ |= (1 << allocatable_double_codes_[i]); | 161 allocatable_double_codes_mask_ |= (1 << allocatable_double_codes_[i]); |
| 160 } | 162 } |
| 161 } | 163 } |
| 162 | 164 |
| 163 #undef REGISTER_COUNT | 165 #undef REGISTER_COUNT |
| 164 | 166 |
| 165 } // namespace internal | 167 } // namespace internal |
| 166 } // namespace v8 | 168 } // namespace v8 |
| OLD | NEW |