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/compiler/register-configuration.h" | 5 #include "src/compiler/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 { |
11 namespace compiler { | 11 namespace compiler { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 STATIC_ASSERT(RegisterConfiguration::kMaxGeneralRegisters >= | 15 STATIC_ASSERT(RegisterConfiguration::kMaxGeneralRegisters >= |
16 Register::kNumRegisters); | 16 Register::kNumRegisters); |
17 STATIC_ASSERT(RegisterConfiguration::kMaxDoubleRegisters >= | 17 STATIC_ASSERT(RegisterConfiguration::kMaxDoubleRegisters >= |
18 DoubleRegister::kMaxNumRegisters); | 18 DoubleRegister::kMaxNumRegisters); |
19 | 19 |
20 class ArchDefaultRegisterConfiguration : public RegisterConfiguration { | 20 class ArchDefaultRegisterConfiguration : public RegisterConfiguration { |
21 public: | 21 public: |
22 ArchDefaultRegisterConfiguration() | 22 ArchDefaultRegisterConfiguration() |
23 : RegisterConfiguration(Register::kMaxNumAllocatableRegisters, | 23 : RegisterConfiguration(Register::kMaxNumAllocatableRegisters, |
| 24 #if V8_TARGET_ARCH_X87 |
| 25 1, |
| 26 1, |
| 27 #else |
24 DoubleRegister::kMaxNumAllocatableRegisters, | 28 DoubleRegister::kMaxNumAllocatableRegisters, |
25 DoubleRegister::NumAllocatableAliasedRegisters(), | 29 DoubleRegister::NumAllocatableAliasedRegisters(), |
| 30 #endif |
26 general_register_name_table_, | 31 general_register_name_table_, |
27 double_register_name_table_) { | 32 double_register_name_table_) { |
28 DCHECK_EQ(Register::kMaxNumAllocatableRegisters, | 33 DCHECK_EQ(Register::kMaxNumAllocatableRegisters, |
29 Register::NumAllocatableRegisters()); | 34 Register::NumAllocatableRegisters()); |
30 for (int i = 0; i < Register::kMaxNumAllocatableRegisters; ++i) { | 35 for (int i = 0; i < Register::kMaxNumAllocatableRegisters; ++i) { |
31 general_register_name_table_[i] = Register::AllocationIndexToString(i); | 36 general_register_name_table_[i] = Register::AllocationIndexToString(i); |
32 } | 37 } |
33 for (int i = 0; i < DoubleRegister::kMaxNumAllocatableRegisters; ++i) { | 38 for (int i = 0; i < DoubleRegister::kMaxNumAllocatableRegisters; ++i) { |
34 double_register_name_table_[i] = | 39 double_register_name_table_[i] = |
35 DoubleRegister::AllocationIndexToString(i); | 40 DoubleRegister::AllocationIndexToString(i); |
(...skipping 24 matching lines...) Expand all Loading... |
60 : num_general_registers_(num_general_registers), | 65 : num_general_registers_(num_general_registers), |
61 num_double_registers_(num_double_registers), | 66 num_double_registers_(num_double_registers), |
62 num_aliased_double_registers_(num_aliased_double_registers), | 67 num_aliased_double_registers_(num_aliased_double_registers), |
63 general_register_names_(general_register_names), | 68 general_register_names_(general_register_names), |
64 double_register_names_(double_register_names) {} | 69 double_register_names_(double_register_names) {} |
65 | 70 |
66 | 71 |
67 } // namespace compiler | 72 } // namespace compiler |
68 } // namespace internal | 73 } // namespace internal |
69 } // namespace v8 | 74 } // namespace v8 |
OLD | NEW |