| Index: runtime/vm/raw_object_snapshot.cc
|
| ===================================================================
|
| --- runtime/vm/raw_object_snapshot.cc (revision 12871)
|
| +++ runtime/vm/raw_object_snapshot.cc (working copy)
|
| @@ -195,9 +195,6 @@
|
| Type& type = Type::ZoneHandle(reader->isolate(), NEW_OBJECT(Type));
|
| reader->AddBackRef(object_id, &type, kIsDeserialized);
|
|
|
| - // Set the object tags.
|
| - type.set_tags(tags);
|
| -
|
| // Set all non object fields.
|
| type.set_token_pos(reader->ReadIntptrValue());
|
| type.set_type_state(reader->Read<int8_t>());
|
| @@ -211,9 +208,14 @@
|
| }
|
|
|
| // If object needs to be a canonical object, Canonicalize it.
|
| - if ((kind != Snapshot::kFull) && type.IsCanonical()) {
|
| + if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags)) {
|
| type ^= type.Canonicalize();
|
| }
|
| +
|
| + // Set the object tags (This is done after 'Canonicalize', which
|
| + // does not canonicalize a type already marked as canonical).
|
| + type.set_tags(tags);
|
| +
|
| return type.raw();
|
| }
|
|
|
| @@ -332,15 +334,17 @@
|
| type_arguments.SetTypeAt(i, *reader->TypeHandle());
|
| }
|
|
|
| + // If object needs to be a canonical object, Canonicalize it.
|
| + if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags)) {
|
| + type_arguments ^= type_arguments.Canonicalize();
|
| + }
|
| +
|
| // Set the object tags (This is done after setting the object fields
|
| // because 'SetTypeAt' has an assertion to check if the object is not
|
| - // already canonical).
|
| + // already canonical. Also, this is done after 'Canonicalize', which
|
| + // does not canonicalize a type already marked as canonical).
|
| type_arguments.set_tags(tags);
|
|
|
| - // If object needs to be a canonical object, Canonicalize it.
|
| - if ((kind != Snapshot::kFull) && type_arguments.IsCanonical()) {
|
| - type_arguments ^= type_arguments.Canonicalize();
|
| - }
|
| return type_arguments.raw();
|
| }
|
|
|
|
|