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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 #undef REGISTER_BIT | 139 #undef REGISTER_BIT |
140 | 140 |
141 static Register from_code(int code) { | 141 static Register from_code(int code) { |
142 DCHECK(code >= 0); | 142 DCHECK(code >= 0); |
143 DCHECK(code < kNumRegisters); | 143 DCHECK(code < kNumRegisters); |
144 Register r = {code}; | 144 Register r = {code}; |
145 return r; | 145 return r; |
146 } | 146 } |
147 | 147 |
148 const char* ToString(); | 148 const char* ToString(); |
149 bool IsAllocatable() const; | 149 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 150 RegisterConfiguration::CRANKSHAFT) const; |
150 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 151 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
151 bool is(Register reg) const { return reg_code == reg.reg_code; } | 152 bool is(Register reg) const { return reg_code == reg.reg_code; } |
152 int code() const { | 153 int code() const { |
153 DCHECK(is_valid()); | 154 DCHECK(is_valid()); |
154 return reg_code; | 155 return reg_code; |
155 } | 156 } |
156 int bit() const { | 157 int bit() const { |
157 DCHECK(is_valid()); | 158 DCHECK(is_valid()); |
158 return 1 << reg_code; | 159 return 1 << reg_code; |
159 } | 160 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 DOUBLE_REGISTERS(REGISTER_CODE) | 195 DOUBLE_REGISTERS(REGISTER_CODE) |
195 #undef REGISTER_CODE | 196 #undef REGISTER_CODE |
196 kAfterLast, | 197 kAfterLast, |
197 kCode_no_reg = -1 | 198 kCode_no_reg = -1 |
198 }; | 199 }; |
199 | 200 |
200 static const int kNumRegisters = Code::kAfterLast; | 201 static const int kNumRegisters = Code::kAfterLast; |
201 static const int kMaxNumRegisters = kNumRegisters; | 202 static const int kMaxNumRegisters = kNumRegisters; |
202 | 203 |
203 const char* ToString(); | 204 const char* ToString(); |
204 bool IsAllocatable() const; | 205 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = |
| 206 RegisterConfiguration::CRANKSHAFT) const; |
205 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 207 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
206 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } | 208 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } |
207 | 209 |
208 int code() const { | 210 int code() const { |
209 DCHECK(is_valid()); | 211 DCHECK(is_valid()); |
210 return reg_code; | 212 return reg_code; |
211 } | 213 } |
212 | 214 |
213 int bit() const { | 215 int bit() const { |
214 DCHECK(is_valid()); | 216 DCHECK(is_valid()); |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 | 1460 |
1459 class EnsureSpace BASE_EMBEDDED { | 1461 class EnsureSpace BASE_EMBEDDED { |
1460 public: | 1462 public: |
1461 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } | 1463 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } |
1462 }; | 1464 }; |
1463 | 1465 |
1464 } // namespace internal | 1466 } // namespace internal |
1465 } // namespace v8 | 1467 } // namespace v8 |
1466 | 1468 |
1467 #endif // V8_S390_ASSEMBLER_S390_H_ | 1469 #endif // V8_S390_ASSEMBLER_S390_H_ |
OLD | NEW |