| 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 | 9 | 
| 10 namespace dart { | 10 namespace dart { | 
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|