OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 #include <set> | 41 #include <set> |
42 | 42 |
43 #include "src/assembler.h" | 43 #include "src/assembler.h" |
44 #include "src/compiler.h" | 44 #include "src/compiler.h" |
45 #include "src/mips/constants-mips.h" | 45 #include "src/mips/constants-mips.h" |
46 | 46 |
47 namespace v8 { | 47 namespace v8 { |
48 namespace internal { | 48 namespace internal { |
49 | 49 |
| 50 // clang-format off |
| 51 #define GENERAL_REGISTERS(V) \ |
| 52 V(zero_reg) V(at) V(v0) V(v1) V(a0) V(a1) V(a2) V(a3) \ |
| 53 V(t0) V(t1) V(t2) V(t3) V(t4) V(t5) V(t6) V(t7) \ |
| 54 V(s0) V(s1) V(s2) V(s3) V(s4) V(s5) V(s6) V(s7) V(t8) V(t9) \ |
| 55 V(k0) V(k1) V(gp) V(sp) V(fp) V(ra) |
| 56 |
| 57 #define ALLOCATABLE_GENERAL_REGISTERS(V) \ |
| 58 V(v0) V(v1) V(a0) V(a1) V(a2) V(a3) \ |
| 59 V(t0) V(t1) V(t2) V(t3) V(t4) V(t5) V(t6) V(s7) |
| 60 |
| 61 #define DOUBLE_REGISTERS(V) \ |
| 62 V(f0) V(f1) V(f2) V(f3) V(f4) V(f5) V(f6) V(f7) \ |
| 63 V(f8) V(f9) V(f10) V(f11) V(f12) V(f13) V(f14) V(f15) \ |
| 64 V(f16) V(f17) V(f18) V(f19) V(f20) V(f21) V(f22) V(f23) \ |
| 65 V(f24) V(f25) V(f26) V(f27) V(f28) V(f29) V(f30) V(f31) |
| 66 |
| 67 #define ALLOCATABLE_DOUBLE_REGISTERS(V) \ |
| 68 V(f0) V(f2) V(f4) V(f6) V(f8) V(f10) V(f12) V(f14) \ |
| 69 V(f16) V(f18) V(f20) V(f22) V(f24) V(f26) |
| 70 // clang-format on |
| 71 |
50 // CPU Registers. | 72 // CPU Registers. |
51 // | 73 // |
52 // 1) We would prefer to use an enum, but enum values are assignment- | 74 // 1) We would prefer to use an enum, but enum values are assignment- |
53 // compatible with int, which has caused code-generation bugs. | 75 // compatible with int, which has caused code-generation bugs. |
54 // | 76 // |
55 // 2) We would prefer to use a class instead of a struct but we don't like | 77 // 2) We would prefer to use a class instead of a struct but we don't like |
56 // the register initialization to depend on the particular initialization | 78 // the register initialization to depend on the particular initialization |
57 // order (which appears to be different on OS X, Linux, and Windows for the | 79 // order (which appears to be different on OS X, Linux, and Windows for the |
58 // installed versions of C++ we tried). Using a struct permits C-style | 80 // installed versions of C++ we tried). Using a struct permits C-style |
59 // "initialization". Also, the Register objects cannot be const as this | 81 // "initialization". Also, the Register objects cannot be const as this |
60 // forces initialization stubs in MSVC, making us dependent on initialization | 82 // forces initialization stubs in MSVC, making us dependent on initialization |
61 // order. | 83 // order. |
62 // | 84 // |
63 // 3) By not using an enum, we are possibly preventing the compiler from | 85 // 3) By not using an enum, we are possibly preventing the compiler from |
64 // doing certain constant folds, which may significantly reduce the | 86 // doing certain constant folds, which may significantly reduce the |
65 // code generated for some assembly instructions (because they boil down | 87 // code generated for some assembly instructions (because they boil down |
66 // to a few constants). If this is a problem, we could change the code | 88 // to a few constants). If this is a problem, we could change the code |
67 // such that we use an enum in optimized mode, and the struct in debug | 89 // such that we use an enum in optimized mode, and the struct in debug |
68 // mode. This way we get the compile-time error checking in debug mode | 90 // mode. This way we get the compile-time error checking in debug mode |
69 // and best performance in optimized code. | 91 // and best performance in optimized code. |
70 | 92 |
71 | 93 |
72 // ----------------------------------------------------------------------------- | 94 // ----------------------------------------------------------------------------- |
73 // Implementation of Register and FPURegister. | 95 // Implementation of Register and FPURegister. |
74 | 96 |
75 // Core register. | |
76 struct Register { | 97 struct Register { |
77 static const int kNumRegisters = v8::internal::kNumRegisters; | |
78 static const int kMaxNumAllocatableRegisters = 14; // v0 through t6 and cp. | |
79 static const int kSizeInBytes = 4; | |
80 static const int kCpRegister = 23; // cp (s7) is the 23rd register. | 98 static const int kCpRegister = 23; // cp (s7) is the 23rd register. |
81 | 99 |
| 100 enum Code { |
| 101 #define REGISTER_CODE(R) kCode_##R, |
| 102 GENERAL_REGISTERS(REGISTER_CODE) |
| 103 #undef REGISTER_CODE |
| 104 kAfterLast, |
| 105 kCode_no_reg = -1 |
| 106 }; |
| 107 |
| 108 static const int kNumRegisters = Code::kAfterLast; |
| 109 |
82 #if defined(V8_TARGET_LITTLE_ENDIAN) | 110 #if defined(V8_TARGET_LITTLE_ENDIAN) |
83 static const int kMantissaOffset = 0; | 111 static const int kMantissaOffset = 0; |
84 static const int kExponentOffset = 4; | 112 static const int kExponentOffset = 4; |
85 #elif defined(V8_TARGET_BIG_ENDIAN) | 113 #elif defined(V8_TARGET_BIG_ENDIAN) |
86 static const int kMantissaOffset = 4; | 114 static const int kMantissaOffset = 4; |
87 static const int kExponentOffset = 0; | 115 static const int kExponentOffset = 0; |
88 #else | 116 #else |
89 #error Unknown endianness | 117 #error Unknown endianness |
90 #endif | 118 #endif |
91 | 119 |
92 inline static int NumAllocatableRegisters(); | |
93 | |
94 static int ToAllocationIndex(Register reg) { | |
95 DCHECK((reg.code() - 2) < (kMaxNumAllocatableRegisters - 1) || | |
96 reg.is(from_code(kCpRegister))); | |
97 return reg.is(from_code(kCpRegister)) ? | |
98 kMaxNumAllocatableRegisters - 1 : // Return last index for 'cp'. | |
99 reg.code() - 2; // zero_reg and 'at' are skipped. | |
100 } | |
101 | |
102 static Register FromAllocationIndex(int index) { | |
103 DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters); | |
104 return index == kMaxNumAllocatableRegisters - 1 ? | |
105 from_code(kCpRegister) : // Last index is always the 'cp' register. | |
106 from_code(index + 2); // zero_reg and 'at' are skipped. | |
107 } | |
108 | |
109 static const char* AllocationIndexToString(int index) { | |
110 DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters); | |
111 const char* const names[] = { | |
112 "v0", | |
113 "v1", | |
114 "a0", | |
115 "a1", | |
116 "a2", | |
117 "a3", | |
118 "t0", | |
119 "t1", | |
120 "t2", | |
121 "t3", | |
122 "t4", | |
123 "t5", | |
124 "t6", | |
125 "s7", | |
126 }; | |
127 return names[index]; | |
128 } | |
129 | 120 |
130 static Register from_code(int code) { | 121 static Register from_code(int code) { |
131 Register r = { code }; | 122 DCHECK(code >= 0); |
| 123 DCHECK(code < kNumRegisters); |
| 124 Register r = {code}; |
132 return r; | 125 return r; |
133 } | 126 } |
134 | 127 const char* ToString(); |
135 bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; } | 128 bool IsAllocatable() const; |
136 bool is(Register reg) const { return code_ == reg.code_; } | 129 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 130 bool is(Register reg) const { return reg_code == reg.reg_code; } |
137 int code() const { | 131 int code() const { |
138 DCHECK(is_valid()); | 132 DCHECK(is_valid()); |
139 return code_; | 133 return reg_code; |
140 } | 134 } |
141 int bit() const { | 135 int bit() const { |
142 DCHECK(is_valid()); | 136 DCHECK(is_valid()); |
143 return 1 << code_; | 137 return 1 << reg_code; |
144 } | 138 } |
145 | 139 |
146 // Unfortunately we can't make this private in a struct. | 140 // Unfortunately we can't make this private in a struct. |
147 int code_; | 141 int reg_code; |
148 }; | 142 }; |
149 | 143 |
150 #define REGISTER(N, C) \ | 144 // s7: context register |
151 const int kRegister_ ## N ## _Code = C; \ | 145 // s3: lithium scratch |
152 const Register N = { C } | 146 // s4: lithium scratch2 |
153 | 147 #define DECLARE_REGISTER(R) const Register R = {Register::kCode_##R}; |
154 REGISTER(no_reg, -1); | 148 GENERAL_REGISTERS(DECLARE_REGISTER) |
155 // Always zero. | 149 #undef DECLARE_REGISTER |
156 REGISTER(zero_reg, 0); | 150 const Register no_reg = {Register::kCode_no_reg}; |
157 // at: Reserved for synthetic instructions. | |
158 REGISTER(at, 1); | |
159 // v0, v1: Used when returning multiple values from subroutines. | |
160 REGISTER(v0, 2); | |
161 REGISTER(v1, 3); | |
162 // a0 - a4: Used to pass non-FP parameters. | |
163 REGISTER(a0, 4); | |
164 REGISTER(a1, 5); | |
165 REGISTER(a2, 6); | |
166 REGISTER(a3, 7); | |
167 // t0 - t9: Can be used without reservation, act as temporary registers and are | |
168 // allowed to be destroyed by subroutines. | |
169 REGISTER(t0, 8); | |
170 REGISTER(t1, 9); | |
171 REGISTER(t2, 10); | |
172 REGISTER(t3, 11); | |
173 REGISTER(t4, 12); | |
174 REGISTER(t5, 13); | |
175 REGISTER(t6, 14); | |
176 REGISTER(t7, 15); | |
177 // s0 - s7: Subroutine register variables. Subroutines that write to these | |
178 // registers must restore their values before exiting so that the caller can | |
179 // expect the values to be preserved. | |
180 REGISTER(s0, 16); | |
181 REGISTER(s1, 17); | |
182 REGISTER(s2, 18); | |
183 REGISTER(s3, 19); | |
184 REGISTER(s4, 20); | |
185 REGISTER(s5, 21); | |
186 REGISTER(s6, 22); | |
187 REGISTER(s7, 23); | |
188 REGISTER(t8, 24); | |
189 REGISTER(t9, 25); | |
190 // k0, k1: Reserved for system calls and interrupt handlers. | |
191 REGISTER(k0, 26); | |
192 REGISTER(k1, 27); | |
193 // gp: Reserved. | |
194 REGISTER(gp, 28); | |
195 // sp: Stack pointer. | |
196 REGISTER(sp, 29); | |
197 // fp: Frame pointer. | |
198 REGISTER(fp, 30); | |
199 // ra: Return address pointer. | |
200 REGISTER(ra, 31); | |
201 | |
202 #undef REGISTER | |
203 | 151 |
204 | 152 |
205 int ToNumber(Register reg); | 153 int ToNumber(Register reg); |
206 | 154 |
207 Register ToRegister(int num); | 155 Register ToRegister(int num); |
208 | 156 |
209 // Coprocessor register. | 157 // Coprocessor register. |
210 struct FPURegister { | 158 struct DoubleRegister { |
211 static const int kMaxNumRegisters = v8::internal::kNumFPURegisters; | 159 enum Code { |
| 160 #define REGISTER_CODE(R) kCode_##R, |
| 161 DOUBLE_REGISTERS(REGISTER_CODE) |
| 162 #undef REGISTER_CODE |
| 163 kAfterLast, |
| 164 kCode_no_reg = -1 |
| 165 }; |
| 166 |
| 167 static const int kMaxNumRegisters = Code::kAfterLast; |
| 168 |
| 169 inline static int NumRegisters(); |
212 | 170 |
213 // TODO(plind): Warning, inconsistent numbering here. kNumFPURegisters refers | 171 // TODO(plind): Warning, inconsistent numbering here. kNumFPURegisters refers |
214 // to number of 32-bit FPU regs, but kNumAllocatableRegisters refers to | 172 // to number of 32-bit FPU regs, but kNumAllocatableRegisters refers to |
215 // number of Double regs (64-bit regs, or FPU-reg-pairs). | 173 // number of Double regs (64-bit regs, or FPU-reg-pairs). |
216 | 174 |
217 // A few double registers are reserved: one as a scratch register and one to | 175 const char* ToString(); |
218 // hold 0.0. | 176 bool IsAllocatable() const; |
219 // f28: 0.0 | 177 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
220 // f30: scratch register. | 178 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } |
221 static const int kNumReservedRegisters = 2; | 179 DoubleRegister low() const { |
222 static const int kMaxNumAllocatableRegisters = kMaxNumRegisters / 2 - | |
223 kNumReservedRegisters; | |
224 | |
225 inline static int NumRegisters(); | |
226 inline static int NumAllocatableRegisters(); | |
227 | |
228 // TODO(turbofan): Proper support for float32. | |
229 inline static int NumAllocatableAliasedRegisters(); | |
230 | |
231 inline static int ToAllocationIndex(FPURegister reg); | |
232 static const char* AllocationIndexToString(int index); | |
233 | |
234 static FPURegister FromAllocationIndex(int index) { | |
235 DCHECK(index >= 0 && index < kMaxNumAllocatableRegisters); | |
236 return from_code(index * 2); | |
237 } | |
238 | |
239 static FPURegister from_code(int code) { | |
240 FPURegister r = { code }; | |
241 return r; | |
242 } | |
243 | |
244 bool is_valid() const { return 0 <= code_ && code_ < kMaxNumRegisters ; } | |
245 bool is(FPURegister creg) const { return code_ == creg.code_; } | |
246 FPURegister low() const { | |
247 // Find low reg of a Double-reg pair, which is the reg itself. | 180 // Find low reg of a Double-reg pair, which is the reg itself. |
248 DCHECK(code_ % 2 == 0); // Specified Double reg must be even. | 181 DCHECK(reg_code % 2 == 0); // Specified Double reg must be even. |
249 FPURegister reg; | 182 DoubleRegister reg; |
250 reg.code_ = code_; | 183 reg.reg_code = reg_code; |
251 DCHECK(reg.is_valid()); | 184 DCHECK(reg.is_valid()); |
252 return reg; | 185 return reg; |
253 } | 186 } |
254 FPURegister high() const { | 187 DoubleRegister high() const { |
255 // Find high reg of a Doubel-reg pair, which is reg + 1. | 188 // Find high reg of a Doubel-reg pair, which is reg + 1. |
256 DCHECK(code_ % 2 == 0); // Specified Double reg must be even. | 189 DCHECK(reg_code % 2 == 0); // Specified Double reg must be even. |
257 FPURegister reg; | 190 DoubleRegister reg; |
258 reg.code_ = code_ + 1; | 191 reg.reg_code = reg_code + 1; |
259 DCHECK(reg.is_valid()); | 192 DCHECK(reg.is_valid()); |
260 return reg; | 193 return reg; |
261 } | 194 } |
262 | 195 |
263 int code() const { | 196 int code() const { |
264 DCHECK(is_valid()); | 197 DCHECK(is_valid()); |
265 return code_; | 198 return reg_code; |
266 } | 199 } |
267 int bit() const { | 200 int bit() const { |
268 DCHECK(is_valid()); | 201 DCHECK(is_valid()); |
269 return 1 << code_; | 202 return 1 << reg_code; |
| 203 } |
| 204 |
| 205 static DoubleRegister from_code(int code) { |
| 206 DoubleRegister r = {code}; |
| 207 return r; |
270 } | 208 } |
271 void setcode(int f) { | 209 void setcode(int f) { |
272 code_ = f; | 210 reg_code = f; |
273 DCHECK(is_valid()); | 211 DCHECK(is_valid()); |
274 } | 212 } |
275 // Unfortunately we can't make this private in a struct. | 213 // Unfortunately we can't make this private in a struct. |
276 int code_; | 214 int reg_code; |
277 }; | 215 }; |
278 | 216 |
| 217 // A few double registers are reserved: one as a scratch register and one to |
| 218 // hold 0.0. |
| 219 // f28: 0.0 |
| 220 // f30: scratch register. |
| 221 |
279 // V8 now supports the O32 ABI, and the FPU Registers are organized as 32 | 222 // V8 now supports the O32 ABI, and the FPU Registers are organized as 32 |
280 // 32-bit registers, f0 through f31. When used as 'double' they are used | 223 // 32-bit registers, f0 through f31. When used as 'double' they are used |
281 // in pairs, starting with the even numbered register. So a double operation | 224 // in pairs, starting with the even numbered register. So a double operation |
282 // on f0 really uses f0 and f1. | 225 // on f0 really uses f0 and f1. |
283 // (Modern mips hardware also supports 32 64-bit registers, via setting | 226 // (Modern mips hardware also supports 32 64-bit registers, via setting |
284 // (priviledged) Status Register FR bit to 1. This is used by the N32 ABI, | 227 // (priviledged) Status Register FR bit to 1. This is used by the N32 ABI, |
285 // but it is not in common use. Someday we will want to support this in v8.) | 228 // but it is not in common use. Someday we will want to support this in v8.) |
286 | 229 |
287 // For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers. | 230 // For O32 ABI, Floats and Doubles refer to same set of 32 32-bit registers. |
288 typedef FPURegister DoubleRegister; | 231 typedef DoubleRegister FPURegister; |
289 typedef FPURegister FloatRegister; | 232 typedef DoubleRegister FloatRegister; |
290 | 233 |
291 const FPURegister no_freg = { -1 }; | 234 const DoubleRegister no_freg = {-1}; |
292 | 235 |
293 const FPURegister f0 = { 0 }; // Return value in hard float mode. | 236 const DoubleRegister f0 = {0}; // Return value in hard float mode. |
294 const FPURegister f1 = { 1 }; | 237 const DoubleRegister f1 = {1}; |
295 const FPURegister f2 = { 2 }; | 238 const DoubleRegister f2 = {2}; |
296 const FPURegister f3 = { 3 }; | 239 const DoubleRegister f3 = {3}; |
297 const FPURegister f4 = { 4 }; | 240 const DoubleRegister f4 = {4}; |
298 const FPURegister f5 = { 5 }; | 241 const DoubleRegister f5 = {5}; |
299 const FPURegister f6 = { 6 }; | 242 const DoubleRegister f6 = {6}; |
300 const FPURegister f7 = { 7 }; | 243 const DoubleRegister f7 = {7}; |
301 const FPURegister f8 = { 8 }; | 244 const DoubleRegister f8 = {8}; |
302 const FPURegister f9 = { 9 }; | 245 const DoubleRegister f9 = {9}; |
303 const FPURegister f10 = { 10 }; | 246 const DoubleRegister f10 = {10}; |
304 const FPURegister f11 = { 11 }; | 247 const DoubleRegister f11 = {11}; |
305 const FPURegister f12 = { 12 }; // Arg 0 in hard float mode. | 248 const DoubleRegister f12 = {12}; // Arg 0 in hard float mode. |
306 const FPURegister f13 = { 13 }; | 249 const DoubleRegister f13 = {13}; |
307 const FPURegister f14 = { 14 }; // Arg 1 in hard float mode. | 250 const DoubleRegister f14 = {14}; // Arg 1 in hard float mode. |
308 const FPURegister f15 = { 15 }; | 251 const DoubleRegister f15 = {15}; |
309 const FPURegister f16 = { 16 }; | 252 const DoubleRegister f16 = {16}; |
310 const FPURegister f17 = { 17 }; | 253 const DoubleRegister f17 = {17}; |
311 const FPURegister f18 = { 18 }; | 254 const DoubleRegister f18 = {18}; |
312 const FPURegister f19 = { 19 }; | 255 const DoubleRegister f19 = {19}; |
313 const FPURegister f20 = { 20 }; | 256 const DoubleRegister f20 = {20}; |
314 const FPURegister f21 = { 21 }; | 257 const DoubleRegister f21 = {21}; |
315 const FPURegister f22 = { 22 }; | 258 const DoubleRegister f22 = {22}; |
316 const FPURegister f23 = { 23 }; | 259 const DoubleRegister f23 = {23}; |
317 const FPURegister f24 = { 24 }; | 260 const DoubleRegister f24 = {24}; |
318 const FPURegister f25 = { 25 }; | 261 const DoubleRegister f25 = {25}; |
319 const FPURegister f26 = { 26 }; | 262 const DoubleRegister f26 = {26}; |
320 const FPURegister f27 = { 27 }; | 263 const DoubleRegister f27 = {27}; |
321 const FPURegister f28 = { 28 }; | 264 const DoubleRegister f28 = {28}; |
322 const FPURegister f29 = { 29 }; | 265 const DoubleRegister f29 = {29}; |
323 const FPURegister f30 = { 30 }; | 266 const DoubleRegister f30 = {30}; |
324 const FPURegister f31 = { 31 }; | 267 const DoubleRegister f31 = {31}; |
325 | 268 |
326 // Register aliases. | 269 // Register aliases. |
327 // cp is assumed to be a callee saved register. | 270 // cp is assumed to be a callee saved register. |
328 // Defined using #define instead of "static const Register&" because Clang | 271 // Defined using #define instead of "static const Register&" because Clang |
329 // complains otherwise when a compilation unit that includes this header | 272 // complains otherwise when a compilation unit that includes this header |
330 // doesn't use the variables. | 273 // doesn't use the variables. |
331 #define kRootRegister s6 | 274 #define kRootRegister s6 |
332 #define cp s7 | 275 #define cp s7 |
333 #define kLithiumScratchReg s3 | 276 #define kLithiumScratchReg s3 |
334 #define kLithiumScratchReg2 s4 | 277 #define kLithiumScratchReg2 s4 |
335 #define kLithiumScratchDouble f30 | 278 #define kLithiumScratchDouble f30 |
336 #define kDoubleRegZero f28 | 279 #define kDoubleRegZero f28 |
337 // Used on mips32r6 for compare operations. | 280 // Used on mips32r6 for compare operations. |
338 // We use the last non-callee saved odd register for O32 ABI | 281 // We use the last non-callee saved odd register for O32 ABI |
339 #define kDoubleCompareReg f19 | 282 #define kDoubleCompareReg f19 |
340 | 283 |
341 // FPU (coprocessor 1) control registers. | 284 // FPU (coprocessor 1) control registers. |
342 // Currently only FCSR (#31) is implemented. | 285 // Currently only FCSR (#31) is implemented. |
343 struct FPUControlRegister { | 286 struct FPUControlRegister { |
344 bool is_valid() const { return code_ == kFCSRRegister; } | 287 bool is_valid() const { return reg_code == kFCSRRegister; } |
345 bool is(FPUControlRegister creg) const { return code_ == creg.code_; } | 288 bool is(FPUControlRegister creg) const { return reg_code == creg.reg_code; } |
346 int code() const { | 289 int code() const { |
347 DCHECK(is_valid()); | 290 DCHECK(is_valid()); |
348 return code_; | 291 return reg_code; |
349 } | 292 } |
350 int bit() const { | 293 int bit() const { |
351 DCHECK(is_valid()); | 294 DCHECK(is_valid()); |
352 return 1 << code_; | 295 return 1 << reg_code; |
353 } | 296 } |
354 void setcode(int f) { | 297 void setcode(int f) { |
355 code_ = f; | 298 reg_code = f; |
356 DCHECK(is_valid()); | 299 DCHECK(is_valid()); |
357 } | 300 } |
358 // Unfortunately we can't make this private in a struct. | 301 // Unfortunately we can't make this private in a struct. |
359 int code_; | 302 int reg_code; |
360 }; | 303 }; |
361 | 304 |
362 const FPUControlRegister no_fpucreg = { kInvalidFPUControlRegister }; | 305 const FPUControlRegister no_fpucreg = { kInvalidFPUControlRegister }; |
363 const FPUControlRegister FCSR = { kFCSRRegister }; | 306 const FPUControlRegister FCSR = { kFCSRRegister }; |
364 | 307 |
365 | 308 |
366 // ----------------------------------------------------------------------------- | 309 // ----------------------------------------------------------------------------- |
367 // Machine instruction Operands. | 310 // Machine instruction Operands. |
368 | 311 |
369 // Class Operand represents a shifter operand in data processing instructions. | 312 // Class Operand represents a shifter operand in data processing instructions. |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 public: | 1390 public: |
1448 explicit EnsureSpace(Assembler* assembler) { | 1391 explicit EnsureSpace(Assembler* assembler) { |
1449 assembler->CheckBuffer(); | 1392 assembler->CheckBuffer(); |
1450 } | 1393 } |
1451 }; | 1394 }; |
1452 | 1395 |
1453 } // namespace internal | 1396 } // namespace internal |
1454 } // namespace v8 | 1397 } // namespace v8 |
1455 | 1398 |
1456 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1399 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |