| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 static const int kNumRegisters = Code::kAfterLast; | 117 static const int kNumRegisters = Code::kAfterLast; |
| 118 | 118 |
| 119 static Register from_code(int code) { | 119 static Register from_code(int code) { |
| 120 DCHECK(code >= 0); | 120 DCHECK(code >= 0); |
| 121 DCHECK(code < kNumRegisters); | 121 DCHECK(code < kNumRegisters); |
| 122 Register r = {code}; | 122 Register r = {code}; |
| 123 return r; | 123 return r; |
| 124 } | 124 } |
| 125 const char* ToString(); | |
| 126 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
| 127 RegisterConfiguration::CRANKSHAFT) const; | |
| 128 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 125 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 129 bool is(Register reg) const { return reg_code == reg.reg_code; } | 126 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 130 int code() const { | 127 int code() const { |
| 131 DCHECK(is_valid()); | 128 DCHECK(is_valid()); |
| 132 return reg_code; | 129 return reg_code; |
| 133 } | 130 } |
| 134 int bit() const { | 131 int bit() const { |
| 135 DCHECK(is_valid()); | 132 DCHECK(is_valid()); |
| 136 return 1 << reg_code; | 133 return 1 << reg_code; |
| 137 } | 134 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 160 }; | 157 }; |
| 161 | 158 |
| 162 static const int kMaxNumRegisters = Code::kAfterLast; | 159 static const int kMaxNumRegisters = Code::kAfterLast; |
| 163 static const int kMaxNumAllocatableRegisters = 6; | 160 static const int kMaxNumAllocatableRegisters = 6; |
| 164 | 161 |
| 165 static X87Register from_code(int code) { | 162 static X87Register from_code(int code) { |
| 166 X87Register result = {code}; | 163 X87Register result = {code}; |
| 167 return result; | 164 return result; |
| 168 } | 165 } |
| 169 | 166 |
| 170 bool IsAllocatable(RegisterConfiguration::CompilerSelector compiler = | |
| 171 RegisterConfiguration::CRANKSHAFT) const; | |
| 172 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } | 167 bool is_valid() const { return 0 <= reg_code && reg_code < kMaxNumRegisters; } |
| 173 | 168 |
| 174 int code() const { | 169 int code() const { |
| 175 DCHECK(is_valid()); | 170 DCHECK(is_valid()); |
| 176 return reg_code; | 171 return reg_code; |
| 177 } | 172 } |
| 178 | 173 |
| 179 bool is(X87Register reg) const { return reg_code == reg.reg_code; } | 174 bool is(X87Register reg) const { return reg_code == reg.reg_code; } |
| 180 | 175 |
| 181 const char* ToString(); | |
| 182 | |
| 183 int reg_code; | 176 int reg_code; |
| 184 }; | 177 }; |
| 185 | 178 |
| 186 typedef X87Register FloatRegister; | 179 typedef X87Register FloatRegister; |
| 187 | 180 |
| 188 typedef X87Register DoubleRegister; | 181 typedef X87Register DoubleRegister; |
| 189 | 182 |
| 190 // TODO(x87) Define SIMD registers. | 183 // TODO(x87) Define SIMD registers. |
| 191 typedef X87Register Simd128Register; | 184 typedef X87Register Simd128Register; |
| 192 | 185 |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 Assembler* assembler_; | 1109 Assembler* assembler_; |
| 1117 #ifdef DEBUG | 1110 #ifdef DEBUG |
| 1118 int space_before_; | 1111 int space_before_; |
| 1119 #endif | 1112 #endif |
| 1120 }; | 1113 }; |
| 1121 | 1114 |
| 1122 } // namespace internal | 1115 } // namespace internal |
| 1123 } // namespace v8 | 1116 } // namespace v8 |
| 1124 | 1117 |
| 1125 #endif // V8_X87_ASSEMBLER_X87_H_ | 1118 #endif // V8_X87_ASSEMBLER_X87_H_ |
| OLD | NEW |