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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 9415043: Port async file operations to be using native ports instead or an isolate (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to remove #import from op.dart 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/bin/file_impl.dart ('k') | no next file » | 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 8ea8b416870c019df1b5486a93abe83cae3c7ff7..fb4b9426a56feed74699ef49ed087e4d5da94817 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -182,14 +182,17 @@ Dart_CObject* ApiMessageReader::ReadInlinedObject(intptr_t object_id) {
case Object::kTypeArgumentsClass: {
// TODO(sjesse): Remove this when message serialization format is
// updated (currently length is leaked).
- AddBackwardReference(object_id, NULL);
+ Dart_CObject* value = &type_arguments_marker;
+ AddBackwardReference(object_id, value);
Dart_CObject* length = ReadObject();
ASSERT(length->type == Dart_CObject::kInt32);
for (int i = 0; i < length->value.as_int32; i++) {
Dart_CObject* type = ReadObject();
- if (type != &dynamic_type_marker) return NULL;
+ if (type != &dynamic_type_marker) {
+ return NULL;
+ }
}
- return &type_arguments_marker;
+ return value;
}
case ObjectStore::kArrayClass: {
intptr_t len = ReadSmiValue();
@@ -315,8 +318,12 @@ Dart_CObject* ApiMessageReader::ReadObjectImpl(intptr_t header) {
Dart_CObject* ApiMessageReader::ReadObject() {
int64_t value = Read<int64_t>();
if ((value & kSmiTagMask) == 0) {
- Dart_CObject* dart_value = AllocateDartCObjectInt32(value >> kSmiTagShift);
- return dart_value;
+ int64_t untagged_value = value >> kSmiTagShift;
+ if (kMinInt32 <= untagged_value && untagged_value <= kMaxInt32) {
+ return AllocateDartCObjectInt32(untagged_value);
+ } else {
+ return AllocateDartCObjectInt64(untagged_value);
+ }
}
ASSERT((value <= kIntptrMax) && (value >= kIntptrMin));
return ReadObjectImpl(value);
« no previous file with comments | « runtime/bin/file_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698