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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 1911253002: Never include_isolate or allow_embedded_addresses. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « runtime/vm/assembler_x64.h ('k') | runtime/vm/flag_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 478c2ae30f15d33dd498416de6dcdb9e3cc4d8e0..67bc2379a7632291525a9f6c6f83d9d19b2a18f4 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -2803,8 +2803,7 @@ void Assembler::LoadObjectHelper(Register dst,
const int32_t offset = ObjectPool::element_offset(idx);
LoadWordFromPoolOffset(dst, offset - kHeapObjectTag);
} else {
- ASSERT(object.IsSmi() || object.InVMHeap());
- ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
+ ASSERT(object.IsSmi());
LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
@@ -2841,7 +2840,7 @@ void Assembler::StoreObject(const Address& dst, const Object& object) {
LoadObject(TMP, object);
movq(dst, TMP);
} else {
- ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
+ ASSERT(object.IsSmi());
MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
@@ -2856,7 +2855,7 @@ void Assembler::PushObject(const Object& object) {
LoadObject(TMP, object);
pushq(TMP);
} else {
- ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
+ ASSERT(object.IsSmi());
PushImmediate(Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
@@ -2872,7 +2871,7 @@ void Assembler::CompareObject(Register reg, const Object& object) {
const int32_t offset = ObjectPool::element_offset(idx);
cmpq(reg, Address(PP, offset-kHeapObjectTag));
} else {
- ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
+ ASSERT(object.IsSmi());
CompareImmediate(
reg, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
@@ -3458,27 +3457,14 @@ void Assembler::LeaveStubFrame() {
void Assembler::MaybeTraceAllocation(intptr_t cid,
Label* trace,
- bool near_jump,
- bool inline_isolate) {
+ bool near_jump) {
ASSERT(cid > 0);
intptr_t state_offset = ClassTable::StateOffsetFor(cid);
Register temp_reg = TMP;
- if (inline_isolate) {
- ASSERT(FLAG_allow_absolute_addresses);
- ClassTable* class_table = Isolate::Current()->class_table();
- ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
- if (cid < kNumPredefinedCids) {
- movq(temp_reg, Immediate(reinterpret_cast<uword>(*table_ptr)));
- } else {
- movq(temp_reg, Immediate(reinterpret_cast<uword>(table_ptr)));
- movq(temp_reg, Address(temp_reg, 0));
- }
- } else {
- LoadIsolate(temp_reg);
- intptr_t table_offset =
- Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
- movq(temp_reg, Address(temp_reg, table_offset));
- }
+ LoadIsolate(temp_reg);
+ intptr_t table_offset =
+ Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
+ movq(temp_reg, Address(temp_reg, table_offset));
testb(Address(temp_reg, state_offset),
Immediate(ClassHeapStats::TraceAllocationMask()));
// We are tracing for this class, jump to the trace label which will use
@@ -3488,39 +3474,25 @@ void Assembler::MaybeTraceAllocation(intptr_t cid,
void Assembler::UpdateAllocationStats(intptr_t cid,
- Heap::Space space,
- bool inline_isolate) {
+ Heap::Space space) {
ASSERT(cid > 0);
intptr_t counter_offset =
ClassTable::CounterOffsetFor(cid, space == Heap::kNew);
Register temp_reg = TMP;
- if (inline_isolate) {
- ASSERT(FLAG_allow_absolute_addresses);
- ClassTable* class_table = Isolate::Current()->class_table();
- ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
- if (cid < kNumPredefinedCids) {
- movq(temp_reg, Immediate(reinterpret_cast<uword>(*table_ptr)));
- } else {
- movq(temp_reg, Immediate(reinterpret_cast<uword>(table_ptr)));
- movq(temp_reg, Address(temp_reg, 0));
- }
- } else {
- LoadIsolate(temp_reg);
- intptr_t table_offset =
- Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
- movq(temp_reg, Address(temp_reg, table_offset));
- }
+ LoadIsolate(temp_reg);
+ intptr_t table_offset =
+ Isolate::class_table_offset() + ClassTable::TableOffsetFor(cid);
+ movq(temp_reg, Address(temp_reg, table_offset));
incq(Address(temp_reg, counter_offset));
}
void Assembler::UpdateAllocationStatsWithSize(intptr_t cid,
Register size_reg,
- Heap::Space space,
- bool inline_isolate) {
+ Heap::Space space) {
ASSERT(cid > 0);
ASSERT(cid < kNumPredefinedCids);
- UpdateAllocationStats(cid, space, inline_isolate);
+ UpdateAllocationStats(cid, space);
Register temp_reg = TMP;
intptr_t size_offset = ClassTable::SizeOffsetFor(cid, space == Heap::kNew);
addq(Address(temp_reg, size_offset), size_reg);
@@ -3529,11 +3501,10 @@ void Assembler::UpdateAllocationStatsWithSize(intptr_t cid,
void Assembler::UpdateAllocationStatsWithSize(intptr_t cid,
intptr_t size_in_bytes,
- Heap::Space space,
- bool inline_isolate) {
+ Heap::Space space) {
ASSERT(cid > 0);
ASSERT(cid < kNumPredefinedCids);
- UpdateAllocationStats(cid, space, inline_isolate);
+ UpdateAllocationStats(cid, space);
Register temp_reg = TMP;
intptr_t size_offset = ClassTable::SizeOffsetFor(cid, space == Heap::kNew);
addq(Address(temp_reg, size_offset), Immediate(size_in_bytes));
@@ -3550,8 +3521,7 @@ void Assembler::TryAllocate(const Class& cls,
// If this allocation is traced, program will jump to failure path
// (i.e. the allocation stub) which will allocate the object and trace the
// allocation call site.
- MaybeTraceAllocation(cls.id(), failure, near_jump,
- /* inline_isolate = */ false);
+ MaybeTraceAllocation(cls.id(), failure, near_jump);
const intptr_t instance_size = cls.instance_size();
Heap::Space space = Heap::SpaceForAllocation(cls.id());
movq(temp, Address(THR, Thread::heap_offset()));
@@ -3563,7 +3533,7 @@ void Assembler::TryAllocate(const Class& cls,
// Successfully allocated the object, now update top to point to
// next object start and store the class in the class field of object.
movq(Address(temp, Heap::TopOffset(space)), instance_reg);
- UpdateAllocationStats(cls.id(), space, /* inline_isolate = */ false);
+ UpdateAllocationStats(cls.id(), space);
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(instance_reg, Immediate(kHeapObjectTag - instance_size));
uword tags = 0;
@@ -3590,7 +3560,7 @@ void Assembler::TryAllocateArray(intptr_t cid,
// If this allocation is traced, program will jump to failure path
// (i.e. the allocation stub) which will allocate the object and trace the
// allocation call site.
- MaybeTraceAllocation(cid, failure, near_jump, /* inline_isolate = */ false);
+ MaybeTraceAllocation(cid, failure, near_jump);
Heap::Space space = Heap::SpaceForAllocation(cid);
movq(temp, Address(THR, Thread::heap_offset()));
movq(instance, Address(temp, Heap::TopOffset(space)));
@@ -3609,8 +3579,7 @@ void Assembler::TryAllocateArray(intptr_t cid,
// next object start and initialize the object.
movq(Address(temp, Heap::TopOffset(space)), end_address);
addq(instance, Immediate(kHeapObjectTag));
- UpdateAllocationStatsWithSize(cid, instance_size, space,
- /* inline_isolate = */ false);
+ UpdateAllocationStatsWithSize(cid, instance_size, space);
// Initialize the tags.
// instance: new object start as a tagged pointer.
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/flag_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698