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

Side by Side Diff: runtime/vm/dart_api_message.cc

Issue 1388543008: 1. Write the backing data array of a GrowableObjectArray as a reference (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync-to-tot Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698