| 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 23 matching lines...) Expand all Loading... |
| 34 if ((kind == Snapshot::kFull) || | 34 if ((kind == Snapshot::kFull) || |
| 35 (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) { | 35 (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) { |
| 36 // Read in the base information. | 36 // Read in the base information. |
| 37 intptr_t class_id = reader->ReadIntptrValue(); | 37 intptr_t class_id = reader->ReadIntptrValue(); |
| 38 bool is_signature_class = reader->Read<bool>(); | 38 bool is_signature_class = reader->Read<bool>(); |
| 39 | 39 |
| 40 // Allocate class object of specified kind. | 40 // Allocate class object of specified kind. |
| 41 if (kind == Snapshot::kFull) { | 41 if (kind == Snapshot::kFull) { |
| 42 cls = reader->NewClass(class_id, is_signature_class); | 42 cls = reader->NewClass(class_id, is_signature_class); |
| 43 } else { | 43 } else { |
| 44 if (class_id < kNumPredefinedCids) { | 44 cls = Class::GetClass(class_id, is_signature_class); |
| 45 ASSERT((class_id >= kInstanceCid) && (class_id <= kWeakPropertyCid)); | |
| 46 cls = reader->isolate()->class_table()->At(class_id); | |
| 47 } else { | |
| 48 if (is_signature_class) { | |
| 49 cls = Class::New<Closure>(kIllegalCid); | |
| 50 } else { | |
| 51 cls = Class::New<Instance>(kIllegalCid); | |
| 52 } | |
| 53 } | |
| 54 } | 45 } |
| 55 reader->AddBackRef(object_id, &cls, kIsDeserialized); | 46 reader->AddBackRef(object_id, &cls, kIsDeserialized); |
| 56 | 47 |
| 57 // Set the object tags. | 48 // Set the object tags. |
| 58 cls.set_tags(tags); | 49 cls.set_tags(tags); |
| 59 | 50 |
| 60 // Set all non object fields. | 51 // Set all non object fields. |
| 61 cls.set_instance_size(reader->ReadIntptrValue()); | 52 cls.set_instance_size(reader->ReadIntptrValue()); |
| 62 cls.set_type_arguments_instance_field_offset(reader->ReadIntptrValue()); | 53 cls.set_type_arguments_instance_field_offset(reader->ReadIntptrValue()); |
| 63 cls.set_next_field_offset(reader->ReadIntptrValue()); | 54 cls.set_next_field_offset(reader->ReadIntptrValue()); |
| (...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2092 // Write out the class and tags information. | 2083 // Write out the class and tags information. |
| 2093 writer->WriteIndexedObject(kWeakPropertyCid); | 2084 writer->WriteIndexedObject(kWeakPropertyCid); |
| 2094 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2085 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 2095 | 2086 |
| 2096 // Write out all the other fields. | 2087 // Write out all the other fields. |
| 2097 writer->Write<RawObject*>(ptr()->key_); | 2088 writer->Write<RawObject*>(ptr()->key_); |
| 2098 writer->Write<RawObject*>(ptr()->value_); | 2089 writer->Write<RawObject*>(ptr()->value_); |
| 2099 } | 2090 } |
| 2100 | 2091 |
| 2101 } // namespace dart | 2092 } // namespace dart |
| OLD | NEW |