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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 } | 755 } |
756 | 756 |
757 bool CanLoadImmediateFromPool(const Immediate& imm, Register pp); | 757 bool CanLoadImmediateFromPool(const Immediate& imm, Register pp); |
758 void LoadImmediate(Register reg, const Immediate& imm, Register pp); | 758 void LoadImmediate(Register reg, const Immediate& imm, Register pp); |
759 void LoadIsolate(Register dst); | 759 void LoadIsolate(Register dst); |
760 void LoadObject(Register dst, const Object& obj, Register pp); | 760 void LoadObject(Register dst, const Object& obj, Register pp); |
761 void JmpPatchable(const ExternalLabel* label, Register pp); | 761 void JmpPatchable(const ExternalLabel* label, Register pp); |
762 void Jmp(const ExternalLabel* label, Register pp); | 762 void Jmp(const ExternalLabel* label, Register pp); |
763 void J(Condition condition, const ExternalLabel* label, Register pp); | 763 void J(Condition condition, const ExternalLabel* label, Register pp); |
764 void CallPatchable(const ExternalLabel* label); | 764 void CallPatchable(const ExternalLabel* label); |
765 void Call(const ExternalLabel* label, Register pp); | 765 void Call(const ExternalLabel* label, Register pp, bool emit_fixup = true); |
766 // Unaware of write barrier (use StoreInto* methods for storing to objects). | 766 // Unaware of write barrier (use StoreInto* methods for storing to objects). |
767 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse. | 767 // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse. |
768 void StoreObject(const Address& dst, const Object& obj, Register pp); | 768 void StoreObject(const Address& dst, const Object& obj, Register pp); |
769 void PushObject(const Object& object, Register pp); | 769 void PushObject(const Object& object, Register pp); |
770 void CompareObject(Register reg, const Object& object, Register pp); | 770 void CompareObject(Register reg, const Object& object, Register pp); |
771 | 771 |
772 // When storing into a heap object field, knowledge of the previous content | 772 // When storing into a heap object field, knowledge of the previous content |
773 // is expressed through these constants. | 773 // is expressed through these constants. |
774 enum FieldContent { | 774 enum FieldContent { |
775 kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode. | 775 kEmptyOrSmiOrNull, // Empty = garbage/zapped in release/debug mode. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 | 890 |
891 // Count the fixups that produce a pointer offset, without processing | 891 // Count the fixups that produce a pointer offset, without processing |
892 // the fixups. | 892 // the fixups. |
893 intptr_t CountPointerOffsets() const { | 893 intptr_t CountPointerOffsets() const { |
894 return buffer_.CountPointerOffsets(); | 894 return buffer_.CountPointerOffsets(); |
895 } | 895 } |
896 | 896 |
897 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { | 897 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { |
898 return buffer_.pointer_offsets(); | 898 return buffer_.pointer_offsets(); |
899 } | 899 } |
900 const GrowableObjectArray& object_pool_data() const { | |
901 return object_pool_.data(); | |
902 } | |
903 | 900 |
904 ObjectPool& object_pool() { return object_pool_; } | 901 ObjectPoolHelper& object_pool() { return object_pool_; } |
905 | 902 |
906 void FinalizeInstructions(const MemoryRegion& region) { | 903 void FinalizeInstructions(const MemoryRegion& region) { |
907 buffer_.FinalizeInstructions(region); | 904 buffer_.FinalizeInstructions(region); |
908 } | 905 } |
909 | 906 |
910 void LoadPoolPointer(Register pp); | 907 void LoadPoolPointer(Register pp); |
911 | 908 |
912 // Set up a Dart frame on entry with a frame pointer and PC information to | 909 // Set up a Dart frame on entry with a frame pointer and PC information to |
913 // enable easy access to the RawInstruction object of code corresponding | 910 // enable easy access to the RawInstruction object of code corresponding |
914 // to this frame. | 911 // to this frame. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 intptr_t cid, | 1015 intptr_t cid, |
1019 intptr_t index_scale, | 1016 intptr_t index_scale, |
1020 Register array, | 1017 Register array, |
1021 Register index); | 1018 Register index); |
1022 | 1019 |
1023 // On some other platforms, we draw a distinction between safe and unsafe | 1020 // On some other platforms, we draw a distinction between safe and unsafe |
1024 // smis. | 1021 // smis. |
1025 static bool IsSafe(const Object& object) { return true; } | 1022 static bool IsSafe(const Object& object) { return true; } |
1026 static bool IsSafeSmi(const Object& object) { return object.IsSmi(); } | 1023 static bool IsSafeSmi(const Object& object) { return object.IsSmi(); } |
1027 | 1024 |
| 1025 static const int kNumFixedObjectEntries = 3; |
| 1026 static const int kNumFixedEntries = 5; |
| 1027 COMPILE_ASSERT(kNumFixedObjectEntries <= kNumFixedEntries); |
| 1028 |
1028 private: | 1029 private: |
1029 AssemblerBuffer buffer_; | 1030 AssemblerBuffer buffer_; |
1030 | 1031 |
1031 // Objects and jump targets. | 1032 // Objects and jump targets. |
1032 ObjectPool object_pool_; | 1033 ObjectPoolHelper object_pool_; |
1033 | 1034 |
1034 intptr_t prologue_offset_; | 1035 intptr_t prologue_offset_; |
1035 | 1036 |
1036 class CodeComment : public ZoneAllocated { | 1037 class CodeComment : public ZoneAllocated { |
1037 public: | 1038 public: |
1038 CodeComment(intptr_t pc_offset, const String& comment) | 1039 CodeComment(intptr_t pc_offset, const String& comment) |
1039 : pc_offset_(pc_offset), comment_(comment) { } | 1040 : pc_offset_(pc_offset), comment_(comment) { } |
1040 | 1041 |
1041 intptr_t pc_offset() const { return pc_offset_; } | 1042 intptr_t pc_offset() const { return pc_offset_; } |
1042 const String& comment() const { return comment_; } | 1043 const String& comment() const { return comment_; } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 } | 1191 } |
1191 | 1192 |
1192 | 1193 |
1193 inline void Assembler::EmitOperandSizeOverride() { | 1194 inline void Assembler::EmitOperandSizeOverride() { |
1194 EmitUint8(0x66); | 1195 EmitUint8(0x66); |
1195 } | 1196 } |
1196 | 1197 |
1197 } // namespace dart | 1198 } // namespace dart |
1198 | 1199 |
1199 #endif // VM_ASSEMBLER_X64_H_ | 1200 #endif // VM_ASSEMBLER_X64_H_ |
OLD | NEW |