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

Unified Diff: runtime/vm/dart_api_message.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 | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_message.cc
===================================================================
--- runtime/vm/dart_api_message.cc (revision 34679)
+++ runtime/vm/dart_api_message.cc (working copy)
@@ -458,6 +458,9 @@
if (object_id == kFalseValue) {
return AllocateDartCObjectBool(false);
}
+ if (object_id == kDoubleObject) {
+ return AllocateDartCObjectDouble(ReadDouble());
+ }
if (Symbols::IsVMSymbolId(object_id)) {
return ReadVMSymbol(object_id);
}
@@ -537,10 +540,9 @@
return object;
}
case kDoubleCid: {
- // Read the double value for the object.
- Dart_CObject* object = AllocateDartCObjectDouble(Read<double>());
- AddBackRef(object_id, object, kIsDeserialized);
- return object;
+ // Doubles are handled specially when being sent as part of message
+ // snapshots.
+ UNREACHABLE();
}
case kOneByteStringCid: {
intptr_t len = ReadSmiValue();
@@ -1053,13 +1055,8 @@
break;
}
case Dart_CObject_kDouble:
- // Write out the serialization header value for this object.
- WriteInlinedHeader(object);
- // Write out the class and tags information.
- WriteIndexedObject(kDoubleCid);
- WriteIntptrValue(0);
- // Write double value.
- Write<double>(object->value.as_double);
+ WriteVMIsolateObject(kDoubleObject);
+ WriteDouble(object->value.as_double);
break;
case Dart_CObject_kString: {
const uint8_t* utf8_str =
« no previous file with comments | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698