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

Side by Side Diff: src/register-configuration.h

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: 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 unified diff | Download patch
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | src/register-configuration.cc » ('j') | 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 #ifndef V8_COMPILER_REGISTER_CONFIGURATION_H_ 5 #ifndef V8_COMPILER_REGISTER_CONFIGURATION_H_
6 #define V8_COMPILER_REGISTER_CONFIGURATION_H_ 6 #define V8_COMPILER_REGISTER_CONFIGURATION_H_
7 7
8 #include "src/base/macros.h" 8 #include "src/base/macros.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 16 matching lines...) Expand all
27 const int* allocatable_general_codes, 27 const int* allocatable_general_codes,
28 const int* allocatable_double_codes, 28 const int* allocatable_double_codes,
29 char const* const* general_names, 29 char const* const* general_names,
30 char const* const* double_names); 30 char const* const* double_names);
31 31
32 int num_general_registers() const { return num_general_registers_; } 32 int num_general_registers() const { return num_general_registers_; }
33 int num_double_registers() const { return num_double_registers_; } 33 int num_double_registers() const { return num_double_registers_; }
34 int num_allocatable_general_registers() const { 34 int num_allocatable_general_registers() const {
35 return num_allocatable_general_registers_; 35 return num_allocatable_general_registers_;
36 } 36 }
37 int num_allocatable_double_registers() const { 37 int num_allocatable_double_registers(bool for_turbo = false) const {
38 #if V8_TARGET_ARCH_X87
titzer 2015/10/15 16:44:43 Seems like this check should be moved to the ArchD
39 // TODO(X87): Currently Trubofan for X87 uses only one double register.
40 // But crankshaft for X87 has to use more than 1 double register. We
41 // use this temporary solution to return different allocatable double
42 // register number for different compilers and we will unify the number
43 // Turbofan and Crankshaft.
44 return for_turbo ? 1 : num_allocatable_double_registers_;
45 #endif
38 return num_allocatable_double_registers_; 46 return num_allocatable_double_registers_;
39 } 47 }
40 // TODO(turbofan): This is a temporary work-around required because our 48 // TODO(turbofan): This is a temporary work-around required because our
41 // register allocator does not yet support the aliasing of single/double 49 // register allocator does not yet support the aliasing of single/double
42 // registers on ARM. 50 // registers on ARM.
43 int num_allocatable_aliased_double_registers() const { 51 int num_allocatable_aliased_double_registers(bool for_turbo = false) const {
52 #if V8_TARGET_ARCH_X87
53 // Same reason as num_allocatable_double_registers() function.
54 return for_turbo ? 1 : num_allocatable_aliased_double_registers_;
55 #endif
44 return num_allocatable_aliased_double_registers_; 56 return num_allocatable_aliased_double_registers_;
45 } 57 }
46 int32_t allocatable_general_codes_mask() const { 58 int32_t allocatable_general_codes_mask() const {
47 return allocatable_general_codes_mask_; 59 return allocatable_general_codes_mask_;
48 } 60 }
49 int32_t allocatable_double_codes_mask() const { 61 int32_t allocatable_double_codes_mask() const {
50 return allocatable_double_codes_mask_; 62 return allocatable_double_codes_mask_;
51 } 63 }
52 int GetAllocatableGeneralCode(int index) const { 64 int GetAllocatableGeneralCode(int index) const {
53 return allocatable_general_codes_[index]; 65 return allocatable_general_codes_[index];
(...skipping 25 matching lines...) Expand all
79 const int* allocatable_general_codes_; 91 const int* allocatable_general_codes_;
80 const int* allocatable_double_codes_; 92 const int* allocatable_double_codes_;
81 char const* const* general_register_names_; 93 char const* const* general_register_names_;
82 char const* const* double_register_names_; 94 char const* const* double_register_names_;
83 }; 95 };
84 96
85 } // namespace internal 97 } // namespace internal
86 } // namespace v8 98 } // namespace v8
87 99
88 #endif // V8_COMPILER_REGISTER_CONFIGURATION_H_ 100 #endif // V8_COMPILER_REGISTER_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | src/register-configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698