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

Unified Diff: runtime/vm/raw_object.h

Issue 711833002: Support verified heap pointer writes on ia32. (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
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 41609)
+++ runtime/vm/raw_object.h (working copy)
@@ -8,8 +8,9 @@
#include "platform/assert.h"
#include "vm/atomic.h"
#include "vm/globals.h"
+#include "vm/snapshot.h"
#include "vm/token.h"
-#include "vm/snapshot.h"
+#include "vm/verified_memory.h"
namespace dart {
@@ -487,7 +488,7 @@
void StorePointer(type const* addr, type value) {
// Ensure that this object contains the addr.
ASSERT(Contains(reinterpret_cast<uword>(addr)));
- *const_cast<type*>(addr) = value;
+ VerifiedMemory::Write(const_cast<type*>(addr), value);
// Filter stores based on source and target.
if (!value->IsHeapObject()) return;
if (value->IsNewObject() && this->IsOldObject() &&
@@ -502,7 +503,7 @@
void StoreSmi(RawSmi* const* addr, RawSmi* value) {
// Can't use Contains, as array length is initialized through this method.
ASSERT(reinterpret_cast<uword>(addr) >= RawObject::ToAddr(this));
- *const_cast<RawSmi**>(addr) = value;
+ VerifiedMemory::Write(const_cast<RawSmi**>(addr), value);
}
friend class Api;
« runtime/vm/assembler_ia32.cc ('K') | « runtime/vm/pages.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698