OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/dart_api_message.h" | 5 #include "vm/dart_api_message.h" |
6 #include "vm/object.h" | 6 #include "vm/object.h" |
7 #include "vm/snapshot_ids.h" | 7 #include "vm/snapshot_ids.h" |
8 #include "vm/symbols.h" | 8 #include "vm/symbols.h" |
9 #include "vm/unicode.h" | 9 #include "vm/unicode.h" |
10 | 10 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 while (i < len) { | 601 while (i < len) { |
602 p += Utf8::Encode(Utf16::Next(utf16, &i, len), p); | 602 p += Utf8::Encode(Utf16::Next(utf16, &i, len), p); |
603 } | 603 } |
604 *p = '\0'; | 604 *p = '\0'; |
605 ASSERT(p == (object->value.as_string + utf8_len)); | 605 ASSERT(p == (object->value.as_string + utf8_len)); |
606 ::free(utf16); | 606 ::free(utf16); |
607 return object; | 607 return object; |
608 } | 608 } |
609 case kSendPortCid: { | 609 case kSendPortCid: { |
610 int64_t value64 = Read<int64_t>(); | 610 int64_t value64 = Read<int64_t>(); |
| 611 int64_t originId = Read<uint64_t>(); |
611 Dart_CObject* object = AllocateDartCObject(Dart_CObject_kSendPort); | 612 Dart_CObject* object = AllocateDartCObject(Dart_CObject_kSendPort); |
612 object->value.as_send_port = value64; | 613 object->value.as_send_port.id = value64; |
| 614 object->value.as_send_port.origin_id = originId; |
613 AddBackRef(object_id, object, kIsDeserialized); | 615 AddBackRef(object_id, object, kIsDeserialized); |
614 return object; | 616 return object; |
615 } | 617 } |
616 | 618 |
617 #define READ_TYPED_DATA_HEADER(type) \ | 619 #define READ_TYPED_DATA_HEADER(type) \ |
618 intptr_t len = ReadSmiValue(); \ | 620 intptr_t len = ReadSmiValue(); \ |
619 Dart_CObject* object = \ | 621 Dart_CObject* object = \ |
620 AllocateDartCObjectTypedData(Dart_TypedData_k##type, len); \ | 622 AllocateDartCObjectTypedData(Dart_TypedData_k##type, len); \ |
621 AddBackRef(object_id, object, kIsDeserialized); \ | 623 AddBackRef(object_id, object, kIsDeserialized); \ |
622 | 624 |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 if (!success) { | 1223 if (!success) { |
1222 UnmarkAllCObjects(object); | 1224 UnmarkAllCObjects(object); |
1223 return false; | 1225 return false; |
1224 } | 1226 } |
1225 } | 1227 } |
1226 UnmarkAllCObjects(object); | 1228 UnmarkAllCObjects(object); |
1227 return true; | 1229 return true; |
1228 } | 1230 } |
1229 | 1231 |
1230 } // namespace dart | 1232 } // namespace dart |
OLD | NEW |