| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 EmitOperand(0, operand); | 321 EmitOperand(0, operand); |
| 322 } else { | 322 } else { |
| 323 EmitRegisterREX(dst, REX_W); | 323 EmitRegisterREX(dst, REX_W); |
| 324 EmitUint8(0xB8 | (dst & 7)); | 324 EmitUint8(0xB8 | (dst & 7)); |
| 325 } | 325 } |
| 326 EmitImmediate(imm); | 326 EmitImmediate(imm); |
| 327 } | 327 } |
| 328 | 328 |
| 329 | 329 |
| 330 // Use 0x89 encoding (instead of 0x8B encoding), which is expected by gdb64 | 330 // Use 0x89 encoding (instead of 0x8B encoding), which is expected by gdb64 |
| 331 // older than 7.3.1-gg5 when disassembling a function's prolog (movq rbp, rsp) | 331 // older than 7.3.1-gg5 when disassembling a function's prologue (movq rbp, rsp) |
| 332 // for proper unwinding of Dart frames (use --generate_gdb_symbols and -O0). | 332 // for proper unwinding of Dart frames (use --generate_gdb_symbols and -O0). |
| 333 void Assembler::movq(Register dst, Register src) { | 333 void Assembler::movq(Register dst, Register src) { |
| 334 AssemblerBuffer::EnsureCapacity ensured(&buffer_); | 334 AssemblerBuffer::EnsureCapacity ensured(&buffer_); |
| 335 Operand operand(dst); | 335 Operand operand(dst); |
| 336 EmitOperandREX(src, operand, REX_W); | 336 EmitOperandREX(src, operand, REX_W); |
| 337 EmitUint8(0x89); | 337 EmitUint8(0x89); |
| 338 EmitOperand(src & 7, operand); | 338 EmitOperand(src & 7, operand); |
| 339 } | 339 } |
| 340 | 340 |
| 341 | 341 |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 int position = label->NearPosition(); | 1792 int position = label->NearPosition(); |
| 1793 int offset = bound - (position + 1); | 1793 int offset = bound - (position + 1); |
| 1794 ASSERT(Utils::IsInt(8, offset)); | 1794 ASSERT(Utils::IsInt(8, offset)); |
| 1795 buffer_.Store<int8_t>(position, offset); | 1795 buffer_.Store<int8_t>(position, offset); |
| 1796 } | 1796 } |
| 1797 label->BindTo(bound); | 1797 label->BindTo(bound); |
| 1798 } | 1798 } |
| 1799 | 1799 |
| 1800 | 1800 |
| 1801 void Assembler::EnterFrame(intptr_t frame_size) { | 1801 void Assembler::EnterFrame(intptr_t frame_size) { |
| 1802 if (prolog_offset_ == -1) { | 1802 if (prologue_offset_ == -1) { |
| 1803 prolog_offset_ = CodeSize(); | 1803 prologue_offset_ = CodeSize(); |
| 1804 } | 1804 } |
| 1805 pushq(RBP); | 1805 pushq(RBP); |
| 1806 movq(RBP, RSP); | 1806 movq(RBP, RSP); |
| 1807 if (frame_size != 0) { | 1807 if (frame_size != 0) { |
| 1808 Immediate frame_space(frame_size); | 1808 Immediate frame_space(frame_size); |
| 1809 subq(RSP, frame_space); | 1809 subq(RSP, frame_space); |
| 1810 } | 1810 } |
| 1811 } | 1811 } |
| 1812 | 1812 |
| 1813 | 1813 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 | 2110 |
| 2111 const char* Assembler::XmmRegisterName(XmmRegister reg) { | 2111 const char* Assembler::XmmRegisterName(XmmRegister reg) { |
| 2112 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2112 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 2113 return xmm_reg_names[reg]; | 2113 return xmm_reg_names[reg]; |
| 2114 } | 2114 } |
| 2115 | 2115 |
| 2116 | 2116 |
| 2117 } // namespace dart | 2117 } // namespace dart |
| 2118 | 2118 |
| 2119 #endif // defined TARGET_ARCH_X64 | 2119 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |