| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_ASSEMBLER_X64_H_ | 5 #ifndef VM_ASSEMBLER_X64_H_ |
| 6 #define VM_ASSEMBLER_X64_H_ | 6 #define VM_ASSEMBLER_X64_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_x64.h directly; use assembler.h instead. | 9 #error Do not include assembler_x64.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 SetDisp8(disp); | 178 SetDisp8(disp); |
| 179 } else { | 179 } else { |
| 180 SetModRM(2, base); | 180 SetModRM(2, base); |
| 181 if ((base & 7) == RSP) { | 181 if ((base & 7) == RSP) { |
| 182 SetSIB(TIMES_1, RSP, base); | 182 SetSIB(TIMES_1, RSP, base); |
| 183 } | 183 } |
| 184 SetDisp32(disp); | 184 SetDisp32(disp); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 // This addressing mode does not exist. |
| 189 Address(Register base, Register r); |
| 190 |
| 188 Address(Register index, ScaleFactor scale, int32_t disp) { | 191 Address(Register index, ScaleFactor scale, int32_t disp) { |
| 189 ASSERT(index != RSP); // Illegal addressing mode. | 192 ASSERT(index != RSP); // Illegal addressing mode. |
| 190 SetModRM(0, RSP); | 193 SetModRM(0, RSP); |
| 191 SetSIB(scale, index, RBP); | 194 SetSIB(scale, index, RBP); |
| 192 SetDisp32(disp); | 195 SetDisp32(disp); |
| 193 } | 196 } |
| 194 | 197 |
| 198 // This addressing mode does not exist. |
| 199 Address(Register index, ScaleFactor scale, Register r); |
| 200 |
| 195 Address(Register base, Register index, ScaleFactor scale, int32_t disp) { | 201 Address(Register base, Register index, ScaleFactor scale, int32_t disp) { |
| 196 ASSERT(index != RSP); // Illegal addressing mode. | 202 ASSERT(index != RSP); // Illegal addressing mode. |
| 197 if ((disp == 0) && ((base & 7) != RBP)) { | 203 if ((disp == 0) && ((base & 7) != RBP)) { |
| 198 SetModRM(0, RSP); | 204 SetModRM(0, RSP); |
| 199 SetSIB(scale, index, base); | 205 SetSIB(scale, index, base); |
| 200 } else if (Utils::IsInt(8, disp)) { | 206 } else if (Utils::IsInt(8, disp)) { |
| 201 SetModRM(1, RSP); | 207 SetModRM(1, RSP); |
| 202 SetSIB(scale, index, base); | 208 SetSIB(scale, index, base); |
| 203 SetDisp8(disp); | 209 SetDisp8(disp); |
| 204 } else { | 210 } else { |
| 205 SetModRM(2, RSP); | 211 SetModRM(2, RSP); |
| 206 SetSIB(scale, index, base); | 212 SetSIB(scale, index, base); |
| 207 SetDisp32(disp); | 213 SetDisp32(disp); |
| 208 } | 214 } |
| 209 } | 215 } |
| 210 | 216 |
| 217 // This addressing mode does not exist. |
| 218 Address(Register base, Register index, ScaleFactor scale, Register r); |
| 219 |
| 211 Address(const Address& other) : Operand(other) { } | 220 Address(const Address& other) : Operand(other) { } |
| 212 | 221 |
| 213 Address& operator=(const Address& other) { | 222 Address& operator=(const Address& other) { |
| 214 Operand::operator=(other); | 223 Operand::operator=(other); |
| 215 return *this; | 224 return *this; |
| 216 } | 225 } |
| 217 | 226 |
| 218 static Address AddressBaseImm32(Register base, int32_t disp) { | 227 static Address AddressBaseImm32(Register base, int32_t disp) { |
| 219 return Address(base, disp, true); | 228 return Address(base, disp, true); |
| 220 } | 229 } |
| 221 | 230 |
| 231 // This addressing mode does not exist. |
| 232 static Address AddressBaseImm32(Register base, Register r); |
| 233 |
| 222 private: | 234 private: |
| 223 Address(Register base, int32_t disp, bool fixed) { | 235 Address(Register base, int32_t disp, bool fixed) { |
| 224 ASSERT(fixed); | 236 ASSERT(fixed); |
| 225 SetModRM(2, base); | 237 SetModRM(2, base); |
| 226 if ((base & 7) == RSP) { | 238 if ((base & 7) == RSP) { |
| 227 SetSIB(TIMES_1, RSP, base); | 239 SetSIB(TIMES_1, RSP, base); |
| 228 } | 240 } |
| 229 SetDisp32(disp); | 241 SetDisp32(disp); |
| 230 } | 242 } |
| 231 }; | 243 }; |
| 232 | 244 |
| 233 | 245 |
| 234 class FieldAddress : public Address { | 246 class FieldAddress : public Address { |
| 235 public: | 247 public: |
| 236 FieldAddress(Register base, int32_t disp) | 248 FieldAddress(Register base, int32_t disp) |
| 237 : Address(base, disp - kHeapObjectTag) { } | 249 : Address(base, disp - kHeapObjectTag) { } |
| 238 | 250 |
| 251 // This addressing mode does not exist. |
| 252 FieldAddress(Register base, Register r); |
| 253 |
| 239 FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp) | 254 FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp) |
| 240 : Address(base, index, scale, disp - kHeapObjectTag) { } | 255 : Address(base, index, scale, disp - kHeapObjectTag) { } |
| 241 | 256 |
| 257 // This addressing mode does not exist. |
| 258 FieldAddress(Register base, Register index, ScaleFactor scale, Register r); |
| 259 |
| 242 FieldAddress(const FieldAddress& other) : Address(other) { } | 260 FieldAddress(const FieldAddress& other) : Address(other) { } |
| 243 | 261 |
| 244 FieldAddress& operator=(const FieldAddress& other) { | 262 FieldAddress& operator=(const FieldAddress& other) { |
| 245 Address::operator=(other); | 263 Address::operator=(other); |
| 246 return *this; | 264 return *this; |
| 247 } | 265 } |
| 248 }; | 266 }; |
| 249 | 267 |
| 250 | 268 |
| 251 class Label : public ValueObject { | 269 class Label : public ValueObject { |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 } | 1146 } |
| 1129 | 1147 |
| 1130 | 1148 |
| 1131 inline void Assembler::EmitOperandSizeOverride() { | 1149 inline void Assembler::EmitOperandSizeOverride() { |
| 1132 EmitUint8(0x66); | 1150 EmitUint8(0x66); |
| 1133 } | 1151 } |
| 1134 | 1152 |
| 1135 } // namespace dart | 1153 } // namespace dart |
| 1136 | 1154 |
| 1137 #endif // VM_ASSEMBLER_X64_H_ | 1155 #endif // VM_ASSEMBLER_X64_H_ |
| OLD | NEW |