Index: src/register-configuration.cc |
diff --git a/src/register-configuration.cc b/src/register-configuration.cc |
index 084e735af1e9c2346af612984f4b9cdb2ac769e5..f832967a3c18a161d86d10d44ff8671fc3e127f8 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(CompilerSelector compiler) |
: RegisterConfiguration( |
Register::kNumRegisters, DoubleRegister::kMaxNumRegisters, |
#if V8_TARGET_ARCH_IA32 |
@@ -104,16 +104,35 @@ class ArchDefaultRegisterConfiguration : public RegisterConfiguration { |
}; |
-static base::LazyInstance<ArchDefaultRegisterConfiguration>::type |
- kDefaultRegisterConfiguration = LAZY_INSTANCE_INITIALIZER; |
+template <RegisterConfiguration::CompilerSelector compiler> |
+struct RegisterConfigurationInitializer { |
+ static void Construct(ArchDefaultRegisterConfiguration* config) { |
+ new (config) ArchDefaultRegisterConfiguration(compiler); |
+ } |
+}; |
+ |
+static base::LazyInstance< |
+ ArchDefaultRegisterConfiguration, |
+ RegisterConfigurationInitializer<RegisterConfiguration::CRANKSHAFT>>::type |
+ kDefaultRegisterConfigurationForCrankshaft = LAZY_INSTANCE_INITIALIZER; |
+ |
+ |
+static base::LazyInstance< |
+ ArchDefaultRegisterConfiguration, |
+ RegisterConfigurationInitializer<RegisterConfiguration::TURBOFAN>>::type |
+ kDefaultRegisterConfigurationForTurboFan = LAZY_INSTANCE_INITIALIZER; |
} // namespace |
-const RegisterConfiguration* RegisterConfiguration::ArchDefault() { |
- return &kDefaultRegisterConfiguration.Get(); |
+const RegisterConfiguration* RegisterConfiguration::ArchDefault( |
+ CompilerSelector 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, |