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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 16780009: When canonicalize instances check if all fields are canonical. If a field is a non-canonical number… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 // When reading a full snapshot we don't need to canonicalize the object 1704 // When reading a full snapshot we don't need to canonicalize the object
1705 // as it would already be a canonical object. 1705 // as it would already be a canonical object.
1706 // When reading a script snapshot we need to canonicalize only those object 1706 // When reading a script snapshot we need to canonicalize only those object
1707 // references that are objects from the core library (loaded from a 1707 // references that are objects from the core library (loaded from a
1708 // full snapshot). Objects that are only in the script need not be 1708 // full snapshot). Objects that are only in the script need not be
1709 // canonicalized as they are already canonical. 1709 // canonicalized as they are already canonical.
1710 // When reading a message snapshot we always have to canonicalize the object. 1710 // When reading a message snapshot we always have to canonicalize the object.
1711 if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags) && 1711 if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags) &&
1712 (RawObject::IsCreatedFromSnapshot(tags) || 1712 (RawObject::IsCreatedFromSnapshot(tags) ||
1713 (kind == Snapshot::kMessage))) { 1713 (kind == Snapshot::kMessage))) {
1714 obj ^= obj.Canonicalize(); 1714 obj ^= obj.CheckAndCanonicalize(NULL);
1715 ASSERT(!obj.IsNull());
1715 } 1716 }
1716 reader->AddBackRef(object_id, &obj, kIsDeserialized); 1717 reader->AddBackRef(object_id, &obj, kIsDeserialized);
1717 1718
1718 // Set the object tags. 1719 // Set the object tags.
1719 obj.set_tags(tags); 1720 obj.set_tags(tags);
1720 1721
1721 return obj.raw(); 1722 return obj.raw();
1722 } 1723 }
1723 1724
1724 1725
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 // Write out the class and tags information. 2640 // Write out the class and tags information.
2640 writer->WriteIndexedObject(kWeakPropertyCid); 2641 writer->WriteIndexedObject(kWeakPropertyCid);
2641 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2642 writer->WriteIntptrValue(writer->GetObjectTags(this));
2642 2643
2643 // Write out all the other fields. 2644 // Write out all the other fields.
2644 writer->Write<RawObject*>(ptr()->key_); 2645 writer->Write<RawObject*>(ptr()->key_);
2645 writer->Write<RawObject*>(ptr()->value_); 2646 writer->Write<RawObject*>(ptr()->value_);
2646 } 2647 }
2647 2648
2648 } // namespace dart 2649 } // namespace dart
OLDNEW
« 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