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

Unified Diff: vm/raw_object_snapshot.cc

Issue 10414005: Remove script source from the snapshot in order to reduce the size and to make the image size small… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « vm/object.cc ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/raw_object_snapshot.cc
===================================================================
--- vm/raw_object_snapshot.cc (revision 7771)
+++ vm/raw_object_snapshot.cc (working copy)
@@ -642,10 +642,13 @@
// Set all the object fields.
// TODO(5411462): Need to assert No GC can happen here, even though
// allocations may happen.
- intptr_t num_flds = (script.raw()->to() - script.raw()->from());
- for (intptr_t i = 0; i <= num_flds; i++) {
- *(script.raw()->from() + i) = reader->ReadObject();
- }
+ *reader->StringHandle() ^= reader->ReadObject();
+ script.set_url(*reader->StringHandle());
+ *reader->StringHandle() ^= String::null();
+ script.set_source(*reader->StringHandle());
+ TokenStream& stream = TokenStream::Handle();
+ stream ^= reader->ReadObject();
+ script.set_tokens(stream);
return script.raw();
}
@@ -665,8 +668,8 @@
writer->WriteObjectHeader(Object::kScriptClass, ptr()->tags_);
// Write out all the object pointer fields.
- SnapshotWriterVisitor visitor(writer);
- visitor.VisitPointers(from(), to());
+ writer->WriteObject(ptr()->url_);
+ writer->WriteObject(ptr()->tokens_);
}
« no previous file with comments | « vm/object.cc ('k') | vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698