| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 static const int kNumRegisters = Code::kAfterLast; | 119 static const int kNumRegisters = Code::kAfterLast; |
| 120 | 120 |
| 121 static Register from_code(int code) { | 121 static Register from_code(int code) { |
| 122 DCHECK(code >= 0); | 122 DCHECK(code >= 0); |
| 123 DCHECK(code < kNumRegisters); | 123 DCHECK(code < kNumRegisters); |
| 124 Register r = {code}; | 124 Register r = {code}; |
| 125 return r; | 125 return r; |
| 126 } | 126 } |
| 127 const char* ToString(); | |
| 128 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
| 129 RegisterConfiguration::CRANKSHAFT) const; | |
| 130 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 127 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 131 bool is(Register reg) const { return reg_code == reg.reg_code; } | 128 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 132 int code() const { | 129 int code() const { |
| 133 DCHECK(is_valid()); | 130 DCHECK(is_valid()); |
| 134 return reg_code; | 131 return reg_code; |
| 135 } | 132 } |
| 136 int bit() const { | 133 int bit() const { |
| 137 DCHECK(is_valid()); | 134 DCHECK(is_valid()); |
| 138 return 1 << reg_code; | 135 return 1 << reg_code; |
| 139 } | 136 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 161 kCode_no_reg = -1 | 158 kCode_no_reg = -1 |
| 162 }; | 159 }; |
| 163 | 160 |
| 164 static const int kMaxNumRegisters = Code::kAfterLast; | 161 static const int kMaxNumRegisters = Code::kAfterLast; |
| 165 | 162 |
| 166 static XMMRegister from_code(int code) { | 163 static XMMRegister from_code(int code) { |
| 167 XMMRegister result = {code}; | 164 XMMRegister result = {code}; |
| 168 return result; | 165 return result; |
| 169 } | 166 } |
| 170 | 167 |
| 171 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
| 172 RegisterConfiguration::CRANKSHAFT) const; | |
| 173 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 168 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
| 174 | 169 |
| 175 int code() const { | 170 int code() const { |
| 176 DCHECK(is_valid()); | 171 DCHECK(is_valid()); |
| 177 return reg_code; | 172 return reg_code; |
| 178 } | 173 } |
| 179 | 174 |
| 180 bool is(XMMRegister reg) const { return reg_code == reg.reg_code; } | 175 bool is(XMMRegister reg) const { return reg_code == reg.reg_code; } |
| 181 | 176 |
| 182 const char* ToString(); | |
| 183 | |
| 184 int reg_code; | 177 int reg_code; |
| 185 }; | 178 }; |
| 186 | 179 |
| 187 typedef XMMRegister FloatRegister; | 180 typedef XMMRegister FloatRegister; |
| 188 | 181 |
| 189 typedef XMMRegister DoubleRegister; | 182 typedef XMMRegister DoubleRegister; |
| 190 | 183 |
| 191 typedef XMMRegister Simd128Register; | 184 typedef XMMRegister Simd128Register; |
| 192 | 185 |
| 193 #define DECLARE_REGISTER(R) \ | 186 #define DECLARE_REGISTER(R) \ |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 Assembler* assembler_; | 1604 Assembler* assembler_; |
| 1612 #ifdef DEBUG | 1605 #ifdef DEBUG |
| 1613 int space_before_; | 1606 int space_before_; |
| 1614 #endif | 1607 #endif |
| 1615 }; | 1608 }; |
| 1616 | 1609 |
| 1617 } // namespace internal | 1610 } // namespace internal |
| 1618 } // namespace v8 | 1611 } // namespace v8 |
| 1619 | 1612 |
| 1620 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1613 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |