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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // ----------------------------------------------------------------------------- | 70 // ----------------------------------------------------------------------------- |
71 // Implementation of Register and FPURegister. | 71 // Implementation of Register and FPURegister. |
72 | 72 |
73 // Core register. | 73 // Core register. |
74 struct Register { | 74 struct Register { |
75 static const int kNumRegisters = v8::internal::kNumRegisters; | 75 static const int kNumRegisters = v8::internal::kNumRegisters; |
76 static const int kMaxNumAllocatableRegisters = 14; // v0 through t6 and cp. | 76 static const int kMaxNumAllocatableRegisters = 14; // v0 through t6 and cp. |
77 static const int kSizeInBytes = 4; | 77 static const int kSizeInBytes = 4; |
78 static const int kCpRegister = 23; // cp (s7) is the 23rd register. | 78 static const int kCpRegister = 23; // cp (s7) is the 23rd register. |
79 | 79 |
| 80 #if defined(V8_TARGET_LITTLE_ENDIAN) |
| 81 static const int kMantissaOffset = 0; |
| 82 static const int kExponentOffset = 4; |
| 83 #elif defined(V8_TARGET_BIG_ENDIAN) |
| 84 static const int kMantissaOffset = 4; |
| 85 static const int kExponentOffset = 0; |
| 86 #else |
| 87 #error Unknown endianness |
| 88 #endif |
| 89 |
80 inline static int NumAllocatableRegisters(); | 90 inline static int NumAllocatableRegisters(); |
81 | 91 |
82 static int ToAllocationIndex(Register reg) { | 92 static int ToAllocationIndex(Register reg) { |
83 ASSERT((reg.code() - 2) < (kMaxNumAllocatableRegisters - 1) || | 93 ASSERT((reg.code() - 2) < (kMaxNumAllocatableRegisters - 1) || |
84 reg.is(from_code(kCpRegister))); | 94 reg.is(from_code(kCpRegister))); |
85 return reg.is(from_code(kCpRegister)) ? | 95 return reg.is(from_code(kCpRegister)) ? |
86 kMaxNumAllocatableRegisters - 1 : // Return last index for 'cp'. | 96 kMaxNumAllocatableRegisters - 1 : // Return last index for 'cp'. |
87 reg.code() - 2; // zero_reg and 'at' are skipped. | 97 reg.code() - 2; // zero_reg and 'at' are skipped. |
88 } | 98 } |
89 | 99 |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 class EnsureSpace BASE_EMBEDDED { | 1285 class EnsureSpace BASE_EMBEDDED { |
1276 public: | 1286 public: |
1277 explicit EnsureSpace(Assembler* assembler) { | 1287 explicit EnsureSpace(Assembler* assembler) { |
1278 assembler->CheckBuffer(); | 1288 assembler->CheckBuffer(); |
1279 } | 1289 } |
1280 }; | 1290 }; |
1281 | 1291 |
1282 } } // namespace v8::internal | 1292 } } // namespace v8::internal |
1283 | 1293 |
1284 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1294 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |