| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 static const RegList kAllocatable = | 159 static const RegList kAllocatable = |
| 160 ALLOCATABLE_GENERAL_REGISTERS(REGISTER_BIT)0; | 160 ALLOCATABLE_GENERAL_REGISTERS(REGISTER_BIT)0; |
| 161 #undef REGISTER_BIT | 161 #undef REGISTER_BIT |
| 162 | 162 |
| 163 static Register from_code(int code) { | 163 static Register from_code(int code) { |
| 164 DCHECK(code >= 0); | 164 DCHECK(code >= 0); |
| 165 DCHECK(code < kNumRegisters); | 165 DCHECK(code < kNumRegisters); |
| 166 Register r = {code}; | 166 Register r = {code}; |
| 167 return r; | 167 return r; |
| 168 } | 168 } |
| 169 const char* ToString(); | |
| 170 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
| 171 RegisterConfiguration::CRANKSHAFT) const; | |
| 172 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 169 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 173 bool is(Register reg) const { return reg_code == reg.reg_code; } | 170 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 174 int code() const { | 171 int code() const { |
| 175 DCHECK(is_valid()); | 172 DCHECK(is_valid()); |
| 176 return reg_code; | 173 return reg_code; |
| 177 } | 174 } |
| 178 int bit() const { | 175 int bit() const { |
| 179 DCHECK(is_valid()); | 176 DCHECK(is_valid()); |
| 180 return 1 << reg_code; | 177 return 1 << reg_code; |
| 181 } | 178 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 #define REGISTER_CODE(R) kCode_##R, | 212 #define REGISTER_CODE(R) kCode_##R, |
| 216 DOUBLE_REGISTERS(REGISTER_CODE) | 213 DOUBLE_REGISTERS(REGISTER_CODE) |
| 217 #undef REGISTER_CODE | 214 #undef REGISTER_CODE |
| 218 kAfterLast, | 215 kAfterLast, |
| 219 kCode_no_reg = -1 | 216 kCode_no_reg = -1 |
| 220 }; | 217 }; |
| 221 | 218 |
| 222 static const int kNumRegisters = Code::kAfterLast; | 219 static const int kNumRegisters = Code::kAfterLast; |
| 223 static const int kMaxNumRegisters = kNumRegisters; | 220 static const int kMaxNumRegisters = kNumRegisters; |
| 224 | 221 |
| 225 const char* ToString(); | |
| 226 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
| 227 RegisterConfiguration::CRANKSHAFT) const; | |
| 228 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 222 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 229 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } | 223 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } |
| 230 int code() const { | 224 int code() const { |
| 231 DCHECK(is_valid()); | 225 DCHECK(is_valid()); |
| 232 return reg_code; | 226 return reg_code; |
| 233 } | 227 } |
| 234 int bit() const { | 228 int bit() const { |
| 235 DCHECK(is_valid()); | 229 DCHECK(is_valid()); |
| 236 return 1 << reg_code; | 230 return 1 << reg_code; |
| 237 } | 231 } |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 | 1477 |
| 1484 | 1478 |
| 1485 class EnsureSpace BASE_EMBEDDED { | 1479 class EnsureSpace BASE_EMBEDDED { |
| 1486 public: | 1480 public: |
| 1487 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } | 1481 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } |
| 1488 }; | 1482 }; |
| 1489 } // namespace internal | 1483 } // namespace internal |
| 1490 } // namespace v8 | 1484 } // namespace v8 |
| 1491 | 1485 |
| 1492 #endif // V8_PPC_ASSEMBLER_PPC_H_ | 1486 #endif // V8_PPC_ASSEMBLER_PPC_H_ |
| OLD | NEW |