OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 EmitUint8(0xC7); | 271 EmitUint8(0xC7); |
272 EmitOperand(0, operand); | 272 EmitOperand(0, operand); |
273 } else { | 273 } else { |
274 EmitRegisterREX(dst, REX_W); | 274 EmitRegisterREX(dst, REX_W); |
275 EmitUint8(0xB8 | (dst & 7)); | 275 EmitUint8(0xB8 | (dst & 7)); |
276 } | 276 } |
277 EmitImmediate(imm); | 277 EmitImmediate(imm); |
278 } | 278 } |
279 | 279 |
280 | 280 |
281 // Use 0x89 encoding (instead of 0x8B encoding), which is expected by gdb64 | |
282 // older than 7.3.1-gg5 when disassembling a function's prolog (movq rbp, rsp) | |
283 // for proper unwinding of Dart frames (use --generate_gdb_symbols and -O0). | |
281 void Assembler::movq(Register dst, Register src) { | 284 void Assembler::movq(Register dst, Register src) { |
282 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 285 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
283 Operand operand(src); | 286 Operand operand(dst); |
284 EmitOperandREX(dst, operand, REX_W); | 287 EmitOperandREX(src, operand, REX_W); |
285 EmitUint8(0x8B); | 288 EmitUint8(0x89); |
Lasse Reichstein Nielsen
2012/04/12 09:57:38
You could decide whether to use 0x89 or 0x8b depen
regis
2012/04/12 16:46:16
This is a good point for memory addressing modes,
| |
286 EmitOperand(dst & 7, operand); | 289 EmitOperand(src & 7, operand); |
287 } | 290 } |
288 | 291 |
289 | 292 |
290 void Assembler::movq(Register dst, const Address& src) { | 293 void Assembler::movq(Register dst, const Address& src) { |
291 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 294 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
292 EmitOperandREX(dst, src, REX_W); | 295 EmitOperandREX(dst, src, REX_W); |
293 EmitUint8(0x8B); | 296 EmitUint8(0x8B); |
294 EmitOperand(dst & 7, src); | 297 EmitOperand(dst & 7, src); |
295 } | 298 } |
296 | 299 |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1504 } else { | 1507 } else { |
1505 EmitRegisterREX(operand, REX_NONE); | 1508 EmitRegisterREX(operand, REX_NONE); |
1506 } | 1509 } |
1507 EmitUint8(0xD3); | 1510 EmitUint8(0xD3); |
1508 EmitOperand(rm, Operand(operand)); | 1511 EmitOperand(rm, Operand(operand)); |
1509 } | 1512 } |
1510 | 1513 |
1511 } // namespace dart | 1514 } // namespace dart |
1512 | 1515 |
1513 #endif // defined TARGET_ARCH_X64 | 1516 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |