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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 int prologue_offset() const { return prologue_offset_; } | 694 int prologue_offset() const { return prologue_offset_; } |
695 const ZoneGrowableArray<int>& GetPointerOffsets() const { | 695 const ZoneGrowableArray<int>& GetPointerOffsets() const { |
696 return buffer_.pointer_offsets(); | 696 return buffer_.pointer_offsets(); |
697 } | 697 } |
698 const GrowableObjectArray& object_pool() const { return object_pool_; } | 698 const GrowableObjectArray& object_pool() const { return object_pool_; } |
699 | 699 |
700 void FinalizeInstructions(const MemoryRegion& region) { | 700 void FinalizeInstructions(const MemoryRegion& region) { |
701 buffer_.FinalizeInstructions(region); | 701 buffer_.FinalizeInstructions(region); |
702 } | 702 } |
703 | 703 |
| 704 // Set up a Dart frame on entry with a frame pointer and PC information to |
| 705 // enable easy access to the RawInstruction object of code corresponding |
| 706 // to this frame. |
| 707 // The dart frame layout is as follows: |
| 708 // .... |
| 709 // ret PC |
| 710 // saved RBP <=== RBP |
| 711 // pc (used to derive the RawInstruction Object of the dart code) |
| 712 // locals space <=== RSP |
| 713 // ..... |
| 714 // This code sets this up with the sequence: |
| 715 // pushq rbp |
| 716 // movq rbp, rsp |
| 717 // call L |
| 718 // L: <code to adjust saved pc if there is any intrinsification code> |
| 719 // ..... |
| 720 void EnterDartFrame(intptr_t frame_size); |
| 721 |
| 722 // Set up a stub frame so that the stack traversal code can easily identify |
| 723 // a stub frame. |
| 724 // The stub frame layout is as follows: |
| 725 // .... |
| 726 // ret PC |
| 727 // saved RBP |
| 728 // pc (used to derive the RawInstruction Object of the stub) |
| 729 // ..... |
| 730 // This code sets this up with the sequence: |
| 731 // pushq rbp |
| 732 // movq rbp, rsp |
| 733 // pushq immediate(0) |
| 734 // ..... |
| 735 void EnterStubFrame(); |
| 736 |
| 737 // Instruction pattern from entrypoint is used in dart frame prologs |
| 738 // to set up the frame and save a PC which can be used to figure out the |
| 739 // RawInstruction object corresponding to the code running in the frame. |
| 740 // entrypoint: |
| 741 // pushq rbp (size is 1 byte) |
| 742 // movq rbp, rsp (size is 3 bytes) |
| 743 // call L (size is 5 bytes) |
| 744 // L: |
| 745 static const intptr_t kOffsetOfSavedPCfromEntrypoint = 9; |
| 746 |
| 747 // Inlined allocation of an instance of class 'cls', code has no runtime |
| 748 // calls. Jump to 'failure' if the instance cannot be allocated here. |
| 749 // Allocated instance is returned in 'instance_reg'. |
| 750 // Only the tags field of the object is initialized. |
| 751 void TryAllocate(const Class& cls, |
| 752 Label* failure, |
| 753 bool near_jump, |
| 754 Register instance_reg); |
| 755 |
704 // Debugging and bringup support. | 756 // Debugging and bringup support. |
705 void Stop(const char* message); | 757 void Stop(const char* message); |
706 void Unimplemented(const char* message); | 758 void Unimplemented(const char* message); |
707 void Untested(const char* message); | 759 void Untested(const char* message); |
708 void Unreachable(const char* message); | 760 void Unreachable(const char* message); |
709 | 761 |
710 static void InitializeMemoryWithBreakpoints(uword data, int length); | 762 static void InitializeMemoryWithBreakpoints(uword data, int length); |
711 | 763 |
712 static const char* RegisterName(Register reg); | 764 static const char* RegisterName(Register reg); |
713 | 765 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 897 } |
846 | 898 |
847 | 899 |
848 inline void Assembler::EmitOperandSizeOverride() { | 900 inline void Assembler::EmitOperandSizeOverride() { |
849 EmitUint8(0x66); | 901 EmitUint8(0x66); |
850 } | 902 } |
851 | 903 |
852 } // namespace dart | 904 } // namespace dart |
853 | 905 |
854 #endif // VM_ASSEMBLER_X64_H_ | 906 #endif // VM_ASSEMBLER_X64_H_ |
OLD | NEW |