| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Set the object tags. | 59 // Set the object tags. |
| 60 cls.set_tags(tags); | 60 cls.set_tags(tags); |
| 61 | 61 |
| 62 // Set all non object fields. | 62 // Set all non object fields. |
| 63 cls.set_instance_size_in_words(reader->ReadIntptrValue()); | 63 cls.set_instance_size_in_words(reader->ReadIntptrValue()); |
| 64 cls.set_type_arguments_field_offset_in_words(reader->ReadIntptrValue()); | 64 cls.set_type_arguments_field_offset_in_words(reader->ReadIntptrValue()); |
| 65 cls.set_next_field_offset_in_words(reader->ReadIntptrValue()); | 65 cls.set_next_field_offset_in_words(reader->ReadIntptrValue()); |
| 66 cls.set_num_native_fields(reader->ReadIntptrValue()); | 66 cls.set_num_native_fields(reader->ReadIntptrValue()); |
| 67 cls.set_token_pos(reader->ReadIntptrValue()); | 67 cls.set_token_pos(reader->ReadIntptrValue()); |
| 68 cls.set_state_bits(reader->Read<uint8_t>()); | 68 cls.set_state_bits(reader->Read<uint16_t>()); |
| 69 | 69 |
| 70 // Set all the object fields. | 70 // Set all the object fields. |
| 71 // TODO(5411462): Need to assert No GC can happen here, even though | 71 // TODO(5411462): Need to assert No GC can happen here, even though |
| 72 // allocations may happen. | 72 // allocations may happen. |
| 73 intptr_t num_flds = (cls.raw()->to() - cls.raw()->from()); | 73 intptr_t num_flds = (cls.raw()->to() - cls.raw()->from()); |
| 74 for (intptr_t i = 0; i <= num_flds; i++) { | 74 for (intptr_t i = 0; i <= num_flds; i++) { |
| 75 *(cls.raw()->from() + i) = reader->ReadObjectRef(); | 75 *(cls.raw()->from() + i) = reader->ReadObjectRef(); |
| 76 } | 76 } |
| 77 } else { | 77 } else { |
| 78 cls ^= reader->ReadClassId(object_id); | 78 cls ^= reader->ReadClassId(object_id); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 97 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 97 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 98 | 98 |
| 99 // Write out all the non object pointer fields. | 99 // Write out all the non object pointer fields. |
| 100 // NOTE: cpp_vtable_ is not written. | 100 // NOTE: cpp_vtable_ is not written. |
| 101 writer->WriteIntptrValue(ptr()->id_); | 101 writer->WriteIntptrValue(ptr()->id_); |
| 102 writer->WriteIntptrValue(ptr()->instance_size_in_words_); | 102 writer->WriteIntptrValue(ptr()->instance_size_in_words_); |
| 103 writer->WriteIntptrValue(ptr()->type_arguments_field_offset_in_words_); | 103 writer->WriteIntptrValue(ptr()->type_arguments_field_offset_in_words_); |
| 104 writer->WriteIntptrValue(ptr()->next_field_offset_in_words_); | 104 writer->WriteIntptrValue(ptr()->next_field_offset_in_words_); |
| 105 writer->WriteIntptrValue(ptr()->num_native_fields_); | 105 writer->WriteIntptrValue(ptr()->num_native_fields_); |
| 106 writer->WriteIntptrValue(ptr()->token_pos_); | 106 writer->WriteIntptrValue(ptr()->token_pos_); |
| 107 writer->Write<uint8_t>(ptr()->state_bits_); | 107 writer->Write<uint16_t>(ptr()->state_bits_); |
| 108 | 108 |
| 109 // Write out all the object pointer fields. | 109 // Write out all the object pointer fields. |
| 110 SnapshotWriterVisitor visitor(writer); | 110 SnapshotWriterVisitor visitor(writer); |
| 111 visitor.VisitPointers(from(), to()); | 111 visitor.VisitPointers(from(), to()); |
| 112 } else { | 112 } else { |
| 113 writer->WriteClassId(this); | 113 writer->WriteClassId(this); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 | 117 |
| (...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2621 // Write out the class and tags information. | 2621 // Write out the class and tags information. |
| 2622 writer->WriteIndexedObject(kWeakPropertyCid); | 2622 writer->WriteIndexedObject(kWeakPropertyCid); |
| 2623 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2623 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 2624 | 2624 |
| 2625 // Write out all the other fields. | 2625 // Write out all the other fields. |
| 2626 writer->Write<RawObject*>(ptr()->key_); | 2626 writer->Write<RawObject*>(ptr()->key_); |
| 2627 writer->Write<RawObject*>(ptr()->value_); | 2627 writer->Write<RawObject*>(ptr()->value_); |
| 2628 } | 2628 } |
| 2629 | 2629 |
| 2630 } // namespace dart | 2630 } // namespace dart |
| OLD | NEW |