| Index: src/register-configuration.cc
|
| diff --git a/src/register-configuration.cc b/src/register-configuration.cc
|
| index 084e735af1e9c2346af612984f4b9cdb2ac769e5..99afcc1e5e12685e70d4ad350b820532fee68410 100644
|
| --- a/src/register-configuration.cc
|
| +++ b/src/register-configuration.cc
|
| @@ -36,7 +36,7 @@ STATIC_ASSERT(RegisterConfiguration::kMaxDoubleRegisters >=
|
|
|
| class ArchDefaultRegisterConfiguration : public RegisterConfiguration {
|
| public:
|
| - ArchDefaultRegisterConfiguration()
|
| + explicit ArchDefaultRegisterConfiguration(JITCompiler compiler)
|
| : RegisterConfiguration(
|
| Register::kNumRegisters, DoubleRegister::kMaxNumRegisters,
|
| #if V8_TARGET_ARCH_IA32
|
| @@ -44,7 +44,9 @@ class ArchDefaultRegisterConfiguration : public RegisterConfiguration {
|
| kMaxAllocatableDoubleRegisterCount,
|
| kMaxAllocatableDoubleRegisterCount,
|
| #elif V8_TARGET_ARCH_X87
|
| - kMaxAllocatableGeneralRegisterCount, 1, 1,
|
| + kMaxAllocatableGeneralRegisterCount,
|
| + compiler == TURBOFAN ? 1 : kMaxAllocatableDoubleRegisterCount,
|
| + compiler == TURBOFAN ? 1 : kMaxAllocatableDoubleRegisterCount,
|
| #elif V8_TARGET_ARCH_X64
|
| kMaxAllocatableGeneralRegisterCount,
|
| kMaxAllocatableDoubleRegisterCount,
|
| @@ -104,16 +106,33 @@ class ArchDefaultRegisterConfiguration : public RegisterConfiguration {
|
| };
|
|
|
|
|
| -static base::LazyInstance<ArchDefaultRegisterConfiguration>::type
|
| - kDefaultRegisterConfiguration = LAZY_INSTANCE_INITIALIZER;
|
| +template <JITCompiler compiler>
|
| +struct RegisterConfigurationInitializer {
|
| + static void Construct(ArchDefaultRegisterConfiguration* config) {
|
| + new (config) ArchDefaultRegisterConfiguration(compiler);
|
| + }
|
| +};
|
| +
|
| +static base::LazyInstance<ArchDefaultRegisterConfiguration,
|
| + RegisterConfigurationInitializer<CRANKSHAFT>>::type
|
| + kDefaultRegisterConfigurationForCrankshaft = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +
|
| +static base::LazyInstance<ArchDefaultRegisterConfiguration,
|
| + RegisterConfigurationInitializer<TURBOFAN>>::type
|
| + kDefaultRegisterConfigurationForTurboFan = LAZY_INSTANCE_INITIALIZER;
|
|
|
| } // namespace
|
|
|
|
|
| -const RegisterConfiguration* RegisterConfiguration::ArchDefault() {
|
| - return &kDefaultRegisterConfiguration.Get();
|
| +const RegisterConfiguration* RegisterConfiguration::ArchDefault(
|
| + JITCompiler compiler) {
|
| + return compiler == TURBOFAN
|
| + ? &kDefaultRegisterConfigurationForTurboFan.Get()
|
| + : &kDefaultRegisterConfigurationForCrankshaft.Get();
|
| }
|
|
|
| +
|
| RegisterConfiguration::RegisterConfiguration(
|
| int num_general_registers, int num_double_registers,
|
| int num_allocatable_general_registers, int num_allocatable_double_registers,
|
|
|