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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 9348048: Add support for medium integers to the native message format (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 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.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/dart_api_message.cc
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index d5f2e69d77bd4af57603a0de4fb1e5e0daa59104..3624242d25aab309b5bec2ead99351ed60b64600 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -81,6 +81,13 @@ Dart_CObject* ApiMessageReader::AllocateDartCObjectInt32(int32_t val) {
}
+Dart_CObject* ApiMessageReader::AllocateDartCObjectInt64(int64_t val) {
+ Dart_CObject* value = AllocateDartCObject(Dart_CObject::kInt64);
+ value->value.as_int64 = val;
+ return value;
+}
+
+
Dart_CObject* ApiMessageReader::AllocateDartCObjectDouble(double val) {
Dart_CObject* value = AllocateDartCObject(Dart_CObject::kDouble);
value->value.as_double = val;
@@ -190,6 +197,15 @@ Dart_CObject* ApiMessageReader::ReadInlinedObject(intptr_t object_id) {
return value;
break;
}
+ case ObjectStore::kMintClass: {
+ int64_t value = Read<int64_t>();
+ if (kMinInt32 <= value && value <= kMaxInt32) {
+ return AllocateDartCObjectInt32(value);
+ } else {
+ return AllocateDartCObjectInt64(value);
+ }
+ break;
+ }
case ObjectStore::kDoubleClass: {
// Read the double value for the object.
Dart_CObject* object = AllocateDartCObjectDouble(Read<double>());
« no previous file with comments | « runtime/vm/dart_api_message.h ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698