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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 745203002: - Make array immutable first, then canonicalize it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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/parser.cc ('k') | runtime/vm/snapshot.cc » ('j') | 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 41861)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -1756,7 +1756,7 @@
// allocations may happen.
intptr_t num_flds = (obj.raw()->to() - obj.raw()->from());
for (intptr_t i = 0; i <= num_flds; i++) {
- (*reader->PassiveObjectHandle()) = reader->ReadObjectRef();
+ (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl();
obj.StorePointer(obj.raw()->from() + i,
reader->PassiveObjectHandle()->raw());
}
@@ -1796,7 +1796,7 @@
writer->WriteTags(writer->GetObjectTags(this));
// Write out all the object pointer fields.
- SnapshotWriterVisitor visitor(writer);
+ SnapshotWriterVisitor visitor(writer, false);
visitor.VisitPointers(from(), to());
}
@@ -2108,6 +2108,7 @@
NEW_OBJECT_WITH_LEN_SPACE(Array, len, kind)));
reader->AddBackRef(object_id, array, kIsDeserialized);
}
+ ASSERT(!RawObject::IsCanonical(tags));
reader->ArrayReadFrom(*array, len, tags);
return array->raw();
}
@@ -2129,6 +2130,9 @@
reader->AddBackRef(object_id, array, kIsDeserialized);
}
reader->ArrayReadFrom(*array, len, tags);
+ if (RawObject::IsCanonical(tags)) {
+ *array ^= array->CheckAndCanonicalize(NULL);
+ }
return raw(*array);
}
@@ -2136,6 +2140,7 @@
void RawArray::WriteTo(SnapshotWriter* writer,
intptr_t object_id,
Snapshot::Kind kind) {
+ ASSERT(!RawObject::IsCanonical(writer->GetObjectTags(this)));
writer->ArrayWriteTo(object_id,
kArrayCid,
writer->GetObjectTags(this),
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698