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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 intptr_t len = ReadSmiValue(); | 787 intptr_t len = ReadSmiValue(); |
788 | 788 |
789 Dart_CObject* value = GetBackRef(object_id); | 789 Dart_CObject* value = GetBackRef(object_id); |
790 ASSERT(value == NULL); | 790 ASSERT(value == NULL); |
791 // Allocate an empty array for the GrowableObjectArray which | 791 // Allocate an empty array for the GrowableObjectArray which |
792 // will be updated to point to the content when the backing | 792 // will be updated to point to the content when the backing |
793 // store has been deserialized. | 793 // store has been deserialized. |
794 value = AllocateDartCObjectArray(0); | 794 value = AllocateDartCObjectArray(0); |
795 AddBackRef(object_id, value, kIsDeserialized); | 795 AddBackRef(object_id, value, kIsDeserialized); |
796 // Read the content of the GrowableObjectArray. | 796 // Read the content of the GrowableObjectArray. |
797 Dart_CObject* content = ReadObjectImpl(); | 797 Dart_CObject* content = ReadObjectRef(); |
798 ASSERT(content->type == Dart_CObject_kArray); | 798 ASSERT(content->type == Dart_CObject_kArray); |
799 // Make the empty array allocated point to the backing store content. | 799 // Make the empty array allocated point to the backing store content. |
800 value->value.as_array.length = len; | 800 value->value.as_array.length = len; |
801 value->value.as_array.values = content->value.as_array.values; | 801 value->value.as_array.values = content->value.as_array.values; |
802 return value; | 802 return value; |
803 } | 803 } |
804 default: | 804 default: |
805 // Everything else not supported. | 805 // Everything else not supported. |
806 Dart_CObject* value = AllocateDartCObjectUnsupported(); | 806 Dart_CObject* value = AllocateDartCObjectUnsupported(); |
807 AddBackRef(object_id, value, kIsDeserialized); | 807 AddBackRef(object_id, value, kIsDeserialized); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 if (!success) { | 1316 if (!success) { |
1317 UnmarkAllCObjects(object); | 1317 UnmarkAllCObjects(object); |
1318 return false; | 1318 return false; |
1319 } | 1319 } |
1320 } | 1320 } |
1321 UnmarkAllCObjects(object); | 1321 UnmarkAllCObjects(object); |
1322 return true; | 1322 return true; |
1323 } | 1323 } |
1324 | 1324 |
1325 } // namespace dart | 1325 } // namespace dart |
OLD | NEW |