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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 8773026: Canonicalize TypeArguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« runtime/vm/raw_object.h ('K') | « 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 2094)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -300,22 +300,26 @@
RawTypeArguments* TypeArguments::ReadFrom(SnapshotReader* reader,
- intptr_t object_id,
- bool classes_serialized) {
+ intptr_t object_id,
+ bool classes_serialized) {
ASSERT(reader != NULL);
// Read the length so that we can determine instance size to allocate.
RawSmi* smi_len = GetSmi(reader->Read<intptr_t>());
intptr_t len = Smi::Value(smi_len);
+ Bool& is_canonical = Bool::Handle();
+ is_canonical ^= reader->ReadObject();
- TypeArguments& type_array = TypeArguments::Handle(TypeArguments::New(len));
- reader->AddBackwardReference(object_id, &type_array);
+ TypeArguments& type_arguments =
+ TypeArguments::Handle(TypeArguments::New(len));
+ type_arguments.set_is_canonical(is_canonical.raw() == Bool::True());
+ reader->AddBackwardReference(object_id, &type_arguments);
AbstractType& type = AbstractType::Handle();
for (intptr_t i = 0; i < len; i++) {
type ^= reader->ReadObject();
- type_array.SetTypeAt(i, type);
+ type_arguments.SetTypeAt(i, type);
}
- return type_array.raw();
+ return type_arguments.raw();
}
@@ -332,6 +336,7 @@
// Write out the length field.
writer->Write<RawObject*>(ptr()->length_);
+ writer->WriteObject(ptr()->is_canonical_);
// Write out the individual types.
intptr_t len = Smi::Value(ptr()->length_);
« runtime/vm/raw_object.h ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698