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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 738453002: Add missing verified write on x64; extend test coverage (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 41792)
+++ runtime/vm/assembler_x64.cc (working copy)
@@ -2760,7 +2760,7 @@
LoadObject(TMP, object, pp);
movq(dst, TMP);
} else {
- LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp);
+ MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp);
}
}
@@ -2825,7 +2825,7 @@
}
-void Assembler::LoadImmediate(const Address& dst, const Immediate& imm,
+void Assembler::MoveImmediate(const Address& dst, const Immediate& imm,
Register pp) {
if (CanLoadImmediateFromPool(imm, pp)) {
LoadImmediate(TMP, imm, pp);
@@ -2952,6 +2952,25 @@
}
+void Assembler::StoreIntoObjectNoBarrier(Register object,
+ const Address& dest,
+ const Object& value,
+ Register pp) {
+ if (VerifiedMemory::enabled()) {
+ VerifyHeapWord(dest);
+ Register temp = (pp == RCX) ? RDX : RCX;
+ pushq(temp);
+ leaq(temp, dest);
+ StoreObject(Address(temp, 0), value, pp);
+ StoreObject(Address(temp, VerifiedMemory::offset()), value, pp);
+ popq(temp);
+ } else {
+ StoreObject(dest, value, pp);
+ }
+ // TODO(koda): Use 'object', verify that generational barrier's not needed.
+}
+
+
void Assembler::StoreIntoSmiField(const Address& dest, Register value) {
VerifiedWrite(dest, value);
#if defined(DEBUG)
@@ -3428,7 +3447,7 @@
tags = RawObject::SizeTag::update(instance_size, tags);
ASSERT(cls.id() != kIllegalCid);
tags = RawObject::ClassIdTag::update(cls.id(), tags);
- LoadImmediate(FieldAddress(instance_reg, Object::tags_offset()),
+ MoveImmediate(FieldAddress(instance_reg, Object::tags_offset()),
Immediate(tags), pp);
} else {
jmp(failure);
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698