Index: runtime/vm/snapshot.cc |
=================================================================== |
--- runtime/vm/snapshot.cc (revision 29540) |
+++ runtime/vm/snapshot.cc (working copy) |
@@ -150,6 +150,8 @@ |
isolate_(isolate), |
cls_(Class::Handle()), |
obj_(Object::Handle()), |
+ array_(Array::Handle()), |
+ field_(Field::Handle()), |
str_(String::Handle()), |
library_(Library::Handle()), |
type_(AbstractType::Handle()), |
@@ -789,9 +791,21 @@ |
instance_size = cls_.instance_size(); |
} |
intptr_t offset = Object::InstanceSize(); |
+ intptr_t result_cid = result->GetClassId(); |
while (offset < instance_size) { |
obj_ = ReadObjectRef(); |
result->SetFieldAtOffset(offset, obj_); |
+ if (kind_ == Snapshot::kMessage) { |
+ cls_ = isolate()->class_table()->At(result_cid); |
Ivan Posva
2013/11/01 04:50:05
You want to look this up only once and not for eve
Florian Schneider
2013/11/01 10:39:27
Done. Added TODO.
|
+ array_ = cls_.OffsetToFieldMap(); |
Ivan Posva
2013/11/01 04:50:05
ditto
Florian Schneider
2013/11/01 10:39:27
Done.
|
+ field_ ^= array_.At(offset / kWordSize); |
Ivan Posva
2013/11/01 04:50:05
offset >> kWordSizeLog2
Florian Schneider
2013/11/01 10:39:27
Done.
|
+ // Entries can be null because offset can be outside of instance fields |
+ // due to rounded allocation size. |
+ if (!field_.IsNull()) { |
+ ASSERT(field_.Offset() == offset); |
+ field_.UpdateGuardedCidAndLength(obj_); |
+ } |
+ } |
Ivan Posva
2013/11/01 04:50:05
We also wanted to assert that when deserializing o
Florian Schneider
2013/11/01 10:39:27
Added TODO. I'll think about how to assert this fo
|
offset += kWordSize; |
} |
if (kind_ == Snapshot::kFull) { |