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

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
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('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 863bf622d876bed7f5c1babcbec8303d62f31b41..523f29f9ca8fdc3cc7229e3fe75c955c6445f283 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);
@@ -2827,6 +2828,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())));
}
}
@@ -2861,6 +2863,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())));
}
}
@@ -2873,6 +2876,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())));
}
}
@@ -2886,6 +2890,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())));
}
@@ -3035,7 +3040,8 @@ void Assembler::VerifyUninitialized(const Address& dest) {
#else
#error Only supported in DEBUG mode
#endif
- cmpq(dest, Immediate(reinterpret_cast<uint64_t>(Object::null())));
+ LoadObject(TMP, Object::null_object());
+ cmpq(dest, TMP);
j(EQUAL, &ok, Assembler::kNearJump);
static const bool kFixedLengthEncoding = true;
Stop("Expected zapped, Smi or null", kFixedLengthEncoding);
@@ -3453,6 +3459,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) {
@@ -3483,6 +3490,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) {
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698