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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 if (object_id == kTrueValue) { | 403 if (object_id == kTrueValue) { |
404 return AllocateDartCObjectBool(true); | 404 return AllocateDartCObjectBool(true); |
405 } | 405 } |
406 if (object_id == kFalseValue) { | 406 if (object_id == kFalseValue) { |
407 return AllocateDartCObjectBool(false); | 407 return AllocateDartCObjectBool(false); |
408 } | 408 } |
409 if (object_id == kDynamicType || | 409 if (object_id == kDynamicType || |
410 object_id == kDoubleType || | 410 object_id == kDoubleType || |
411 object_id == kIntType || | 411 object_id == kIntType || |
412 object_id == kBoolType || | 412 object_id == kBoolType || |
413 object_id == kStringInterface) { | 413 object_id == kStringType) { |
414 // Always return dynamic type (this is only a marker). | 414 // Always return dynamic type (this is only a marker). |
415 return &dynamic_type_marker; | 415 return &dynamic_type_marker; |
416 } | 416 } |
417 intptr_t index = object_id - kMaxPredefinedObjectIds; | 417 intptr_t index = object_id - kMaxPredefinedObjectIds; |
418 ASSERT((0 <= index) && (index < backward_references_.length())); | 418 ASSERT((0 <= index) && (index < backward_references_.length())); |
419 ASSERT(backward_references_[index]->reference() != NULL); | 419 ASSERT(backward_references_[index]->reference() != NULL); |
420 return backward_references_[index]->reference(); | 420 return backward_references_[index]->reference(); |
421 } | 421 } |
422 | 422 |
423 | 423 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 // 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 |
797 // not been serialized yet. These would typically be fields of arrays. | 797 // not been serialized yet. These would typically be fields of arrays. |
798 // NOTE: The forward list might grow as we process the list. | 798 // NOTE: The forward list might grow as we process the list. |
799 for (intptr_t i = 0; i < forward_id_; i++) { | 799 for (intptr_t i = 0; i < forward_id_; i++) { |
800 WriteForwardedCObject(forward_list_[i]); | 800 WriteForwardedCObject(forward_list_[i]); |
801 } | 801 } |
802 UnmarkAllCObjects(object); | 802 UnmarkAllCObjects(object); |
803 } | 803 } |
804 | 804 |
805 } // namespace dart | 805 } // namespace dart |
OLD | NEW |