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

Unified Diff: runtime/vm/snapshot.cc

Issue 130563005: Fix dartbug.com/15963: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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/snapshot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 31744)
+++ runtime/vm/snapshot.cc (working copy)
@@ -478,6 +478,16 @@
}
+RawInstance* SnapshotReader::NewInstance() {
+ ASSERT(kind_ == Snapshot::kFull);
+ ASSERT(isolate()->no_gc_scope_depth() != 0);
+ cls_ = object_store()->object_class();
+ RawInstance* obj = reinterpret_cast<RawInstance*>(
+ AllocateUninitialized(cls_, Instance::InstanceSize()));
+ return obj;
+}
+
+
RawMint* SnapshotReader::NewMint(int64_t value) {
ASSERT(kind_ == Snapshot::kFull);
ASSERT(isolate()->no_gc_scope_depth() != 0);
@@ -701,6 +711,10 @@
ErrorHandle()->set_exception(exception);
Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
}
+ // Make sure to initialize the last word, as this can be left untouched in
+ // case the object deserialized has an alignment tail.
+ *reinterpret_cast<RawObject**>(address + size - kWordSize) = Object::null();
+
RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
uword tags = 0;
intptr_t index = cls.id();
« no previous file with comments | « runtime/vm/snapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698