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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 }; | 110 }; |
111 | 111 |
112 static const int kNumRegisters = Code::kAfterLast; | 112 static const int kNumRegisters = Code::kAfterLast; |
113 | 113 |
114 static Register from_code(int code) { | 114 static Register from_code(int code) { |
115 DCHECK(code >= 0); | 115 DCHECK(code >= 0); |
116 DCHECK(code < kNumRegisters); | 116 DCHECK(code < kNumRegisters); |
117 Register r = {code}; | 117 Register r = {code}; |
118 return r; | 118 return r; |
119 } | 119 } |
120 const char* ToString(); | |
121 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
122 RegisterConfiguration::CRANKSHAFT) const; | |
123 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 120 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
124 bool is(Register reg) const { return reg_code == reg.reg_code; } | 121 bool is(Register reg) const { return reg_code == reg.reg_code; } |
125 int code() const { | 122 int code() const { |
126 DCHECK(is_valid()); | 123 DCHECK(is_valid()); |
127 return reg_code; | 124 return reg_code; |
128 } | 125 } |
129 int bit() const { | 126 int bit() const { |
130 DCHECK(is_valid()); | 127 DCHECK(is_valid()); |
131 return 1 << reg_code; | 128 return 1 << reg_code; |
132 } | 129 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 kCode_no_reg = -1 | 211 kCode_no_reg = -1 |
215 }; | 212 }; |
216 | 213 |
217 static const int kMaxNumRegisters = Code::kAfterLast; | 214 static const int kMaxNumRegisters = Code::kAfterLast; |
218 | 215 |
219 static XMMRegister from_code(int code) { | 216 static XMMRegister from_code(int code) { |
220 XMMRegister result = {code}; | 217 XMMRegister result = {code}; |
221 return result; | 218 return result; |
222 } | 219 } |
223 | 220 |
224 const char* ToString(); | |
225 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
226 RegisterConfiguration::CRANKSHAFT) const; | |
227 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 221 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
228 bool is(XMMRegister reg) const { return reg_code == reg.reg_code; } | 222 bool is(XMMRegister reg) const { return reg_code == reg.reg_code; } |
229 int code() const { | 223 int code() const { |
230 DCHECK(is_valid()); | 224 DCHECK(is_valid()); |
231 return reg_code; | 225 return reg_code; |
232 } | 226 } |
233 | 227 |
234 // Return the high bit of the register code as a 0 or 1. Used often | 228 // Return the high bit of the register code as a 0 or 1. Used often |
235 // when constructing the REX prefix byte. | 229 // when constructing the REX prefix byte. |
236 int high_bit() const { return reg_code >> 3; } | 230 int high_bit() const { return reg_code >> 3; } |
(...skipping 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 Assembler* assembler_; | 2277 Assembler* assembler_; |
2284 #ifdef DEBUG | 2278 #ifdef DEBUG |
2285 int space_before_; | 2279 int space_before_; |
2286 #endif | 2280 #endif |
2287 }; | 2281 }; |
2288 | 2282 |
2289 } // namespace internal | 2283 } // namespace internal |
2290 } // namespace v8 | 2284 } // namespace v8 |
2291 | 2285 |
2292 #endif // V8_X64_ASSEMBLER_X64_H_ | 2286 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |