| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 static const int kNumRegisters = Code::kAfterLast; | 113 static const int kNumRegisters = Code::kAfterLast; |
| 114 | 114 |
| 115 static Register from_code(int code) { | 115 static Register from_code(int code) { |
| 116 DCHECK(code >= 0); | 116 DCHECK(code >= 0); |
| 117 DCHECK(code < kNumRegisters); | 117 DCHECK(code < kNumRegisters); |
| 118 Register r = {code}; | 118 Register r = {code}; |
| 119 return r; | 119 return r; |
| 120 } | 120 } |
| 121 const char* ToString(); | 121 const char* ToString(); |
| 122 bool IsAllocatable() const; | 122 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 123 RegisterConfiguration::CRANKSHAFT) const; |
| 123 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 124 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 124 bool is(Register reg) const { return reg_code == reg.reg_code; } | 125 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 125 int code() const { | 126 int code() const { |
| 126 DCHECK(is_valid()); | 127 DCHECK(is_valid()); |
| 127 return reg_code; | 128 return reg_code; |
| 128 } | 129 } |
| 129 int bit() const { | 130 int bit() const { |
| 130 DCHECK(is_valid()); | 131 DCHECK(is_valid()); |
| 131 return 1 << reg_code; | 132 return 1 << reg_code; |
| 132 } | 133 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 155 #undef REGISTER_CODE | 156 #undef REGISTER_CODE |
| 156 kAfterLast, | 157 kAfterLast, |
| 157 kCode_no_reg = -1 | 158 kCode_no_reg = -1 |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 static const int kMaxNumRegisters = Code::kAfterLast; | 161 static const int kMaxNumRegisters = Code::kAfterLast; |
| 161 | 162 |
| 162 static const int kSizeInBytes = 4; | 163 static const int kSizeInBytes = 4; |
| 163 | 164 |
| 164 const char* ToString(); | 165 const char* ToString(); |
| 165 bool IsAllocatable() const; | 166 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 167 RegisterConfiguration::CRANKSHAFT) const; |
| 166 bool is_valid() const { return 0 <= reg_code && reg_code < 32; } | 168 bool is_valid() const { return 0 <= reg_code && reg_code < 32; } |
| 167 bool is(SwVfpRegister reg) const { return reg_code == reg.reg_code; } | 169 bool is(SwVfpRegister reg) const { return reg_code == reg.reg_code; } |
| 168 int code() const { | 170 int code() const { |
| 169 DCHECK(is_valid()); | 171 DCHECK(is_valid()); |
| 170 return reg_code; | 172 return reg_code; |
| 171 } | 173 } |
| 172 int bit() const { | 174 int bit() const { |
| 173 DCHECK(is_valid()); | 175 DCHECK(is_valid()); |
| 174 return 1 << reg_code; | 176 return 1 << reg_code; |
| 175 } | 177 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 202 | 204 |
| 203 inline static int NumRegisters(); | 205 inline static int NumRegisters(); |
| 204 | 206 |
| 205 // A few double registers are reserved: one as a scratch register and one to | 207 // A few double registers are reserved: one as a scratch register and one to |
| 206 // hold 0.0, that does not fit in the immediate field of vmov instructions. | 208 // hold 0.0, that does not fit in the immediate field of vmov instructions. |
| 207 // d14: 0.0 | 209 // d14: 0.0 |
| 208 // d15: scratch register. | 210 // d15: scratch register. |
| 209 static const int kSizeInBytes = 8; | 211 static const int kSizeInBytes = 8; |
| 210 | 212 |
| 211 const char* ToString(); | 213 const char* ToString(); |
| 212 bool IsAllocatable() const; | 214 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 215 RegisterConfiguration::CRANKSHAFT) const; |
| 213 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 216 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
| 214 bool is(DwVfpRegister reg) const { return reg_code == reg.reg_code; } | 217 bool is(DwVfpRegister reg) const { return reg_code == reg.reg_code; } |
| 215 int code() const { | 218 int code() const { |
| 216 DCHECK(is_valid()); | 219 DCHECK(is_valid()); |
| 217 return reg_code; | 220 return reg_code; |
| 218 } | 221 } |
| 219 int bit() const { | 222 int bit() const { |
| 220 DCHECK(is_valid()); | 223 DCHECK(is_valid()); |
| 221 return 1 << reg_code; | 224 return 1 << reg_code; |
| 222 } | 225 } |
| (...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 explicit EnsureSpace(Assembler* assembler) { | 1694 explicit EnsureSpace(Assembler* assembler) { |
| 1692 assembler->CheckBuffer(); | 1695 assembler->CheckBuffer(); |
| 1693 } | 1696 } |
| 1694 }; | 1697 }; |
| 1695 | 1698 |
| 1696 | 1699 |
| 1697 } // namespace internal | 1700 } // namespace internal |
| 1698 } // namespace v8 | 1701 } // namespace v8 |
| 1699 | 1702 |
| 1700 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1703 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |