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