| 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/visitor.h" | 9 #include "vm/visitor.h" |
| 10 | 10 |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 *reader->StringHandle() ^= reader->ReadObject(); | 689 *reader->StringHandle() ^= reader->ReadObject(); |
| 690 library = Library::LookupLibrary(*reader->StringHandle()); | 690 library = Library::LookupLibrary(*reader->StringHandle()); |
| 691 } else { | 691 } else { |
| 692 // Allocate library object. | 692 // Allocate library object. |
| 693 library = NEW_OBJECT(Library); | 693 library = NEW_OBJECT(Library); |
| 694 | 694 |
| 695 // Set the object tags. | 695 // Set the object tags. |
| 696 library.set_tags(tags); | 696 library.set_tags(tags); |
| 697 | 697 |
| 698 // Set all non object fields. | 698 // Set all non object fields. |
| 699 library.raw_ptr()->index_ = reader->ReadIntptrValue(); |
| 699 library.raw_ptr()->num_imports_ = reader->ReadIntptrValue(); | 700 library.raw_ptr()->num_imports_ = reader->ReadIntptrValue(); |
| 700 library.raw_ptr()->num_imported_into_ = reader->ReadIntptrValue(); | 701 library.raw_ptr()->num_imported_into_ = reader->ReadIntptrValue(); |
| 701 library.raw_ptr()->num_anonymous_ = reader->ReadIntptrValue(); | 702 library.raw_ptr()->num_anonymous_ = reader->ReadIntptrValue(); |
| 702 library.raw_ptr()->corelib_imported_ = reader->Read<bool>(); | 703 library.raw_ptr()->corelib_imported_ = reader->Read<bool>(); |
| 703 library.raw_ptr()->load_state_ = reader->Read<int8_t>(); | 704 library.raw_ptr()->load_state_ = reader->Read<int8_t>(); |
| 704 // The native resolver is not serialized. | 705 // The native resolver is not serialized. |
| 705 Dart_NativeEntryResolver resolver = | 706 Dart_NativeEntryResolver resolver = |
| 706 reader->Read<Dart_NativeEntryResolver>(); | 707 reader->Read<Dart_NativeEntryResolver>(); |
| 707 ASSERT(resolver == NULL); | 708 ASSERT(resolver == NULL); |
| 708 library.set_native_entry_resolver(resolver); | 709 library.set_native_entry_resolver(resolver); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 735 | 736 |
| 736 // Write out the class and tags information. | 737 // Write out the class and tags information. |
| 737 writer->WriteObjectHeader(Object::kLibraryClass, ptr()->tags_); | 738 writer->WriteObjectHeader(Object::kLibraryClass, ptr()->tags_); |
| 738 | 739 |
| 739 if (IsCreatedFromSnapshot()) { | 740 if (IsCreatedFromSnapshot()) { |
| 740 ASSERT(kind != Snapshot::kFull); | 741 ASSERT(kind != Snapshot::kFull); |
| 741 // Write out library URL so that it can be looked up when reading. | 742 // Write out library URL so that it can be looked up when reading. |
| 742 writer->WriteObject(ptr()->url_); | 743 writer->WriteObject(ptr()->url_); |
| 743 } else { | 744 } else { |
| 744 // Write out all non object fields. | 745 // Write out all non object fields. |
| 746 writer->WriteIntptrValue(ptr()->index_); |
| 745 writer->WriteIntptrValue(ptr()->num_imports_); | 747 writer->WriteIntptrValue(ptr()->num_imports_); |
| 746 writer->WriteIntptrValue(ptr()->num_imported_into_); | 748 writer->WriteIntptrValue(ptr()->num_imported_into_); |
| 747 writer->WriteIntptrValue(ptr()->num_anonymous_); | 749 writer->WriteIntptrValue(ptr()->num_anonymous_); |
| 748 writer->Write<bool>(ptr()->corelib_imported_); | 750 writer->Write<bool>(ptr()->corelib_imported_); |
| 749 writer->Write<int8_t>(ptr()->load_state_); | 751 writer->Write<int8_t>(ptr()->load_state_); |
| 750 // We do not serialize the native resolver over, this needs to be explicitly | 752 // We do not serialize the native resolver over, this needs to be explicitly |
| 751 // set after deserialization. | 753 // set after deserialization. |
| 752 writer->Write<Dart_NativeEntryResolver>(NULL); | 754 writer->Write<Dart_NativeEntryResolver>(NULL); |
| 753 // We do not write the loaded_scripts_ cache to the snapshot. It gets | 755 // We do not write the loaded_scripts_ cache to the snapshot. It gets |
| 754 // set to NULL when reading the library from the snapshot, and will | 756 // set to NULL when reading the library from the snapshot, and will |
| (...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); | 2385 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); |
| 2384 writer->WriteObject(ptr()->pattern_); | 2386 writer->WriteObject(ptr()->pattern_); |
| 2385 writer->WriteIntptrValue(ptr()->type_); | 2387 writer->WriteIntptrValue(ptr()->type_); |
| 2386 writer->WriteIntptrValue(ptr()->flags_); | 2388 writer->WriteIntptrValue(ptr()->flags_); |
| 2387 | 2389 |
| 2388 // Do not write out the data part which is native. | 2390 // Do not write out the data part which is native. |
| 2389 } | 2391 } |
| 2390 | 2392 |
| 2391 | 2393 |
| 2392 } // namespace dart | 2394 } // namespace dart |
| OLD | NEW |