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

Unified Diff: runtime/vm/assembler_arm64.h

Issue 1264543002: Simplify constant pool usage in arm64 code generator (by removing extra argument (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64.h
diff --git a/runtime/vm/assembler_arm64.h b/runtime/vm/assembler_arm64.h
index ffdfd9d9d0702f9ac0f1971d3665cb9dd4c73ba3..b3a812bb29323d3f05259c24b34e4e67c5852eef 100644
--- a/runtime/vm/assembler_arm64.h
+++ b/runtime/vm/assembler_arm64.h
@@ -119,7 +119,7 @@ class Address : public ValueObject {
// is unscaled.
Address(Register rn, int32_t offset = 0, AddressType at = Offset,
OperandSize sz = kDoubleWord) {
- ASSERT((rn != R31) && (rn != ZR));
+ ASSERT((rn != kNoRegister) && (rn != R31) && (rn != ZR));
ASSERT(CanHoldOffset(offset, at, sz));
const Register crn = ConcreteRegister(rn);
const int32_t scale = Log2OperandSizeBytes(sz);
@@ -1161,6 +1161,8 @@ class Assembler : public ValueObject {
void PopAndUntagPP() {
ldr(PP, Address(SP, 1 * kWordSize, Address::PostIndex));
sub(PP, PP, Operand(kHeapObjectTag));
+ // The caller of PopAndUntagPP() must explicitly allow use of popped PP.
+ set_constant_pool_allowed(false);
}
void tst(Register rn, Operand o) {
ands(ZR, rn, o);
@@ -1196,8 +1198,8 @@ class Assembler : public ValueObject {
}
// Branching to ExternalLabels.
- void Branch(const ExternalLabel* label, Register pp) {
- LoadExternalLabel(TMP, label, kNotPatchable, pp);
+ void Branch(const ExternalLabel* label) {
+ LoadExternalLabel(TMP, label);
br(TMP);
}
@@ -1208,15 +1210,15 @@ class Assembler : public ValueObject {
br(TMP);
}
- void BranchLink(const ExternalLabel* label, Register pp) {
- LoadExternalLabel(TMP, label, kNotPatchable, pp);
+ void BranchLink(const ExternalLabel* label) {
+ LoadExternalLabel(TMP, label);
blr(TMP);
}
// BranchLinkPatchable must be a fixed-length sequence so we can patch it
// with the debugger.
void BranchLinkPatchable(const ExternalLabel* label) {
- LoadExternalLabelFixed(TMP, label, kPatchable, PP);
+ LoadExternalLabelFixed(TMP, label, kPatchable);
blr(TMP);
}
@@ -1224,53 +1226,43 @@ class Assembler : public ValueObject {
// the object pool when possible. Unless you are sure that the untagged object
// pool pointer is in another register, or that it is not available at all,
// PP should be passed for pp.
- void AddImmediate(Register dest, Register rn, int64_t imm, Register pp);
- void AddImmediateSetFlags(
- Register dest, Register rn, int64_t imm, Register pp);
- void SubImmediateSetFlags(
- Register dest, Register rn, int64_t imm, Register pp);
- void AndImmediate(Register rd, Register rn, int64_t imm, Register pp);
- void OrImmediate(Register rd, Register rn, int64_t imm, Register pp);
- void XorImmediate(Register rd, Register rn, int64_t imm, Register pp);
- void TestImmediate(Register rn, int64_t imm, Register pp);
- void CompareImmediate(Register rn, int64_t imm, Register pp);
+ void AddImmediate(Register dest, Register rn, int64_t imm);
+ void AddImmediateSetFlags(Register dest, Register rn, int64_t imm);
+ void SubImmediateSetFlags(Register dest, Register rn, int64_t imm);
+ void AndImmediate(Register rd, Register rn, int64_t imm);
+ void OrImmediate(Register rd, Register rn, int64_t imm);
+ void XorImmediate(Register rd, Register rn, int64_t imm);
+ void TestImmediate(Register rn, int64_t imm);
+ void CompareImmediate(Register rn, int64_t imm);
void LoadFromOffset(Register dest, Register base, int32_t offset,
- Register pp, OperandSize sz = kDoubleWord);
+ OperandSize sz = kDoubleWord);
void LoadFieldFromOffset(Register dest, Register base, int32_t offset,
- Register pp, OperandSize sz = kDoubleWord) {
- LoadFromOffset(dest, base, offset - kHeapObjectTag, pp, sz);
+ OperandSize sz = kDoubleWord) {
+ LoadFromOffset(dest, base, offset - kHeapObjectTag, sz);
}
- void LoadDFromOffset(
- VRegister dest, Register base, int32_t offset, Register pp);
- void LoadDFieldFromOffset(
- VRegister dest, Register base, int32_t offset, Register pp) {
- LoadDFromOffset(dest, base, offset - kHeapObjectTag, pp);
+ void LoadDFromOffset(VRegister dest, Register base, int32_t offset);
+ void LoadDFieldFromOffset(VRegister dest, Register base, int32_t offset) {
+ LoadDFromOffset(dest, base, offset - kHeapObjectTag);
}
- void LoadQFromOffset(
- VRegister dest, Register base, int32_t offset, Register pp);
- void LoadQFieldFromOffset(
- VRegister dest, Register base, int32_t offset, Register pp) {
- LoadQFromOffset(dest, base, offset - kHeapObjectTag, pp);
+ void LoadQFromOffset(VRegister dest, Register base, int32_t offset);
+ void LoadQFieldFromOffset(VRegister dest, Register base, int32_t offset) {
+ LoadQFromOffset(dest, base, offset - kHeapObjectTag);
}
void StoreToOffset(Register src, Register base, int32_t offset,
- Register pp, OperandSize sz = kDoubleWord);
+ OperandSize sz = kDoubleWord);
void StoreFieldToOffset(Register src, Register base, int32_t offset,
- Register pp, OperandSize sz = kDoubleWord) {
- StoreToOffset(src, base, offset - kHeapObjectTag, pp, sz);
+ OperandSize sz = kDoubleWord) {
+ StoreToOffset(src, base, offset - kHeapObjectTag, sz);
}
- void StoreDToOffset(
- VRegister src, Register base, int32_t offset, Register pp);
- void StoreDFieldToOffset(
- VRegister src, Register base, int32_t offset, Register pp) {
- StoreDToOffset(src, base, offset - kHeapObjectTag, pp);
+ void StoreDToOffset(VRegister src, Register base, int32_t offset);
+ void StoreDFieldToOffset(VRegister src, Register base, int32_t offset) {
+ StoreDToOffset(src, base, offset - kHeapObjectTag);
}
- void StoreQToOffset(
- VRegister src, Register base, int32_t offset, Register pp);
- void StoreQFieldToOffset(
- VRegister src, Register base, int32_t offset, Register pp) {
- StoreQToOffset(src, base, offset - kHeapObjectTag, pp);
+ void StoreQToOffset(VRegister src, Register base, int32_t offset);
+ void StoreQFieldToOffset(VRegister src, Register base, int32_t offset) {
+ StoreQToOffset(src, base, offset - kHeapObjectTag);
}
// Storing into an object.
@@ -1281,25 +1273,22 @@ class Assembler : public ValueObject {
void StoreIntoObjectOffset(Register object,
int32_t offset,
Register value,
- Register pp,
bool can_value_be_smi = true);
void StoreIntoObjectNoBarrier(Register object,
const Address& dest,
Register value);
void StoreIntoObjectOffsetNoBarrier(Register object,
int32_t offset,
- Register value,
- Register pp);
+ Register value);
void StoreIntoObjectNoBarrier(Register object,
const Address& dest,
const Object& value);
void StoreIntoObjectOffsetNoBarrier(Register object,
int32_t offset,
- const Object& value,
- Register pp);
+ const Object& value);
// Object pool, loading from pool, etc.
- void LoadPoolPointer(Register pp);
+ void LoadPoolPointer();
bool constant_pool_allowed() const {
return constant_pool_allowed_;
@@ -1308,35 +1297,32 @@ class Assembler : public ValueObject {
constant_pool_allowed_ = b;
}
- void LoadWordFromPoolOffset(Register dst, Register pp, uint32_t offset);
- void LoadWordFromPoolOffsetFixed(Register dst, Register pp, uint32_t offset);
+ void LoadWordFromPoolOffset(Register dst, uint32_t offset);
+ void LoadWordFromPoolOffsetFixed(Register dst, uint32_t offset);
intptr_t FindImmediate(int64_t imm);
bool CanLoadFromObjectPool(const Object& object) const;
- bool CanLoadImmediateFromPool(int64_t imm, Register pp);
- void LoadExternalLabel(Register dst, const ExternalLabel* label,
- Patchability patchable, Register pp);
+ void LoadExternalLabel(Register dst, const ExternalLabel* label);
void LoadExternalLabelFixed(Register dst,
const ExternalLabel* label,
- Patchability patchable,
- Register pp);
+ Patchability patchable);
void LoadIsolate(Register dst);
- void LoadObject(Register dst, const Object& obj, Register pp);
- void LoadUniqueObject(Register dst, const Object& obj, Register pp);
- void LoadDecodableImmediate(Register reg, int64_t imm, Register pp);
+ void LoadObject(Register dst, const Object& obj);
+ void LoadUniqueObject(Register dst, const Object& obj);
+ void LoadDecodableImmediate(Register reg, int64_t imm);
void LoadImmediateFixed(Register reg, int64_t imm);
- void LoadImmediate(Register reg, int64_t imm, Register pp);
- void LoadDImmediate(VRegister reg, double immd, Register pp);
+ void LoadImmediate(Register reg, int64_t imm);
+ void LoadDImmediate(VRegister reg, double immd);
- void PushObject(const Object& object, Register pp) {
- LoadObject(TMP, object, pp);
+ void PushObject(const Object& object) {
+ LoadObject(TMP, object);
Push(TMP);
}
- void CompareObject(Register reg, const Object& object, Register pp);
+ void CompareObject(Register reg, const Object& object);
- void LoadClassId(Register result, Register object, Register pp);
- void LoadClassById(Register result, Register class_id, Register pp);
- void LoadClass(Register result, Register object, Register pp);
- void CompareClassId(Register object, intptr_t class_id, Register pp);
+ void LoadClassId(Register result, Register object);
+ void LoadClassById(Register result, Register class_id);
+ void LoadClass(Register result, Register object);
+ void CompareClassId(Register object, intptr_t class_id);
void LoadClassIdMayBeSmi(Register result, Register object);
void LoadTaggedClassIdMayBeSmi(Register result, Register object);
@@ -1379,13 +1365,11 @@ class Assembler : public ValueObject {
void LeaveStubFrame();
void UpdateAllocationStats(intptr_t cid,
- Register pp,
Heap::Space space,
bool inline_isolate = true);
void UpdateAllocationStatsWithSize(intptr_t cid,
Register size_reg,
- Register pp,
Heap::Space space,
bool inline_isolate = true);
@@ -1393,7 +1377,6 @@ class Assembler : public ValueObject {
// which will allocate in the runtime where tracing occurs.
void MaybeTraceAllocation(intptr_t cid,
Register temp_reg,
- Register pp,
Label* trace,
bool inline_isolate = true);
@@ -1404,8 +1387,7 @@ class Assembler : public ValueObject {
void TryAllocate(const Class& cls,
Label* failure,
Register instance_reg,
- Register temp_reg,
- Register pp);
+ Register temp_reg);
void TryAllocateArray(intptr_t cid,
intptr_t instance_size,
@@ -1455,10 +1437,7 @@ class Assembler : public ValueObject {
bool constant_pool_allowed_;
- void LoadObjectHelper(Register dst,
- const Object& obj,
- Register pp,
- bool is_unique);
+ void LoadObjectHelper(Register dst, const Object& obj, bool is_unique);
void AddSubHelper(OperandSize os, bool set_flags, bool subtract,
Register rd, Register rn, Operand o) {
« no previous file with comments | « no previous file | runtime/vm/assembler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698