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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 221973004: - Handle doubles transferred in message snapshots specially. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/dart_api_message.cc ('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 34679)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -1774,8 +1774,9 @@
intptr_t tags,
Snapshot::Kind kind) {
ASSERT(reader != NULL);
+ ASSERT(kind != Snapshot::kMessage);
// Read the double value for the object.
- double value = reader->Read<double>();
+ double value = reader->ReadDouble();
// Create a Double object or get canonical one if it is a canonical constant.
Double& dbl = Double::ZoneHandle(reader->isolate(), Double::null());
@@ -1786,10 +1787,8 @@
// references that are objects from the core library (loaded from a
// full snapshot). Objects that are only in the script need not be
// canonicalized as they are already canonical.
- // When reading a message snapshot we always have to canonicalize.
if (RawObject::IsCanonical(tags) &&
- (RawObject::IsCreatedFromSnapshot(tags) ||
- (kind == Snapshot::kMessage))) {
+ RawObject::IsCreatedFromSnapshot(tags)) {
dbl = Double::NewCanonical(value);
} else {
dbl = Double::New(value, HEAP_SPACE(kind));
@@ -1817,7 +1816,7 @@
writer->WriteIntptrValue(writer->GetObjectTags(this));
// Write out the double value.
- writer->Write<double>(ptr()->value_);
+ writer->WriteDouble(ptr()->value_);
}
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698