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

Side by Side Diff: src/assembler.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 unified diff | Download patch
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/compiler/graph-visualizer.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 namespace v8 { 105 namespace v8 {
106 namespace internal { 106 namespace internal {
107 107
108 // ----------------------------------------------------------------------------- 108 // -----------------------------------------------------------------------------
109 // Common register code. 109 // Common register code.
110 110
111 const char* Register::ToString() { 111 const char* Register::ToString() {
112 // This is the mapping of allocation indices to registers. 112 // This is the mapping of allocation indices to registers.
113 DCHECK(reg_code >= 0 && reg_code < kNumRegisters); 113 DCHECK(reg_code >= 0 && reg_code < kNumRegisters);
114 return RegisterConfiguration::ArchDefault()->GetGeneralRegisterName(reg_code); 114 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT)
115 ->GetGeneralRegisterName(reg_code);
115 } 116 }
116 117
117 118
118 bool Register::IsAllocatable() const { 119 bool Register::IsAllocatable() const {
119 return ((1 << reg_code) & 120 return ((1 << reg_code) &
120 RegisterConfiguration::ArchDefault() 121 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT)
121 ->allocatable_general_codes_mask()) != 0; 122 ->allocatable_general_codes_mask()) != 0;
122 } 123 }
123 124
124 125
125 const char* DoubleRegister::ToString() { 126 const char* DoubleRegister::ToString() {
126 // This is the mapping of allocation indices to registers. 127 // This is the mapping of allocation indices to registers.
127 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters); 128 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters);
128 return RegisterConfiguration::ArchDefault()->GetDoubleRegisterName(reg_code); 129 return RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT)
130 ->GetDoubleRegisterName(reg_code);
129 } 131 }
130 132
131 133
132 bool DoubleRegister::IsAllocatable() const { 134 bool DoubleRegister::IsAllocatable() const {
133 return ((1 << reg_code) & 135 return ((1 << reg_code) &
134 RegisterConfiguration::ArchDefault() 136 RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT)
135 ->allocatable_double_codes_mask()) != 0; 137 ->allocatable_double_codes_mask()) != 0;
136 } 138 }
137 139
138 140
139 // ----------------------------------------------------------------------------- 141 // -----------------------------------------------------------------------------
140 // Common double constants. 142 // Common double constants.
141 143
142 struct DoubleConstant BASE_EMBEDDED { 144 struct DoubleConstant BASE_EMBEDDED {
143 double min_int; 145 double min_int;
144 double one_half; 146 double one_half;
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 1892
1891 1893
1892 void Assembler::DataAlign(int m) { 1894 void Assembler::DataAlign(int m) {
1893 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1895 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1894 while ((pc_offset() & (m - 1)) != 0) { 1896 while ((pc_offset() & (m - 1)) != 0) {
1895 db(0); 1897 db(0);
1896 } 1898 }
1897 } 1899 }
1898 } // namespace internal 1900 } // namespace internal
1899 } // namespace v8 1901 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698