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 |
11 | 11 |
12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
13 #include "platform/utils.h" | 13 #include "platform/utils.h" |
14 #include "vm/constants_arm64.h" | 14 #include "vm/constants_arm64.h" |
15 #include "vm/hash_map.h" | 15 #include "vm/hash_map.h" |
16 #include "vm/longjump.h" | 16 #include "vm/longjump.h" |
17 #include "vm/object.h" | 17 #include "vm/object.h" |
18 #include "vm/simulator.h" | 18 #include "vm/simulator.h" |
19 | 19 |
20 namespace dart { | 20 namespace dart { |
21 | 21 |
22 // Forward declarations. | 22 // Forward declarations. |
23 class RuntimeEntry; | 23 class RuntimeEntry; |
| 24 class StubEntry; |
24 | 25 |
25 class Immediate : public ValueObject { | 26 class Immediate : public ValueObject { |
26 public: | 27 public: |
27 explicit Immediate(int64_t value) : value_(value) { } | 28 explicit Immediate(int64_t value) : value_(value) { } |
28 | 29 |
29 Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { } | 30 Immediate(const Immediate& other) : ValueObject(), value_(other.value_) { } |
30 Immediate& operator=(const Immediate& other) { | 31 Immediate& operator=(const Immediate& other) { |
31 value_ = other.value_; | 32 value_ = other.value_; |
32 return *this; | 33 return *this; |
33 } | 34 } |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 void SmiTag(Register dst, Register src) { | 1197 void SmiTag(Register dst, Register src) { |
1197 LslImmediate(dst, src, kSmiTagSize); | 1198 LslImmediate(dst, src, kSmiTagSize); |
1198 } | 1199 } |
1199 | 1200 |
1200 // Branching to ExternalLabels. | 1201 // Branching to ExternalLabels. |
1201 void Branch(const ExternalLabel* label) { | 1202 void Branch(const ExternalLabel* label) { |
1202 LoadExternalLabel(TMP, label); | 1203 LoadExternalLabel(TMP, label); |
1203 br(TMP); | 1204 br(TMP); |
1204 } | 1205 } |
1205 | 1206 |
| 1207 void Branch(const StubEntry& stub_entry); |
| 1208 |
1206 // Fixed length branch to label. | 1209 // Fixed length branch to label. |
1207 void BranchPatchable(const ExternalLabel* label) { | 1210 void BranchPatchable(const ExternalLabel* label) { |
1208 // TODO(zra): Use LoadExternalLabelFixed if possible. | 1211 // TODO(zra): Use LoadExternalLabelFixed if possible. |
1209 LoadImmediateFixed(TMP, label->address()); | 1212 LoadImmediateFixed(TMP, label->address()); |
1210 br(TMP); | 1213 br(TMP); |
1211 } | 1214 } |
1212 | 1215 |
| 1216 void BranchPatchable(const StubEntry& stub_entry); |
| 1217 |
1213 void BranchLink(const ExternalLabel* label) { | 1218 void BranchLink(const ExternalLabel* label) { |
1214 LoadExternalLabel(TMP, label); | 1219 LoadExternalLabel(TMP, label); |
1215 blr(TMP); | 1220 blr(TMP); |
1216 } | 1221 } |
1217 | 1222 |
| 1223 void BranchLink(const StubEntry& stub_entry); |
| 1224 |
1218 // BranchLinkPatchable must be a fixed-length sequence so we can patch it | 1225 // BranchLinkPatchable must be a fixed-length sequence so we can patch it |
1219 // with the debugger. | 1226 // with the debugger. |
1220 void BranchLinkPatchable(const ExternalLabel* label) { | 1227 void BranchLinkPatchable(const ExternalLabel* label) { |
1221 LoadExternalLabelFixed(TMP, label, kPatchable); | 1228 LoadExternalLabelFixed(TMP, label, kPatchable); |
1222 blr(TMP); | 1229 blr(TMP); |
1223 } | 1230 } |
1224 | 1231 |
| 1232 void BranchLinkPatchable(const StubEntry& stub_entry); |
| 1233 |
1225 // Macros accepting a pp Register argument may attempt to load values from | 1234 // Macros accepting a pp Register argument may attempt to load values from |
1226 // the object pool when possible. Unless you are sure that the untagged object | 1235 // the object pool when possible. Unless you are sure that the untagged object |
1227 // pool pointer is in another register, or that it is not available at all, | 1236 // pool pointer is in another register, or that it is not available at all, |
1228 // PP should be passed for pp. | 1237 // PP should be passed for pp. |
1229 void AddImmediate(Register dest, Register rn, int64_t imm); | 1238 void AddImmediate(Register dest, Register rn, int64_t imm); |
1230 void AddImmediateSetFlags(Register dest, Register rn, int64_t imm); | 1239 void AddImmediateSetFlags(Register dest, Register rn, int64_t imm); |
1231 void SubImmediateSetFlags(Register dest, Register rn, int64_t imm); | 1240 void SubImmediateSetFlags(Register dest, Register rn, int64_t imm); |
1232 void AndImmediate(Register rd, Register rn, int64_t imm); | 1241 void AndImmediate(Register rd, Register rn, int64_t imm); |
1233 void OrImmediate(Register rd, Register rn, int64_t imm); | 1242 void OrImmediate(Register rd, Register rn, int64_t imm); |
1234 void XorImmediate(Register rd, Register rn, int64_t imm); | 1243 void XorImmediate(Register rd, Register rn, int64_t imm); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 Register value, | 1943 Register value, |
1935 Label* no_update); | 1944 Label* no_update); |
1936 | 1945 |
1937 DISALLOW_ALLOCATION(); | 1946 DISALLOW_ALLOCATION(); |
1938 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1947 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1939 }; | 1948 }; |
1940 | 1949 |
1941 } // namespace dart | 1950 } // namespace dart |
1942 | 1951 |
1943 #endif // VM_ASSEMBLER_ARM64_H_ | 1952 #endif // VM_ASSEMBLER_ARM64_H_ |
OLD | NEW |