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

Unified Diff: vm/snapshot.cc

Issue 8970004: Changes to create an application snapshot which can be layered on top (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 | « vm/snapshot.h ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/snapshot.cc
===================================================================
--- vm/snapshot.cc (revision 2601)
+++ vm/snapshot.cc (working copy)
@@ -66,7 +66,7 @@
// Read the class header information and lookup the class.
intptr_t class_header = Read<intptr_t>();
ASSERT((class_header & kSmiTagMask) != 0);
- Class& cls = Class::Handle();
+ Class& cls = Class::ZoneHandle();
cls ^= LookupInternalClass(class_header);
AddBackwardReference(object_id, &cls);
if (cls.IsNull()) {
@@ -193,6 +193,8 @@
}
if (kind_ == Snapshot::kFull) {
result.SetCreatedFromSnapshot();
+ } else if (result.IsCanonical()) {
+ result = result.Canonicalize();
}
return result.raw();
} else {
@@ -419,6 +421,7 @@
// case.
// Write out the class and tags information.
WriteObjectHeader(Object::kClassClass, cls->ptr()->tags_);
+
// Write out the library url and class name.
RawLibrary* library = cls->ptr()->library_;
ASSERT(library != Library::null());
@@ -428,9 +431,14 @@
}
-void ScriptSnapshotWriter::WriteScriptSnapshot() {
- // TODO(asiva): Need to implement this.
- UNIMPLEMENTED();
+void ScriptSnapshotWriter::WriteScriptSnapshot(const Library& lib) {
+ ASSERT(kind() == Snapshot::kScript);
+
+ // Write out the library object.
+ WriteObject(lib.raw());
+
+ // Finalize the snapshot buffer.
+ FinalizeBuffer();
}
« no previous file with comments | « vm/snapshot.h ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698