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