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

Unified Diff: runtime/vm/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
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 34648)
+++ runtime/vm/snapshot.cc (working copy)
@@ -779,6 +779,10 @@
if (object_id == kFalseValue) {
return Bool::False().raw();
}
+ if (object_id == kDoubleObject) {
+ ASSERT(kind_ == Snapshot::kMessage);
+ return Double::New(ReadDouble());
+ }
intptr_t class_id = ClassIdFromObjectId(object_id);
if (IsSingletonClassId(class_id)) {
return isolate()->class_table()->At(class_id); // get singleton class.
@@ -1208,6 +1212,13 @@
return true;
}
+ if ((kind_ == Snapshot::kMessage) && (rawobj->GetClassId() == kDoubleCid)) {
+ WriteVMIsolateObject(kDoubleObject);
+ RawDouble* rd = reinterpret_cast<RawDouble*>(rawobj);
+ WriteDouble(rd->ptr()->value_);
+ return true;
+ }
siva 2014/04/03 00:23:16 We should probably consider caching the class id i
Ivan Posva 2014/04/03 00:58:02 Done.
+
// Check if object has already been serialized, in that case just write
// the object id out.
uword tags = rawobj->ptr()->tags_;
« no previous file with comments | « runtime/vm/snapshot.h ('k') | runtime/vm/snapshot_ids.h » ('j') | runtime/vm/snapshot_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698