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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 12578009: - Canonicalize types, type_arguments only when the object is marked as being from the core librarie… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/snapshot.h » ('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 20396)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -205,8 +205,11 @@
}
// If object needs to be a canonical object, Canonicalize it.
- if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags)) {
- type ^= type.Canonicalize();
+ if (RawObject::IsCanonical(tags)) {
Ivan Posva 2013/03/22 21:17:22 This follows complicated rules and uses informatio
siva 2013/03/22 22:33:19 Added a comment detailing each case (Full, Script
+ if ((kind == Snapshot::kScript && RawObject::IsCreatedFromSnapshot(tags)) ||
+ (kind == Snapshot::kMessage)) {
+ type ^= type.Canonicalize();
+ }
}
// Set the object tags (This is done after 'Canonicalize', which
@@ -458,8 +461,11 @@
}
// If object needs to be a canonical object, Canonicalize it.
- if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags)) {
- type_arguments ^= type_arguments.Canonicalize();
+ if (RawObject::IsCanonical(tags)) {
Ivan Posva 2013/03/22 21:17:22 ditto
siva 2013/03/22 22:33:19 Done.
+ if ((kind == Snapshot::kScript && RawObject::IsCreatedFromSnapshot(tags)) ||
+ (kind == Snapshot::kMessage)) {
+ type_arguments ^= type_arguments.Canonicalize();
+ }
}
// Set the object tags (This is done after setting the object fields
@@ -1597,7 +1603,9 @@
if (kind == Snapshot::kFull) {
mint = reader->NewMint(value);
} else {
- if (RawObject::IsCanonical(tags)) {
+ if (RawObject::IsCanonical(tags) &&
Ivan Posva 2013/03/22 21:17:22 ditto
siva 2013/03/22 22:33:19 Done.
+ (RawObject::IsCreatedFromSnapshot(tags) ||
+ (kind == Snapshot::kMessage))) {
mint = Mint::NewCanonical(value);
} else {
mint = Mint::New(value, HEAP_SPACE(kind));
@@ -1648,8 +1656,11 @@
BigintOperations::FromHexCString(str, HEAP_SPACE(kind))));
// If it is a canonical constant make it one.
- if ((kind != Snapshot::kFull) && RawObject::IsCanonical(tags)) {
- obj ^= obj.Canonicalize();
+ if (RawObject::IsCanonical(tags)) {
Ivan Posva 2013/03/22 21:17:22 ditto.
siva 2013/03/22 22:33:19 Done.
+ if ((kind == Snapshot::kScript && RawObject::IsCreatedFromSnapshot(tags)) ||
+ (kind == Snapshot::kMessage)) {
+ obj ^= obj.Canonicalize();
+ }
}
reader->AddBackRef(object_id, &obj, kIsDeserialized);
@@ -1715,7 +1726,9 @@
if (kind == Snapshot::kFull) {
dbl = reader->NewDouble(value);
} else {
- if (RawObject::IsCanonical(tags)) {
+ if (RawObject::IsCanonical(tags) &&
Ivan Posva 2013/03/22 21:17:22 ditto
siva 2013/03/22 22:33:19 Done.
+ (RawObject::IsCreatedFromSnapshot(tags) ||
+ (kind == Snapshot::kMessage))) {
dbl = Double::NewCanonical(value);
} else {
dbl = Double::New(value, HEAP_SPACE(kind));
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698