| 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 | 761 |
| 762 case kTypedDataFloat32ArrayCid: | 762 case kTypedDataFloat32ArrayCid: |
| 763 case kExternalTypedDataFloat32ArrayCid: | 763 case kExternalTypedDataFloat32ArrayCid: |
| 764 READ_TYPED_DATA(Float32, float); | 764 READ_TYPED_DATA(Float32, float); |
| 765 | 765 |
| 766 case kTypedDataFloat64ArrayCid: | 766 case kTypedDataFloat64ArrayCid: |
| 767 case kExternalTypedDataFloat64ArrayCid: | 767 case kExternalTypedDataFloat64ArrayCid: |
| 768 READ_TYPED_DATA(Float64, double); | 768 READ_TYPED_DATA(Float64, double); |
| 769 | 769 |
| 770 case kGrowableObjectArrayCid: { | 770 case kGrowableObjectArrayCid: { |
| 771 // A GrowableObjectArray is serialized as its length followed by | 771 // A GrowableObjectArray is serialized as its type arguments and |
| 772 // its backing store. The backing store is an array with a | 772 // length followed by its backing store. The backing store is an |
| 773 // length which might be longer than the length of the | 773 // array with a length which might be longer than the length of |
| 774 // GrowableObjectArray. | 774 // the GrowableObjectArray. |
| 775 |
| 776 // Read and skip the type arguments field. |
| 777 // TODO(sjesse): Remove this when message serialization format is |
| 778 // updated (currently type_arguments is leaked). |
| 779 Dart_CObject* type_arguments = ReadObjectImpl(); |
| 780 if (type_arguments != &type_arguments_marker && |
| 781 type_arguments->type != Dart_CObject_kNull) { |
| 782 return AllocateDartCObjectUnsupported(); |
| 783 } |
| 784 |
| 785 // Read the length field. |
| 775 intptr_t len = ReadSmiValue(); | 786 intptr_t len = ReadSmiValue(); |
| 776 | 787 |
| 777 Dart_CObject* value = GetBackRef(object_id); | 788 Dart_CObject* value = GetBackRef(object_id); |
| 778 ASSERT(value == NULL); | 789 ASSERT(value == NULL); |
| 779 // Allocate an empty array for the GrowableObjectArray which | 790 // Allocate an empty array for the GrowableObjectArray which |
| 780 // will be updated to point to the content when the backing | 791 // will be updated to point to the content when the backing |
| 781 // store has been deserialized. | 792 // store has been deserialized. |
| 782 value = AllocateDartCObjectArray(0); | 793 value = AllocateDartCObjectArray(0); |
| 783 AddBackRef(object_id, value, kIsDeserialized); | 794 AddBackRef(object_id, value, kIsDeserialized); |
| 784 // Read the content of the GrowableObjectArray. | 795 // Read the content of the GrowableObjectArray. |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 if (!success) { | 1315 if (!success) { |
| 1305 UnmarkAllCObjects(object); | 1316 UnmarkAllCObjects(object); |
| 1306 return false; | 1317 return false; |
| 1307 } | 1318 } |
| 1308 } | 1319 } |
| 1309 UnmarkAllCObjects(object); | 1320 UnmarkAllCObjects(object); |
| 1310 return true; | 1321 return true; |
| 1311 } | 1322 } |
| 1312 | 1323 |
| 1313 } // namespace dart | 1324 } // namespace dart |
| OLD | NEW |