| 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 RawLibrary* Library::ReadFrom(SnapshotReader* reader, | 1040 RawLibrary* Library::ReadFrom(SnapshotReader* reader, |
| 1041 intptr_t object_id, | 1041 intptr_t object_id, |
| 1042 intptr_t tags, | 1042 intptr_t tags, |
| 1043 Snapshot::Kind kind) { | 1043 Snapshot::Kind kind) { |
| 1044 ASSERT(reader != NULL); | 1044 ASSERT(reader != NULL); |
| 1045 ASSERT(kind != Snapshot::kMessage); | 1045 ASSERT(kind != Snapshot::kMessage); |
| 1046 | 1046 |
| 1047 Library& library = Library::ZoneHandle(reader->isolate(), Library::null()); | 1047 Library& library = Library::ZoneHandle(reader->isolate(), Library::null()); |
| 1048 reader->AddBackRef(object_id, &library, kIsDeserialized); | 1048 reader->AddBackRef(object_id, &library, kIsDeserialized); |
| 1049 | 1049 |
| 1050 if (RawObject::IsCreatedFromSnapshot(tags)) { | 1050 if ((kind == Snapshot::kScript) && RawObject::IsCreatedFromSnapshot(tags)) { |
| 1051 ASSERT(kind != Snapshot::kFull); | 1051 ASSERT(kind != Snapshot::kFull); |
| 1052 // Lookup the object as it should already exist in the heap. | 1052 // Lookup the object as it should already exist in the heap. |
| 1053 *reader->StringHandle() ^= reader->ReadObjectImpl(); | 1053 *reader->StringHandle() ^= reader->ReadObjectImpl(); |
| 1054 library = Library::LookupLibrary(*reader->StringHandle()); | 1054 library = Library::LookupLibrary(*reader->StringHandle()); |
| 1055 } else { | 1055 } else { |
| 1056 // Allocate library object. | 1056 // Allocate library object. |
| 1057 library = NEW_OBJECT(Library); | 1057 library = NEW_OBJECT(Library); |
| 1058 | 1058 |
| 1059 // Set the object tags. | 1059 // Set the object tags. |
| 1060 library.set_tags(tags); | 1060 library.set_tags(tags); |
| (...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2640 // Write out the class and tags information. | 2640 // Write out the class and tags information. |
| 2641 writer->WriteIndexedObject(kWeakPropertyCid); | 2641 writer->WriteIndexedObject(kWeakPropertyCid); |
| 2642 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2642 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
| 2643 | 2643 |
| 2644 // Write out all the other fields. | 2644 // Write out all the other fields. |
| 2645 writer->Write<RawObject*>(ptr()->key_); | 2645 writer->Write<RawObject*>(ptr()->key_); |
| 2646 writer->Write<RawObject*>(ptr()->value_); | 2646 writer->Write<RawObject*>(ptr()->value_); |
| 2647 } | 2647 } |
| 2648 | 2648 |
| 2649 } // namespace dart | 2649 } // namespace dart |
| OLD | NEW |