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

Side by Side Diff: src/compiler/register-configuration.cc

Issue 694313002: [turbofan] add RegisterConfiguration to decouple arch specific register layouts from compiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/register-configuration.h ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/compiler/register-configuration.h"
6 #include "src/macro-assembler.h"
7
8 namespace v8 {
9 namespace internal {
10 namespace compiler {
11
12 namespace {
13
14 STATIC_ASSERT(RegisterConfiguration::kMaxGeneralRegisters >=
15 Register::kNumRegisters);
16 STATIC_ASSERT(RegisterConfiguration::kMaxDoubleRegisters >=
17 DoubleRegister::kMaxNumRegisters);
18
19 class ArchDefaultRegisterConfiguration : public RegisterConfiguration {
20 public:
21 ArchDefaultRegisterConfiguration()
22 : RegisterConfiguration(Register::kMaxNumAllocatableRegisters,
23 DoubleRegister::kMaxNumAllocatableRegisters,
24 DoubleRegister::NumAllocatableAliasedRegisters(),
25 general_register_name_table_,
26 double_register_name_table_) {
27 DCHECK_EQ(Register::kMaxNumAllocatableRegisters,
28 Register::NumAllocatableRegisters());
29 for (int i = 0; i < Register::kMaxNumAllocatableRegisters; ++i) {
30 general_register_name_table_[i] = Register::AllocationIndexToString(i);
31 }
32 for (int i = 0; i < DoubleRegister::kMaxNumAllocatableRegisters; ++i) {
33 double_register_name_table_[i] =
34 DoubleRegister::AllocationIndexToString(i);
35 }
36 }
37
38 const char*
39 general_register_name_table_[Register::kMaxNumAllocatableRegisters];
40 const char*
41 double_register_name_table_[DoubleRegister::kMaxNumAllocatableRegisters];
42 };
43
44
45 static base::LazyInstance<ArchDefaultRegisterConfiguration>::type
46 kDefaultRegisterConfiguration = LAZY_INSTANCE_INITIALIZER;
47
48 } // namepace
49
50
51 const RegisterConfiguration* RegisterConfiguration::ArchDefault() {
52 return &kDefaultRegisterConfiguration.Get();
53 }
54
55 RegisterConfiguration::RegisterConfiguration(
56 int num_general_registers, int num_double_registers,
57 int num_aliased_double_registers, const char* const* general_register_names,
58 const char* const* double_register_names)
59 : num_general_registers_(num_general_registers),
60 num_double_registers_(num_double_registers),
61 num_aliased_double_registers_(num_aliased_double_registers),
62 general_register_names_(general_register_names),
63 double_register_names_(double_register_names) {}
64
65
66 } // namespace compiler
67 } // namespace internal
68 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/register-configuration.h ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698