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

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

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-allocator.cc ('k') | src/compiler/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
(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 #ifndef V8_COMPILER_REGISTER_CONFIGURATION_H_
6 #define V8_COMPILER_REGISTER_CONFIGURATION_H_
7
8 #include "src/v8.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace compiler {
13
14 // An architecture independent representation of the sets of registers available
15 // for instruction creation.
16 class RegisterConfiguration {
17 public:
18 // Architecture independent maxes.
19 static const int kMaxGeneralRegisters = 32;
20 static const int kMaxDoubleRegisters = 32;
21
22 static const RegisterConfiguration* ArchDefault();
23
24 RegisterConfiguration(int num_general_registers, int num_double_registers,
25 int num_aliased_double_registers,
26 const char* const* general_register_name,
27 const char* const* double_register_name);
28
29 int num_general_registers() const { return num_general_registers_; }
30 int num_double_registers() const { return num_double_registers_; }
31 int num_aliased_double_registers() const {
32 return num_aliased_double_registers_;
33 }
34
35 const char* general_register_name(int offset) const {
36 DCHECK(offset >= 0 && offset < kMaxGeneralRegisters);
37 return general_register_names_[offset];
38 }
39 const char* double_register_name(int offset) const {
40 DCHECK(offset >= 0 && offset < kMaxDoubleRegisters);
41 return double_register_names_[offset];
42 }
43
44 private:
45 const int num_general_registers_;
46 const int num_double_registers_;
47 const int num_aliased_double_registers_;
48 const char* const* general_register_names_;
49 const char* const* double_register_names_;
50 };
51
52 } // namespace compiler
53 } // namespace internal
54 } // namespace v8
55
56 #endif // V8_COMPILER_REGISTER_CONFIGURATION_H_
OLDNEW
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | src/compiler/register-configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698