| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/visitor.h" | 9 #include "vm/visitor.h" |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // Read in the base information. | 32 // Read in the base information. |
| 33 ObjectKind kind = reader->Read<ObjectKind>(); | 33 ObjectKind kind = reader->Read<ObjectKind>(); |
| 34 | 34 |
| 35 // Allocate class object of specified kind. | 35 // Allocate class object of specified kind. |
| 36 cls = Class::GetClass(kind); | 36 cls = Class::GetClass(kind); |
| 37 reader->AddBackwardReference(object_id, &cls); | 37 reader->AddBackwardReference(object_id, &cls); |
| 38 | 38 |
| 39 // Set all non object fields. | 39 // Set all non object fields. |
| 40 cls.set_instance_size(reader->Read<intptr_t>()); | 40 cls.set_instance_size(reader->Read<intptr_t>()); |
| 41 cls.set_type_arguments_instance_field_offset(reader->Read<intptr_t>()); | 41 cls.set_type_arguments_instance_field_offset(reader->Read<intptr_t>()); |
| 42 cls.set_num_constants(reader->Read<intptr_t>()); | |
| 43 cls.set_num_canonical_types(reader->Read<intptr_t>()); | |
| 44 cls.set_next_field_offset(reader->Read<intptr_t>()); | 42 cls.set_next_field_offset(reader->Read<intptr_t>()); |
| 45 cls.set_num_native_fields(reader->Read<intptr_t>()); | 43 cls.set_num_native_fields(reader->Read<intptr_t>()); |
| 46 cls.set_class_state(reader->Read<int8_t>()); | 44 cls.set_class_state(reader->Read<int8_t>()); |
| 47 if (reader->Read<bool>()) { | 45 if (reader->Read<bool>()) { |
| 48 cls.set_is_const(); | 46 cls.set_is_const(); |
| 49 } | 47 } |
| 50 if (reader->Read<bool>()) { | 48 if (reader->Read<bool>()) { |
| 51 cls.set_is_interface(); | 49 cls.set_is_interface(); |
| 52 } | 50 } |
| 53 | 51 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 76 | 74 |
| 77 if (serialize_classes) { | 75 if (serialize_classes) { |
| 78 // Write out the class information. | 76 // Write out the class information. |
| 79 writer->WriteObjectHeader(kObjectId, Object::kClassClass); | 77 writer->WriteObjectHeader(kObjectId, Object::kClassClass); |
| 80 | 78 |
| 81 // Write out all the non object pointer fields. | 79 // Write out all the non object pointer fields. |
| 82 // NOTE: cpp_vtable_ is not written. | 80 // NOTE: cpp_vtable_ is not written. |
| 83 writer->Write<ObjectKind>(ptr()->instance_kind_); | 81 writer->Write<ObjectKind>(ptr()->instance_kind_); |
| 84 writer->Write<intptr_t>(ptr()->instance_size_); | 82 writer->Write<intptr_t>(ptr()->instance_size_); |
| 85 writer->Write<intptr_t>(ptr()->type_arguments_instance_field_offset_); | 83 writer->Write<intptr_t>(ptr()->type_arguments_instance_field_offset_); |
| 86 writer->Write<intptr_t>(ptr()->num_constants_); | |
| 87 writer->Write<intptr_t>(ptr()->num_canonical_types_); | |
| 88 writer->Write<intptr_t>(ptr()->next_field_offset_); | 84 writer->Write<intptr_t>(ptr()->next_field_offset_); |
| 89 writer->Write<intptr_t>(ptr()->num_native_fields_); | 85 writer->Write<intptr_t>(ptr()->num_native_fields_); |
| 90 writer->Write<int8_t>(ptr()->class_state_); | 86 writer->Write<int8_t>(ptr()->class_state_); |
| 91 writer->Write<bool>(ptr()->is_const_); | 87 writer->Write<bool>(ptr()->is_const_); |
| 92 writer->Write<bool>(ptr()->is_interface_); | 88 writer->Write<bool>(ptr()->is_interface_); |
| 93 | 89 |
| 94 // Write out all the object pointer fields. | 90 // Write out all the object pointer fields. |
| 95 visitor.VisitPointers(from(), to()); | 91 visitor.VisitPointers(from(), to()); |
| 96 } else { | 92 } else { |
| 97 writer->WriteClassId(this); | 93 writer->WriteClassId(this); |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 // Write out all the other fields. | 1320 // Write out all the other fields. |
| 1325 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); | 1321 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); |
| 1326 writer->WriteObject(ptr()->pattern_); | 1322 writer->WriteObject(ptr()->pattern_); |
| 1327 writer->Write<intptr_t>(ptr()->type_); | 1323 writer->Write<intptr_t>(ptr()->type_); |
| 1328 writer->Write<intptr_t>(ptr()->flags_); | 1324 writer->Write<intptr_t>(ptr()->flags_); |
| 1329 | 1325 |
| 1330 // Do not write out the data part which is native. | 1326 // Do not write out the data part which is native. |
| 1331 } | 1327 } |
| 1332 | 1328 |
| 1333 } // namespace dart | 1329 } // namespace dart |
| OLD | NEW |