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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 151773006: Write the type arguments instantiations field to full snapshots only. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/dart_api_message.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 32510)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -448,9 +448,16 @@
reader->isolate(), NEW_OBJECT_WITH_LEN_SPACE(TypeArguments, len, kind));
reader->AddBackRef(object_id, &type_arguments, kIsDeserialized);
- // Now set all the object fields.
- *reader->ArrayHandle() ^= reader->ReadObjectImpl();
- type_arguments.set_instantiations(*reader->ArrayHandle());
+ // Set the instantiations field, which is only read from a full snapshot.
+ if (kind == Snapshot::kFull) {
+ *reader->ArrayHandle() ^= reader->ReadObjectImpl();
+ type_arguments.set_instantiations(*reader->ArrayHandle());
+ } else {
+ // TODO(regis): Change to Object::zero_array() once supported.
+ type_arguments.set_instantiations(Object::empty_array());
+ }
+
+ // Now set all the type fields.
for (intptr_t i = 0; i < len; i++) {
*reader->TypeHandle() ^= reader->ReadObjectImpl();
type_arguments.set_type_at(i, *reader->TypeHandle());
@@ -495,8 +502,10 @@
// Write out the length field.
writer->Write<RawObject*>(ptr()->length_);
- // Write out the instantiations field.
- writer->WriteObjectImpl(ptr()->instantiations_);
+ // Write out the instantiations field, but only in a full snapshot.
+ if (kind == Snapshot::kFull) {
+ writer->WriteObjectImpl(ptr()->instantiations_);
+ }
// Write out the individual types.
intptr_t len = Smi::Value(ptr()->length_);
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698