| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64_H_ | 5 #ifndef VM_ASSEMBLER_ARM64_H_ |
| 6 #define VM_ASSEMBLER_ARM64_H_ | 6 #define VM_ASSEMBLER_ARM64_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_arm64.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm64.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 } | 781 } |
| 782 | 782 |
| 783 void SmiUntag(Register reg) { | 783 void SmiUntag(Register reg) { |
| 784 Asr(reg, reg, kSmiTagSize); | 784 Asr(reg, reg, kSmiTagSize); |
| 785 } | 785 } |
| 786 void SmiTag(Register reg) { | 786 void SmiTag(Register reg) { |
| 787 Lsl(reg, reg, kSmiTagSize); | 787 Lsl(reg, reg, kSmiTagSize); |
| 788 } | 788 } |
| 789 | 789 |
| 790 // Branching to ExternalLabels. | 790 // Branching to ExternalLabels. |
| 791 void BranchPatchable(const ExternalLabel* label, Register pp) { | |
| 792 LoadExternalLabel(TMP, label, kPatchable, pp); | |
| 793 br(TMP); | |
| 794 } | |
| 795 | |
| 796 void Branch(const ExternalLabel* label, Register pp) { | 791 void Branch(const ExternalLabel* label, Register pp) { |
| 797 LoadExternalLabel(TMP, label, kNotPatchable, pp); | 792 LoadExternalLabel(TMP, label, kNotPatchable, pp); |
| 798 br(TMP); | 793 br(TMP); |
| 799 } | 794 } |
| 800 | 795 |
| 801 // Fixed length branch to label. | 796 // Fixed length branch to label. |
| 802 void BranchFixed(const ExternalLabel* label) { | 797 void BranchPatchable(const ExternalLabel* label) { |
| 798 // TODO(zra): Use LoadExternalLabelFixed if possible. |
| 803 LoadImmediateFixed(TMP, label->address()); | 799 LoadImmediateFixed(TMP, label->address()); |
| 804 br(TMP); | 800 br(TMP); |
| 805 } | 801 } |
| 806 | 802 |
| 807 void BranchLink(const ExternalLabel* label, Register pp) { | 803 void BranchLink(const ExternalLabel* label, Register pp) { |
| 808 if (Isolate::Current() == Dart::vm_isolate()) { | 804 if (Isolate::Current() == Dart::vm_isolate()) { |
| 809 LoadImmediate(TMP, label->address(), kNoPP); | 805 LoadImmediate(TMP, label->address(), kNoPP); |
| 810 blr(TMP); | 806 blr(TMP); |
| 811 } else { | 807 } else { |
| 812 LoadExternalLabel(TMP, label, kNotPatchable, pp); | 808 LoadExternalLabel(TMP, label, kNotPatchable, pp); |
| 813 blr(TMP); | 809 blr(TMP); |
| 814 } | 810 } |
| 815 } | 811 } |
| 816 | 812 |
| 813 // BranchLinkPatchable must be a fixed-length sequence so we can patch it |
| 814 // with the debugger. |
| 817 void BranchLinkPatchable(const ExternalLabel* label) { | 815 void BranchLinkPatchable(const ExternalLabel* label) { |
| 818 LoadExternalLabel(TMP, label, kPatchable, PP); | 816 LoadExternalLabelFixed(TMP, label, kPatchable, PP); |
| 819 blr(TMP); | 817 blr(TMP); |
| 820 } | 818 } |
| 821 | 819 |
| 822 // Macros accepting a pp Register argument may attempt to load values from | 820 // Macros accepting a pp Register argument may attempt to load values from |
| 823 // the object pool when possible. Unless you are sure that the untagged object | 821 // the object pool when possible. Unless you are sure that the untagged object |
| 824 // pool pointer is in another register, or that it is not available at all, | 822 // pool pointer is in another register, or that it is not available at all, |
| 825 // PP should be passed for pp. | 823 // PP should be passed for pp. |
| 826 void AddImmediate(Register dest, Register rn, int64_t imm, Register pp); | 824 void AddImmediate(Register dest, Register rn, int64_t imm, Register pp); |
| 827 void AddImmediateSetFlags( | 825 void AddImmediateSetFlags( |
| 828 Register dest, Register rn, int64_t imm, Register pp); | 826 Register dest, Register rn, int64_t imm, Register pp); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 | 898 |
| 901 // Index of constant pool entries pointing to debugger stubs. | 899 // Index of constant pool entries pointing to debugger stubs. |
| 902 static const int kBreakpointRuntimeCPIndex = 5; | 900 static const int kBreakpointRuntimeCPIndex = 5; |
| 903 | 901 |
| 904 enum Patchability { | 902 enum Patchability { |
| 905 kPatchable, | 903 kPatchable, |
| 906 kNotPatchable, | 904 kNotPatchable, |
| 907 }; | 905 }; |
| 908 | 906 |
| 909 void LoadWordFromPoolOffset(Register dst, Register pp, uint32_t offset); | 907 void LoadWordFromPoolOffset(Register dst, Register pp, uint32_t offset); |
| 908 void LoadWordFromPoolOffsetFixed(Register dst, Register pp, uint32_t offset); |
| 910 intptr_t FindExternalLabel(const ExternalLabel* label, | 909 intptr_t FindExternalLabel(const ExternalLabel* label, |
| 911 Patchability patchable); | 910 Patchability patchable); |
| 912 intptr_t FindObject(const Object& obj, Patchability patchable); | 911 intptr_t FindObject(const Object& obj, Patchability patchable); |
| 913 intptr_t FindImmediate(int64_t imm); | 912 intptr_t FindImmediate(int64_t imm); |
| 914 bool CanLoadObjectFromPool(const Object& object); | 913 bool CanLoadObjectFromPool(const Object& object); |
| 915 bool CanLoadImmediateFromPool(int64_t imm, Register pp); | 914 bool CanLoadImmediateFromPool(int64_t imm, Register pp); |
| 916 void LoadExternalLabel(Register dst, const ExternalLabel* label, | 915 void LoadExternalLabel(Register dst, const ExternalLabel* label, |
| 917 Patchability patchable, Register pp); | 916 Patchability patchable, Register pp); |
| 917 void LoadExternalLabelFixed(Register dst, |
| 918 const ExternalLabel* label, |
| 919 Patchability patchable, |
| 920 Register pp); |
| 918 void LoadObject(Register dst, const Object& obj, Register pp); | 921 void LoadObject(Register dst, const Object& obj, Register pp); |
| 919 void LoadDecodableImmediate(Register reg, int64_t imm, Register pp); | 922 void LoadDecodableImmediate(Register reg, int64_t imm, Register pp); |
| 920 void LoadImmediateFixed(Register reg, int64_t imm); | 923 void LoadImmediateFixed(Register reg, int64_t imm); |
| 921 void LoadImmediate(Register reg, int64_t imm, Register pp); | 924 void LoadImmediate(Register reg, int64_t imm, Register pp); |
| 922 void LoadDImmediate(VRegister reg, double immd, Register pp); | 925 void LoadDImmediate(VRegister reg, double immd, Register pp); |
| 923 | 926 |
| 924 void PushObject(const Object& object, Register pp) { | 927 void PushObject(const Object& object, Register pp) { |
| 925 LoadObject(TMP, object, pp); | 928 LoadObject(TMP, object, pp); |
| 926 Push(TMP); | 929 Push(TMP); |
| 927 } | 930 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 Register value, | 1346 Register value, |
| 1344 Label* no_update); | 1347 Label* no_update); |
| 1345 | 1348 |
| 1346 DISALLOW_ALLOCATION(); | 1349 DISALLOW_ALLOCATION(); |
| 1347 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1350 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 1348 }; | 1351 }; |
| 1349 | 1352 |
| 1350 } // namespace dart | 1353 } // namespace dart |
| 1351 | 1354 |
| 1352 #endif // VM_ASSEMBLER_ARM64_H_ | 1355 #endif // VM_ASSEMBLER_ARM64_H_ |
| OLD | NEW |