| 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 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 void DoubleAbs(XmmRegister reg); | 710 void DoubleAbs(XmmRegister reg); |
| 711 | 711 |
| 712 void LockCmpxchgl(const Address& address, Register reg) { | 712 void LockCmpxchgl(const Address& address, Register reg) { |
| 713 lock(); | 713 lock(); |
| 714 cmpxchgl(address, reg); | 714 cmpxchgl(address, reg); |
| 715 } | 715 } |
| 716 | 716 |
| 717 void EnterFrame(intptr_t frame_space); | 717 void EnterFrame(intptr_t frame_space); |
| 718 void LeaveFrame(); | 718 void LeaveFrame(); |
| 719 void LeaveFrameWithPP(); | |
| 720 void ReturnPatchable(); | 719 void ReturnPatchable(); |
| 721 void ReserveAlignedFrameSpace(intptr_t frame_space); | 720 void ReserveAlignedFrameSpace(intptr_t frame_space); |
| 722 | 721 |
| 723 // Create a frame for calling into runtime that preserves all volatile | 722 // Create a frame for calling into runtime that preserves all volatile |
| 724 // registers. Frame's RSP is guaranteed to be correctly aligned and | 723 // registers. Frame's RSP is guaranteed to be correctly aligned and |
| 725 // frame_space bytes are reserved under it. | 724 // frame_space bytes are reserved under it. |
| 726 void EnterCallRuntimeFrame(intptr_t frame_space); | 725 void EnterCallRuntimeFrame(intptr_t frame_space); |
| 727 void LeaveCallRuntimeFrame(); | 726 void LeaveCallRuntimeFrame(); |
| 728 | 727 |
| 729 | 728 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 buffer_.FinalizeInstructions(region); | 768 buffer_.FinalizeInstructions(region); |
| 770 } | 769 } |
| 771 | 770 |
| 772 void LoadPoolPointer(Register pp); | 771 void LoadPoolPointer(Register pp); |
| 773 | 772 |
| 774 // Set up a Dart frame on entry with a frame pointer and PC information to | 773 // Set up a Dart frame on entry with a frame pointer and PC information to |
| 775 // enable easy access to the RawInstruction object of code corresponding | 774 // enable easy access to the RawInstruction object of code corresponding |
| 776 // to this frame. | 775 // to this frame. |
| 777 // The dart frame layout is as follows: | 776 // The dart frame layout is as follows: |
| 778 // .... | 777 // .... |
| 778 // locals space <=== RSP |
| 779 // saved PP |
| 780 // pc (used to derive the RawInstruction Object of the dart code) |
| 781 // saved RBP <=== RBP |
| 779 // ret PC | 782 // ret PC |
| 780 // saved RBP <=== RBP | |
| 781 // pc (used to derive the RawInstruction Object of the dart code) | |
| 782 // saved PP | |
| 783 // locals space <=== RSP | |
| 784 // ..... | 783 // ..... |
| 785 // This code sets this up with the sequence: | 784 // This code sets this up with the sequence: |
| 786 // pushq rbp | 785 // pushq rbp |
| 787 // movq rbp, rsp | 786 // movq rbp, rsp |
| 788 // call L | 787 // call L |
| 789 // L: <code to adjust saved pc if there is any intrinsification code> | 788 // L: <code to adjust saved pc if there is any intrinsification code> |
| 790 // ... | 789 // ... |
| 791 // pushq r15 | 790 // pushq r15 |
| 792 // ..... | 791 // ..... |
| 793 void EnterDartFrame(intptr_t frame_size); | 792 void EnterDartFrame(intptr_t frame_size); |
| 794 void EnterDartFrameWithInfo(intptr_t frame_size, | 793 void EnterDartFrameWithInfo(intptr_t frame_size, |
| 795 Register new_pp, Register new_pc); | 794 Register new_pp, Register new_pc); |
| 795 void LeaveDartFrame(); |
| 796 | 796 |
| 797 // Set up a Dart frame for a function compiled for on-stack replacement. | 797 // Set up a Dart frame for a function compiled for on-stack replacement. |
| 798 // The frame layout is a normal Dart frame, but the frame is partially set | 798 // The frame layout is a normal Dart frame, but the frame is partially set |
| 799 // up on entry (it is the frame of the unoptimized code). | 799 // up on entry (it is the frame of the unoptimized code). |
| 800 void EnterOsrFrame(intptr_t extra_size, Register new_pp, Register new_pc); | 800 void EnterOsrFrame(intptr_t extra_size, Register new_pp, Register new_pc); |
| 801 | 801 |
| 802 // Set up a stub frame so that the stack traversal code can easily identify | 802 // Set up a stub frame so that the stack traversal code can easily identify |
| 803 // a stub frame. | 803 // a stub frame. |
| 804 // The stub frame layout is as follows: | 804 // The stub frame layout is as follows: |
| 805 // .... | 805 // .... <=== RSP |
| 806 // pc (used to derive the RawInstruction Object of the stub) |
| 807 // saved RBP <=== RBP |
| 806 // ret PC | 808 // ret PC |
| 807 // saved RBP | |
| 808 // pc (used to derive the RawInstruction Object of the stub) | |
| 809 // ..... | 809 // ..... |
| 810 // This code sets this up with the sequence: | 810 // This code sets this up with the sequence: |
| 811 // pushq rbp | 811 // pushq rbp |
| 812 // movq rbp, rsp | 812 // movq rbp, rsp |
| 813 // pushq immediate(0) | 813 // pushq immediate(0) |
| 814 // ..... | 814 // ..... |
| 815 void EnterStubFrame(); | 815 void EnterStubFrame(bool load_pp = false); |
| 816 void EnterStubFrameWithPP(); | 816 void LeaveStubFrame(); |
| 817 | 817 |
| 818 // Instruction pattern from entrypoint is used in dart frame prologues | 818 // Instruction pattern from entrypoint is used in dart frame prologues |
| 819 // to set up the frame and save a PC which can be used to figure out the | 819 // to set up the frame and save a PC which can be used to figure out the |
| 820 // RawInstruction object corresponding to the code running in the frame. | 820 // RawInstruction object corresponding to the code running in the frame. |
| 821 // entrypoint: | 821 // entrypoint: |
| 822 // pushq rbp (size is 1 byte) | 822 // pushq rbp (size is 1 byte) |
| 823 // movq rbp, rsp (size is 3 bytes) | 823 // movq rbp, rsp (size is 3 bytes) |
| 824 // call L (size is 5 bytes) | 824 // call L (size is 5 bytes) |
| 825 // L: | 825 // L: |
| 826 static const intptr_t kEntryPointToPcMarkerOffset = 9; | 826 static const intptr_t kEntryPointToPcMarkerOffset = 9; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 | 1051 |
| 1052 inline void Assembler::EmitOperandSizeOverride() { | 1052 inline void Assembler::EmitOperandSizeOverride() { |
| 1053 EmitUint8(0x66); | 1053 EmitUint8(0x66); |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 } // namespace dart | 1056 } // namespace dart |
| 1057 | 1057 |
| 1058 #endif // VM_ASSEMBLER_X64_H_ | 1058 #endif // VM_ASSEMBLER_X64_H_ |
| OLD | NEW |