Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: runtime/vm/assembler_arm64.h

Issue 1314883002: VM: Use constant pool also for leaf runtime calls on x64, arm, arm64 and mips. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: use StubEntry::label directly Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 void SmiUntag(Register dst, Register src) { 1191 void SmiUntag(Register dst, Register src) {
1192 AsrImmediate(dst, src, kSmiTagSize); 1192 AsrImmediate(dst, src, kSmiTagSize);
1193 } 1193 }
1194 void SmiTag(Register reg) { 1194 void SmiTag(Register reg) {
1195 LslImmediate(reg, reg, kSmiTagSize); 1195 LslImmediate(reg, reg, kSmiTagSize);
1196 } 1196 }
1197 void SmiTag(Register dst, Register src) { 1197 void SmiTag(Register dst, Register src) {
1198 LslImmediate(dst, src, kSmiTagSize); 1198 LslImmediate(dst, src, kSmiTagSize);
1199 } 1199 }
1200 1200
1201 // Branching to ExternalLabels.
1202 void Branch(const ExternalLabel* label) {
1203 LoadExternalLabel(TMP, label);
1204 br(TMP);
1205 }
1206
1207 void Branch(const StubEntry& stub_entry); 1201 void Branch(const StubEntry& stub_entry);
1208
1209 // Fixed length branch to label.
1210 void BranchPatchable(const ExternalLabel* label) {
1211 // TODO(zra): Use LoadExternalLabelFixed if possible.
1212 LoadImmediateFixed(TMP, label->address());
1213 br(TMP);
1214 }
1215
1216 void BranchPatchable(const StubEntry& stub_entry); 1202 void BranchPatchable(const StubEntry& stub_entry);
1217 1203
1218 void BranchLink(const ExternalLabel* label) { 1204 void BranchLink(const ExternalLabel* label);
1219 LoadExternalLabel(TMP, label);
1220 blr(TMP);
1221 }
1222
1223 void BranchLink(const StubEntry& stub_entry); 1205 void BranchLink(const StubEntry& stub_entry);
1224 1206
1225 // BranchLinkPatchable must be a fixed-length sequence so we can patch it 1207 // BranchLinkPatchable must be a fixed-length sequence so we can patch it
1226 // with the debugger. 1208 // with the debugger.
1227 void BranchLinkPatchable(const ExternalLabel* label) {
1228 LoadExternalLabelFixed(TMP, label, kPatchable);
1229 blr(TMP);
1230 }
1231
1232 void BranchLinkPatchable(const StubEntry& stub_entry); 1209 void BranchLinkPatchable(const StubEntry& stub_entry);
1233 1210
1234 // Macros accepting a pp Register argument may attempt to load values from 1211 // Macros accepting a pp Register argument may attempt to load values from
1235 // the object pool when possible. Unless you are sure that the untagged object 1212 // the object pool when possible. Unless you are sure that the untagged object
1236 // pool pointer is in another register, or that it is not available at all, 1213 // pool pointer is in another register, or that it is not available at all,
1237 // PP should be passed for pp. 1214 // PP should be passed for pp.
1238 void AddImmediate(Register dest, Register rn, int64_t imm); 1215 void AddImmediate(Register dest, Register rn, int64_t imm);
1239 void AddImmediateSetFlags(Register dest, Register rn, int64_t imm); 1216 void AddImmediateSetFlags(Register dest, Register rn, int64_t imm);
1240 void SubImmediateSetFlags(Register dest, Register rn, int64_t imm); 1217 void SubImmediateSetFlags(Register dest, Register rn, int64_t imm);
1241 void AndImmediate(Register rd, Register rn, int64_t imm); 1218 void AndImmediate(Register rd, Register rn, int64_t imm);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 intptr_t pc_offset_; 1418 intptr_t pc_offset_;
1442 const String& comment_; 1419 const String& comment_;
1443 1420
1444 DISALLOW_COPY_AND_ASSIGN(CodeComment); 1421 DISALLOW_COPY_AND_ASSIGN(CodeComment);
1445 }; 1422 };
1446 1423
1447 GrowableArray<CodeComment*> comments_; 1424 GrowableArray<CodeComment*> comments_;
1448 1425
1449 bool constant_pool_allowed_; 1426 bool constant_pool_allowed_;
1450 1427
1428 void Branch(const ExternalLabel* label);
1429 void BranchPatchable(const ExternalLabel* label);
1430 void BranchLinkPatchable(const ExternalLabel* label);
1431
1451 void LoadObjectHelper(Register dst, const Object& obj, bool is_unique); 1432 void LoadObjectHelper(Register dst, const Object& obj, bool is_unique);
1452 1433
1453 void AddSubHelper(OperandSize os, bool set_flags, bool subtract, 1434 void AddSubHelper(OperandSize os, bool set_flags, bool subtract,
1454 Register rd, Register rn, Operand o) { 1435 Register rd, Register rn, Operand o) {
1455 ASSERT((rd != R31) && (rn != R31)); 1436 ASSERT((rd != R31) && (rn != R31));
1456 const Register crd = ConcreteRegister(rd); 1437 const Register crd = ConcreteRegister(rd);
1457 const Register crn = ConcreteRegister(rn); 1438 const Register crn = ConcreteRegister(rn);
1458 if (o.type() == Operand::Immediate) { 1439 if (o.type() == Operand::Immediate) {
1459 ASSERT(rn != ZR); 1440 ASSERT(rn != ZR);
1460 EmitAddSubImmOp(subtract ? SUBI : ADDI, crd, crn, o, os, set_flags); 1441 EmitAddSubImmOp(subtract ? SUBI : ADDI, crd, crn, o, os, set_flags);
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 Register value, 1923 Register value,
1943 Label* no_update); 1924 Label* no_update);
1944 1925
1945 DISALLOW_ALLOCATION(); 1926 DISALLOW_ALLOCATION();
1946 DISALLOW_COPY_AND_ASSIGN(Assembler); 1927 DISALLOW_COPY_AND_ASSIGN(Assembler);
1947 }; 1928 };
1948 1929
1949 } // namespace dart 1930 } // namespace dart
1950 1931
1951 #endif // VM_ASSEMBLER_ARM64_H_ 1932 #endif // VM_ASSEMBLER_ARM64_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698