Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: src/register-configuration.cc

Issue 1405673003: provides a mechanism for optimizing compilers to select the different Register configuration. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add the TODO comments. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/register-configuration.h ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/register-configuration.h ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698