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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 399 |
400 Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) { | 400 Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) { |
401 if (object_id == kTrueValue) { | 401 if (object_id == kTrueValue) { |
402 return AllocateDartCObjectBool(true); | 402 return AllocateDartCObjectBool(true); |
403 } | 403 } |
404 if (object_id == kFalseValue) { | 404 if (object_id == kFalseValue) { |
405 return AllocateDartCObjectBool(false); | 405 return AllocateDartCObjectBool(false); |
406 } | 406 } |
407 if (object_id == kDynamicType || | 407 if (object_id == kDynamicType || |
408 object_id == kDoubleType || | 408 object_id == kDoubleType || |
409 object_id == kIntInterface || | 409 object_id == kIntType || |
410 object_id == kBoolType || | 410 object_id == kBoolType || |
411 object_id == kStringInterface) { | 411 object_id == kStringInterface) { |
412 // Always return dynamic type (this is only a marker). | 412 // Always return dynamic type (this is only a marker). |
413 return &dynamic_type_marker; | 413 return &dynamic_type_marker; |
414 } | 414 } |
415 intptr_t index = object_id - kMaxPredefinedObjectIds; | 415 intptr_t index = object_id - kMaxPredefinedObjectIds; |
416 ASSERT((0 <= index) && (index < backward_references_.length())); | 416 ASSERT((0 <= index) && (index < backward_references_.length())); |
417 ASSERT(backward_references_[index]->reference() != NULL); | 417 ASSERT(backward_references_[index]->reference() != NULL); |
418 return backward_references_[index]->reference(); | 418 return backward_references_[index]->reference(); |
419 } | 419 } |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 // Write out all objects that were added to the forward list and have | 794 // Write out all objects that were added to the forward list and have |
795 // not been serialized yet. These would typically be fields of arrays. | 795 // not been serialized yet. These would typically be fields of arrays. |
796 // NOTE: The forward list might grow as we process the list. | 796 // NOTE: The forward list might grow as we process the list. |
797 for (intptr_t i = 0; i < forward_id_; i++) { | 797 for (intptr_t i = 0; i < forward_id_; i++) { |
798 WriteForwardedCObject(forward_list_[i]); | 798 WriteForwardedCObject(forward_list_[i]); |
799 } | 799 } |
800 UnmarkAllCObjects(object); | 800 UnmarkAllCObjects(object); |
801 } | 801 } |
802 | 802 |
803 } // namespace dart | 803 } // namespace dart |
OLD | NEW |