| 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 #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 2649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 } | 2660 } |
| 2661 } | 2661 } |
| 2662 | 2662 |
| 2663 | 2663 |
| 2664 void Assembler::LeaveFrame() { | 2664 void Assembler::LeaveFrame() { |
| 2665 movq(RSP, RBP); | 2665 movq(RSP, RBP); |
| 2666 popq(RBP); | 2666 popq(RBP); |
| 2667 } | 2667 } |
| 2668 | 2668 |
| 2669 | 2669 |
| 2670 void Assembler::ReturnPatchable() { | |
| 2671 // This sequence must have a fixed size so that it can be patched by the | |
| 2672 // debugger. | |
| 2673 intptr_t start = buffer_.GetPosition(); | |
| 2674 LeaveDartFrame(); | |
| 2675 ret(); | |
| 2676 nop(4); | |
| 2677 ASSERT((buffer_.GetPosition() - start) == 13); | |
| 2678 } | |
| 2679 | |
| 2680 | |
| 2681 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { | 2670 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { |
| 2682 // Reserve space for arguments and align frame before entering | 2671 // Reserve space for arguments and align frame before entering |
| 2683 // the C++ world. | 2672 // the C++ world. |
| 2684 if (frame_space != 0) { | 2673 if (frame_space != 0) { |
| 2685 subq(RSP, Immediate(frame_space)); | 2674 subq(RSP, Immediate(frame_space)); |
| 2686 } | 2675 } |
| 2687 if (OS::ActivationFrameAlignment() > 1) { | 2676 if (OS::ActivationFrameAlignment() > 1) { |
| 2688 andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 2677 andq(RSP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 2689 } | 2678 } |
| 2690 } | 2679 } |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3100 | 3089 |
| 3101 | 3090 |
| 3102 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 3091 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 3103 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 3092 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 3104 return xmm_reg_names[reg]; | 3093 return xmm_reg_names[reg]; |
| 3105 } | 3094 } |
| 3106 | 3095 |
| 3107 } // namespace dart | 3096 } // namespace dart |
| 3108 | 3097 |
| 3109 #endif // defined TARGET_ARCH_X64 | 3098 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |