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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 1332923005: Remove remaining uses of null's absolute address from non-IA32. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index fcab5eafb922677ce26acc847fd68ac7d4211bf3..bbfee1f7578f2ed00a5a2a1348fc18e6536ca644 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -17,6 +17,7 @@
namespace dart {
+DECLARE_FLAG(bool, allow_absolute_addresses);
DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
DECLARE_FLAG(bool, inline_alloc);
@@ -2818,6 +2819,7 @@ void Assembler::LoadObjectHelper(Register dst,
LoadWordFromPoolOffset(dst, offset - kHeapObjectTag);
} else {
ASSERT(object.IsSmi() || object.InVMHeap());
+ ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
@@ -2852,6 +2854,7 @@ void Assembler::StoreObject(const Address& dst, const Object& object) {
LoadObject(TMP, object);
movq(dst, TMP);
} else {
+ ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
@@ -2864,6 +2867,7 @@ void Assembler::PushObject(const Object& object) {
LoadObject(TMP, object);
pushq(TMP);
} else {
+ ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
PushImmediate(Immediate(reinterpret_cast<int64_t>(object.raw())));
}
}
@@ -2877,6 +2881,7 @@ void Assembler::CompareObject(Register reg, const Object& object) {
ObjectPool::element_offset(object_pool_wrapper_.FindObject(object));
cmpq(reg, Address(PP, offset-kHeapObjectTag));
} else {
+ ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
CompareImmediate(
reg, Immediate(reinterpret_cast<int64_t>(object.raw())));
}
@@ -3026,7 +3031,9 @@ void Assembler::VerifyUninitialized(const Address& dest) {
#else
#error Only supported in DEBUG mode
#endif
- cmpq(dest, Immediate(reinterpret_cast<uint64_t>(Object::null())));
+ // Is TMP available here or do we need a memory-memory comparison?
+ LoadObject(TMP, Object::null_object());
Florian Schneider 2015/09/11 13:42:40 TMP should be only used inside the Assembler, so I
+ cmpq(dest, TMP);
j(EQUAL, &ok, Assembler::kNearJump);
static const bool kFixedLengthEncoding = true;
Stop("Expected zapped, Smi or null", kFixedLengthEncoding);
@@ -3444,6 +3451,7 @@ void Assembler::MaybeTraceAllocation(intptr_t cid,
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) {
@@ -3474,6 +3482,7 @@ void Assembler::UpdateAllocationStats(intptr_t cid,
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) {

Powered by Google App Engine
This is Rietveld 408576698