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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 26247007: Fix snapshot generation to ensure that the snapshot does not contain (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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/raw_object.h ('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 28360)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -60,7 +60,10 @@
cls.set_tags(tags);
// Set all non object fields.
- cls.set_instance_size_in_words(reader->ReadIntptrValue());
+ if (!RawObject::IsInternalVMdefinedClassId(class_id)) {
+ // Instance size of a VM defined class is already set up.
+ cls.set_instance_size_in_words(reader->ReadIntptrValue());
+ }
cls.set_type_arguments_field_offset_in_words(reader->ReadIntptrValue());
cls.set_next_field_offset_in_words(reader->ReadIntptrValue());
Ivan Posva 2013/10/08 22:33:49 This should be in sync with the instance size fiel
siva 2013/10/08 22:50:39 Done.
cls.set_num_native_fields(reader->ReadIntptrValue());
@@ -98,8 +101,14 @@
// Write out all the non object pointer fields.
// NOTE: cpp_vtable_ is not written.
- writer->WriteIntptrValue(ptr()->id_);
- writer->WriteIntptrValue(ptr()->instance_size_in_words_);
+ intptr_t class_id = ptr()->id_;
+ writer->WriteIntptrValue(class_id);
+ if (!RawObject::IsInternalVMdefinedClassId(class_id)) {
+ // We don't write the instance size of VM defined classes as they
+ // are already setup during initialization as part of pre populating
+ // the class table.
+ writer->WriteIntptrValue(ptr()->instance_size_in_words_);
+ }
writer->WriteIntptrValue(ptr()->type_arguments_field_offset_in_words_);
writer->WriteIntptrValue(ptr()->next_field_offset_in_words_);
Ivan Posva 2013/10/08 22:33:49 ditto
siva 2013/10/08 22:50:39 Done.
writer->WriteIntptrValue(ptr()->num_native_fields_);
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698