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

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

Issue 1230473006: [turbofan] Use NumAllocatableRegisters() instead of kMaxNumAllocatableRegisters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 24 #if V8_TARGET_ARCH_X87
25 1, 25 1,
26 1, 26 1,
27 #else 27 #else
28 DoubleRegister::kMaxNumAllocatableRegisters, 28 DoubleRegister::NumAllocatableRegisters(),
29 DoubleRegister::NumAllocatableAliasedRegisters(), 29 DoubleRegister::NumAllocatableAliasedRegisters(),
30 #endif 30 #endif
31 general_register_name_table_, 31 general_register_name_table_,
32 double_register_name_table_) { 32 double_register_name_table_) {
33 DCHECK_EQ(Register::kMaxNumAllocatableRegisters, 33 DCHECK_EQ(Register::kMaxNumAllocatableRegisters,
34 Register::NumAllocatableRegisters()); 34 Register::NumAllocatableRegisters());
35 for (int i = 0; i < Register::kMaxNumAllocatableRegisters; ++i) { 35 for (int i = 0; i < Register::kMaxNumAllocatableRegisters; ++i) {
36 general_register_name_table_[i] = Register::AllocationIndexToString(i); 36 general_register_name_table_[i] = Register::AllocationIndexToString(i);
37 } 37 }
38 for (int i = 0; i < DoubleRegister::kMaxNumAllocatableRegisters; ++i) { 38 DCHECK_GE(DoubleRegister::kMaxNumAllocatableRegisters,
39 DoubleRegister::NumAllocatableRegisters());
40 for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); ++i) {
39 double_register_name_table_[i] = 41 double_register_name_table_[i] =
40 DoubleRegister::AllocationIndexToString(i); 42 DoubleRegister::AllocationIndexToString(i);
41 } 43 }
42 } 44 }
43 45
44 const char* 46 const char*
45 general_register_name_table_[Register::kMaxNumAllocatableRegisters]; 47 general_register_name_table_[Register::kMaxNumAllocatableRegisters];
46 const char* 48 const char*
47 double_register_name_table_[DoubleRegister::kMaxNumAllocatableRegisters]; 49 double_register_name_table_[DoubleRegister::kMaxNumAllocatableRegisters];
48 }; 50 };
(...skipping 16 matching lines...) Expand all
65 : num_general_registers_(num_general_registers), 67 : num_general_registers_(num_general_registers),
66 num_double_registers_(num_double_registers), 68 num_double_registers_(num_double_registers),
67 num_aliased_double_registers_(num_aliased_double_registers), 69 num_aliased_double_registers_(num_aliased_double_registers),
68 general_register_names_(general_register_names), 70 general_register_names_(general_register_names),
69 double_register_names_(double_register_names) {} 71 double_register_names_(double_register_names) {}
70 72
71 73
72 } // namespace compiler 74 } // namespace compiler
73 } // namespace internal 75 } // namespace internal
74 } // namespace v8 76 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698