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

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

Issue 11318018: - Represent strings internally in UTF-16 format, this makes it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
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 9
10 namespace dart { 10 namespace dart {
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 char* p = object->value.as_string; 351 char* p = object->value.as_string;
352 for (intptr_t i = 0; i < len; i++) { 352 for (intptr_t i = 0; i < len; i++) {
353 p[i] = Read<uint8_t>(); 353 p[i] = Read<uint8_t>();
354 } 354 }
355 p[len] = '\0'; 355 p[len] = '\0';
356 return object; 356 return object;
357 } 357 }
358 case kTwoByteStringCid: 358 case kTwoByteStringCid:
359 // Two byte strings not supported. 359 // Two byte strings not supported.
360 return AllocateDartCObjectUnsupported(); 360 return AllocateDartCObjectUnsupported();
361 case kFourByteStringCid:
362 // Four byte strings not supported.
363 return AllocateDartCObjectUnsupported();
364 case kUint8ArrayCid: { 361 case kUint8ArrayCid: {
365 intptr_t len = ReadSmiValue(); 362 intptr_t len = ReadSmiValue();
366 Dart_CObject* object = AllocateDartCObjectUint8Array(len); 363 Dart_CObject* object = AllocateDartCObjectUint8Array(len);
367 AddBackRef(object_id, object, kIsDeserialized); 364 AddBackRef(object_id, object, kIsDeserialized);
368 if (len > 0) { 365 if (len > 0) {
369 uint8_t* p = object->value.as_byte_array.values; 366 uint8_t* p = object->value.as_byte_array.values;
370 for (intptr_t i = 0; i < len; i++) { 367 for (intptr_t i = 0; i < len; i++) {
371 p[i] = Read<uint8_t>(); 368 p[i] = Read<uint8_t>();
372 } 369 }
373 } 370 }
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 // Write out all objects that were added to the forward list and have 796 // Write out all objects that were added to the forward list and have
800 // not been serialized yet. These would typically be fields of arrays. 797 // not been serialized yet. These would typically be fields of arrays.
801 // NOTE: The forward list might grow as we process the list. 798 // NOTE: The forward list might grow as we process the list.
802 for (intptr_t i = 0; i < forward_id_; i++) { 799 for (intptr_t i = 0; i < forward_id_; i++) {
803 WriteForwardedCObject(forward_list_[i]); 800 WriteForwardedCObject(forward_list_[i]);
804 } 801 }
805 UnmarkAllCObjects(object); 802 UnmarkAllCObjects(object);
806 } 803 }
807 804
808 } // namespace dart 805 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698