| 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/bigint_operations.h" | 5 #include "vm/bigint_operations.h" |
| 6 #include "vm/object.h" | 6 #include "vm/object.h" |
| 7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
| 8 #include "vm/snapshot.h" | 8 #include "vm/snapshot.h" |
| 9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
| 10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 | 762 |
| 763 // Allocate field object. | 763 // Allocate field object. |
| 764 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); | 764 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); |
| 765 reader->AddBackRef(object_id, &field, kIsDeserialized); | 765 reader->AddBackRef(object_id, &field, kIsDeserialized); |
| 766 | 766 |
| 767 // Set the object tags. | 767 // Set the object tags. |
| 768 field.set_tags(tags); | 768 field.set_tags(tags); |
| 769 | 769 |
| 770 // Set all non object fields. | 770 // Set all non object fields. |
| 771 field.set_token_pos(reader->ReadIntptrValue()); | 771 field.set_token_pos(reader->ReadIntptrValue()); |
| 772 field.set_guarded_cid(reader->ReadIntptrValue()); |
| 773 field.set_is_nullable(reader->ReadIntptrValue()); |
| 772 field.set_kind_bits(reader->Read<uint8_t>()); | 774 field.set_kind_bits(reader->Read<uint8_t>()); |
| 773 | 775 |
| 774 // Set all the object fields. | 776 // Set all the object fields. |
| 775 // TODO(5411462): Need to assert No GC can happen here, even though | 777 // TODO(5411462): Need to assert No GC can happen here, even though |
| 776 // allocations may happen. | 778 // allocations may happen. |
| 777 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); | 779 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); |
| 778 for (intptr_t i = 0; i <= num_flds; i++) { | 780 for (intptr_t i = 0; i <= num_flds; i++) { |
| 779 *(field.raw()->from() + i) = reader->ReadObjectRef(); | 781 *(field.raw()->from() + i) = reader->ReadObjectRef(); |
| 780 } | 782 } |
| 781 | 783 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 792 | 794 |
| 793 // Write out the serialization header value for this object. | 795 // Write out the serialization header value for this object. |
| 794 writer->WriteInlinedObjectHeader(object_id); | 796 writer->WriteInlinedObjectHeader(object_id); |
| 795 | 797 |
| 796 // Write out the class and tags information. | 798 // Write out the class and tags information. |
| 797 writer->WriteVMIsolateObject(kFieldCid); | 799 writer->WriteVMIsolateObject(kFieldCid); |
| 798 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 800 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 799 | 801 |
| 800 // Write out all the non object fields. | 802 // Write out all the non object fields. |
| 801 writer->WriteIntptrValue(ptr()->token_pos_); | 803 writer->WriteIntptrValue(ptr()->token_pos_); |
| 804 writer->WriteIntptrValue(ptr()->guarded_cid_); |
| 805 writer->WriteIntptrValue(ptr()->is_nullable_); |
| 802 writer->Write<uint8_t>(ptr()->kind_bits_); | 806 writer->Write<uint8_t>(ptr()->kind_bits_); |
| 803 | 807 |
| 804 // Write out all the object pointer fields. | 808 // Write out all the object pointer fields. |
| 805 SnapshotWriterVisitor visitor(writer); | 809 SnapshotWriterVisitor visitor(writer); |
| 806 visitor.VisitPointers(from(), to()); | 810 visitor.VisitPointers(from(), to()); |
| 807 } | 811 } |
| 808 | 812 |
| 809 | 813 |
| 810 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, | 814 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, |
| 811 intptr_t object_id, | 815 intptr_t object_id, |
| (...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2766 // Write out the class and tags information. | 2770 // Write out the class and tags information. |
| 2767 writer->WriteIndexedObject(kWeakPropertyCid); | 2771 writer->WriteIndexedObject(kWeakPropertyCid); |
| 2768 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2772 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 2769 | 2773 |
| 2770 // Write out all the other fields. | 2774 // Write out all the other fields. |
| 2771 writer->Write<RawObject*>(ptr()->key_); | 2775 writer->Write<RawObject*>(ptr()->key_); |
| 2772 writer->Write<RawObject*>(ptr()->value_); | 2776 writer->Write<RawObject*>(ptr()->value_); |
| 2773 } | 2777 } |
| 2774 | 2778 |
| 2775 } // namespace dart | 2779 } // namespace dart |
| OLD | NEW |