| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 380 |
| 381 | 381 |
| 382 Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) { | 382 Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) { |
| 383 if (object_id == kTrueValue) { | 383 if (object_id == kTrueValue) { |
| 384 return AllocateDartCObjectBool(true); | 384 return AllocateDartCObjectBool(true); |
| 385 } | 385 } |
| 386 if (object_id == kFalseValue) { | 386 if (object_id == kFalseValue) { |
| 387 return AllocateDartCObjectBool(false); | 387 return AllocateDartCObjectBool(false); |
| 388 } | 388 } |
| 389 if (object_id == kDynamicType || | 389 if (object_id == kDynamicType || |
| 390 object_id == kDoubleInterface || | 390 object_id == kDoubleType || |
| 391 object_id == kIntInterface || | 391 object_id == kIntInterface || |
| 392 object_id == kBoolType || | 392 object_id == kBoolType || |
| 393 object_id == kStringInterface) { | 393 object_id == kStringInterface) { |
| 394 // Always return dynamic type (this is only a marker). | 394 // Always return dynamic type (this is only a marker). |
| 395 return &dynamic_type_marker; | 395 return &dynamic_type_marker; |
| 396 } | 396 } |
| 397 intptr_t index = object_id - kMaxPredefinedObjectIds; | 397 intptr_t index = object_id - kMaxPredefinedObjectIds; |
| 398 ASSERT((0 <= index) && (index < backward_references_.length())); | 398 ASSERT((0 <= index) && (index < backward_references_.length())); |
| 399 ASSERT(backward_references_[index]->reference() != NULL); | 399 ASSERT(backward_references_[index]->reference() != NULL); |
| 400 return backward_references_[index]->reference(); | 400 return backward_references_[index]->reference(); |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 // Write out all objects that were added to the forward list and have | 776 // Write out all objects that were added to the forward list and have |
| 777 // not been serialized yet. These would typically be fields of arrays. | 777 // not been serialized yet. These would typically be fields of arrays. |
| 778 // NOTE: The forward list might grow as we process the list. | 778 // NOTE: The forward list might grow as we process the list. |
| 779 for (intptr_t i = 0; i < forward_id_; i++) { | 779 for (intptr_t i = 0; i < forward_id_; i++) { |
| 780 WriteForwardedCObject(forward_list_[i]); | 780 WriteForwardedCObject(forward_list_[i]); |
| 781 } | 781 } |
| 782 UnmarkAllCObjects(object); | 782 UnmarkAllCObjects(object); |
| 783 } | 783 } |
| 784 | 784 |
| 785 } // namespace dart | 785 } // namespace dart |
| OLD | NEW |