Chromium Code Reviews| 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/stub_code.h" | 9 #include "vm/stub_code.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 766 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); | 766 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); |
| 767 reader->AddBackRef(object_id, &field, kIsDeserialized); | 767 reader->AddBackRef(object_id, &field, kIsDeserialized); |
| 768 | 768 |
| 769 // Set the object tags. | 769 // Set the object tags. |
| 770 field.set_tags(tags); | 770 field.set_tags(tags); |
| 771 | 771 |
| 772 // Set all non object fields. | 772 // Set all non object fields. |
| 773 field.set_token_pos(reader->ReadIntptrValue()); | 773 field.set_token_pos(reader->ReadIntptrValue()); |
| 774 field.set_guarded_cid(reader->ReadIntptrValue()); | 774 field.set_guarded_cid(reader->ReadIntptrValue()); |
| 775 field.set_is_nullable(reader->ReadIntptrValue()); | 775 field.set_is_nullable(reader->ReadIntptrValue()); |
| 776 field.set_guarded_list_length_in_object_offset(reader->ReadIntptrValue()); | |
| 776 field.set_kind_bits(reader->Read<uint8_t>()); | 777 field.set_kind_bits(reader->Read<uint8_t>()); |
| 777 | 778 |
| 778 // Set all the object fields. | 779 // Set all the object fields. |
| 779 // TODO(5411462): Need to assert No GC can happen here, even though | 780 // TODO(5411462): Need to assert No GC can happen here, even though |
| 780 // allocations may happen. | 781 // allocations may happen. |
| 781 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); | 782 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); |
| 782 for (intptr_t i = 0; i <= num_flds; i++) { | 783 for (intptr_t i = 0; i <= num_flds; i++) { |
| 783 *(field.raw()->from() + i) = reader->ReadObjectRef(); | 784 *(field.raw()->from() + i) = reader->ReadObjectRef(); |
| 784 } | 785 } |
| 785 | 786 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 799 writer->WriteInlinedObjectHeader(object_id); | 800 writer->WriteInlinedObjectHeader(object_id); |
| 800 | 801 |
| 801 // Write out the class and tags information. | 802 // Write out the class and tags information. |
| 802 writer->WriteVMIsolateObject(kFieldCid); | 803 writer->WriteVMIsolateObject(kFieldCid); |
| 803 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 804 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 804 | 805 |
| 805 // Write out all the non object fields. | 806 // Write out all the non object fields. |
| 806 writer->WriteIntptrValue(ptr()->token_pos_); | 807 writer->WriteIntptrValue(ptr()->token_pos_); |
| 807 writer->WriteIntptrValue(ptr()->guarded_cid_); | 808 writer->WriteIntptrValue(ptr()->guarded_cid_); |
| 808 writer->WriteIntptrValue(ptr()->is_nullable_); | 809 writer->WriteIntptrValue(ptr()->is_nullable_); |
| 810 writer->WriteIntptrValue(ptr()->guarded_list_length_in_object_offset_); | |
|
Cutch
2014/05/28 14:13:31
Do we want to write this? The offset isn't compati
Vyacheslav Egorov (Google)
2014/05/29 17:36:51
Done.
| |
| 809 writer->Write<uint8_t>(ptr()->kind_bits_); | 811 writer->Write<uint8_t>(ptr()->kind_bits_); |
| 810 | 812 |
| 811 // Write out all the object pointer fields. | 813 // Write out all the object pointer fields. |
| 812 SnapshotWriterVisitor visitor(writer); | 814 SnapshotWriterVisitor visitor(writer); |
| 813 visitor.VisitPointers(from(), to()); | 815 visitor.VisitPointers(from(), to()); |
| 814 } | 816 } |
| 815 | 817 |
| 816 | 818 |
| 817 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, | 819 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, |
| 818 intptr_t object_id, | 820 intptr_t object_id, |
| (...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2781 // We do not allow objects with native fields in an isolate message. | 2783 // We do not allow objects with native fields in an isolate message. |
| 2782 writer->SetWriteException(Exceptions::kArgument, | 2784 writer->SetWriteException(Exceptions::kArgument, |
| 2783 "Illegal argument in isolate message" | 2785 "Illegal argument in isolate message" |
| 2784 " : (object is a UserTag)"); | 2786 " : (object is a UserTag)"); |
| 2785 } else { | 2787 } else { |
| 2786 UNREACHABLE(); | 2788 UNREACHABLE(); |
| 2787 } | 2789 } |
| 2788 } | 2790 } |
| 2789 | 2791 |
| 2790 } // namespace dart | 2792 } // namespace dart |
| OLD | NEW |