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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #endif | 119 #endif |
120 | 120 |
121 | 121 |
122 static Register from_code(int code) { | 122 static Register from_code(int code) { |
123 DCHECK(code >= 0); | 123 DCHECK(code >= 0); |
124 DCHECK(code < kNumRegisters); | 124 DCHECK(code < kNumRegisters); |
125 Register r = {code}; | 125 Register r = {code}; |
126 return r; | 126 return r; |
127 } | 127 } |
128 const char* ToString(); | 128 const char* ToString(); |
129 bool IsAllocatable() const; | 129 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 130 RegisterConfiguration::CRANKSHAFT) const; |
130 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 131 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
131 bool is(Register reg) const { return reg_code == reg.reg_code; } | 132 bool is(Register reg) const { return reg_code == reg.reg_code; } |
132 int code() const { | 133 int code() const { |
133 DCHECK(is_valid()); | 134 DCHECK(is_valid()); |
134 return reg_code; | 135 return reg_code; |
135 } | 136 } |
136 int bit() const { | 137 int bit() const { |
137 DCHECK(is_valid()); | 138 DCHECK(is_valid()); |
138 return 1 << reg_code; | 139 return 1 << reg_code; |
139 } | 140 } |
(...skipping 27 matching lines...) Expand all Loading... |
167 | 168 |
168 static const int kMaxNumRegisters = Code::kAfterLast; | 169 static const int kMaxNumRegisters = Code::kAfterLast; |
169 | 170 |
170 inline static int NumRegisters(); | 171 inline static int NumRegisters(); |
171 | 172 |
172 // TODO(plind): Warning, inconsistent numbering here. kNumFPURegisters refers | 173 // TODO(plind): Warning, inconsistent numbering here. kNumFPURegisters refers |
173 // to number of 32-bit FPU regs, but kNumAllocatableRegisters refers to | 174 // to number of 32-bit FPU regs, but kNumAllocatableRegisters refers to |
174 // number of Double regs (64-bit regs, or FPU-reg-pairs). | 175 // number of Double regs (64-bit regs, or FPU-reg-pairs). |
175 | 176 |
176 const char* ToString(); | 177 const char* ToString(); |
177 bool IsAllocatable() const; | 178 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 179 RegisterConfiguration::CRANKSHAFT) const; |
178 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 180 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
179 bool is(FPURegister reg) const { return reg_code == reg.reg_code; } | 181 bool is(FPURegister reg) const { return reg_code == reg.reg_code; } |
180 FPURegister low() const { | 182 FPURegister low() const { |
181 // Find low reg of a Double-reg pair, which is the reg itself. | 183 // Find low reg of a Double-reg pair, which is the reg itself. |
182 DCHECK(reg_code % 2 == 0); // Specified Double reg must be even. | 184 DCHECK(reg_code % 2 == 0); // Specified Double reg must be even. |
183 FPURegister reg; | 185 FPURegister reg; |
184 reg.reg_code = reg_code; | 186 reg.reg_code = reg_code; |
185 DCHECK(reg.is_valid()); | 187 DCHECK(reg.is_valid()); |
186 return reg; | 188 return reg; |
187 } | 189 } |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 public: | 1471 public: |
1470 explicit EnsureSpace(Assembler* assembler) { | 1472 explicit EnsureSpace(Assembler* assembler) { |
1471 assembler->CheckBuffer(); | 1473 assembler->CheckBuffer(); |
1472 } | 1474 } |
1473 }; | 1475 }; |
1474 | 1476 |
1475 } // namespace internal | 1477 } // namespace internal |
1476 } // namespace v8 | 1478 } // namespace v8 |
1477 | 1479 |
1478 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1480 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |