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 | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Used as roots register. | 205 // Used as roots register. |
206 const Register r10 = { kRegister_r10_Code }; | 206 const Register r10 = { kRegister_r10_Code }; |
207 const Register fp = { kRegister_fp_Code }; | 207 const Register fp = { kRegister_fp_Code }; |
208 const Register ip = { kRegister_ip_Code }; | 208 const Register ip = { kRegister_ip_Code }; |
209 const Register sp = { kRegister_sp_Code }; | 209 const Register sp = { kRegister_sp_Code }; |
210 const Register lr = { kRegister_lr_Code }; | 210 const Register lr = { kRegister_lr_Code }; |
211 const Register pc = { kRegister_pc_Code }; | 211 const Register pc = { kRegister_pc_Code }; |
212 | 212 |
213 // Single word VFP register. | 213 // Single word VFP register. |
214 struct SwVfpRegister { | 214 struct SwVfpRegister { |
| 215 static const int kSizeInBytes = 4; |
215 bool is_valid() const { return 0 <= code_ && code_ < 32; } | 216 bool is_valid() const { return 0 <= code_ && code_ < 32; } |
216 bool is(SwVfpRegister reg) const { return code_ == reg.code_; } | 217 bool is(SwVfpRegister reg) const { return code_ == reg.code_; } |
217 int code() const { | 218 int code() const { |
218 ASSERT(is_valid()); | 219 ASSERT(is_valid()); |
219 return code_; | 220 return code_; |
220 } | 221 } |
221 int bit() const { | 222 int bit() const { |
222 ASSERT(is_valid()); | 223 ASSERT(is_valid()); |
223 return 1 << code_; | 224 return 1 << code_; |
224 } | 225 } |
(...skipping 10 matching lines...) Expand all Loading... |
235 // Double word VFP register. | 236 // Double word VFP register. |
236 struct DwVfpRegister { | 237 struct DwVfpRegister { |
237 static const int kMaxNumRegisters = 32; | 238 static const int kMaxNumRegisters = 32; |
238 // A few double registers are reserved: one as a scratch register and one to | 239 // A few double registers are reserved: one as a scratch register and one to |
239 // hold 0.0, that does not fit in the immediate field of vmov instructions. | 240 // hold 0.0, that does not fit in the immediate field of vmov instructions. |
240 // d14: 0.0 | 241 // d14: 0.0 |
241 // d15: scratch register. | 242 // d15: scratch register. |
242 static const int kNumReservedRegisters = 2; | 243 static const int kNumReservedRegisters = 2; |
243 static const int kMaxNumAllocatableRegisters = kMaxNumRegisters - | 244 static const int kMaxNumAllocatableRegisters = kMaxNumRegisters - |
244 kNumReservedRegisters; | 245 kNumReservedRegisters; |
| 246 static const int kSizeInBytes = 8; |
245 | 247 |
246 // Note: the number of registers can be different at snapshot and run-time. | 248 // Note: the number of registers can be different at snapshot and run-time. |
247 // Any code included in the snapshot must be able to run both with 16 or 32 | 249 // Any code included in the snapshot must be able to run both with 16 or 32 |
248 // registers. | 250 // registers. |
249 inline static int NumRegisters(); | 251 inline static int NumRegisters(); |
250 inline static int NumAllocatableRegisters(); | 252 inline static int NumAllocatableRegisters(); |
251 | 253 |
252 inline static int ToAllocationIndex(DwVfpRegister reg); | 254 inline static int ToAllocationIndex(DwVfpRegister reg); |
253 static const char* AllocationIndexToString(int index); | 255 static const char* AllocationIndexToString(int index); |
254 inline static DwVfpRegister FromAllocationIndex(int index); | 256 inline static DwVfpRegister FromAllocationIndex(int index); |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 public: | 1440 public: |
1439 explicit EnsureSpace(Assembler* assembler) { | 1441 explicit EnsureSpace(Assembler* assembler) { |
1440 assembler->CheckBuffer(); | 1442 assembler->CheckBuffer(); |
1441 } | 1443 } |
1442 }; | 1444 }; |
1443 | 1445 |
1444 | 1446 |
1445 } } // namespace v8::internal | 1447 } } // namespace v8::internal |
1446 | 1448 |
1447 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1449 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |