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/snapshot.h" | 5 #include "vm/snapshot.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } else { | 566 } else { |
567 WriteIndexedObject(ObjectStore::kFalseValue); | 567 WriteIndexedObject(ObjectStore::kFalseValue); |
568 } | 568 } |
569 break; | 569 break; |
570 case Dart_CObject::kInt32: | 570 case Dart_CObject::kInt32: |
571 WriteInt32(object); | 571 WriteInt32(object); |
572 break; | 572 break; |
573 case Dart_CObject::kInt64: | 573 case Dart_CObject::kInt64: |
574 WriteInt64(object); | 574 WriteInt64(object); |
575 break; | 575 break; |
| 576 case Dart_CObject::kBigint: { |
| 577 // Write out the serialization header value for this object. |
| 578 WriteInlinedHeader(object); |
| 579 // Write out the class and tags information. |
| 580 WriteObjectHeader(ObjectStore::kBigintClass, 0); |
| 581 // Write hex string length and content |
| 582 char* hex_string = object->value.as_bigint; |
| 583 intptr_t len = strlen(hex_string); |
| 584 WriteIntptrValue(len); |
| 585 for (intptr_t i = 0; i < len; i++) { |
| 586 Write<uint8_t>(hex_string[i]); |
| 587 } |
| 588 break; |
| 589 } |
576 case Dart_CObject::kDouble: | 590 case Dart_CObject::kDouble: |
577 // Write out the serialization header value for this object. | 591 // Write out the serialization header value for this object. |
578 WriteInlinedHeader(object); | 592 WriteInlinedHeader(object); |
579 // Write out the class and tags information. | 593 // Write out the class and tags information. |
580 WriteObjectHeader(ObjectStore::kDoubleClass, 0); | 594 WriteObjectHeader(ObjectStore::kDoubleClass, 0); |
581 // Write double value. | 595 // Write double value. |
582 Write<double>(object->value.as_double); | 596 Write<double>(object->value.as_double); |
583 break; | 597 break; |
584 case Dart_CObject::kString: { | 598 case Dart_CObject::kString: { |
585 // Write out the serialization header value for this object. | 599 // Write out the serialization header value for this object. |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 853 |
840 | 854 |
841 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 855 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
842 for (RawObject** current = first; current <= last; current++) { | 856 for (RawObject** current = first; current <= last; current++) { |
843 RawObject* raw_obj = *current; | 857 RawObject* raw_obj = *current; |
844 writer_->WriteObject(raw_obj); | 858 writer_->WriteObject(raw_obj); |
845 } | 859 } |
846 } | 860 } |
847 | 861 |
848 } // namespace dart | 862 } // namespace dart |
OLD | NEW |