Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 10829431: Eliminate imported_into pointers in Library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 } else { 747 } else {
748 // Allocate library object. 748 // Allocate library object.
749 library = NEW_OBJECT(Library); 749 library = NEW_OBJECT(Library);
750 750
751 // Set the object tags. 751 // Set the object tags.
752 library.set_tags(tags); 752 library.set_tags(tags);
753 753
754 // Set all non object fields. 754 // Set all non object fields.
755 library.raw_ptr()->index_ = reader->ReadIntptrValue(); 755 library.raw_ptr()->index_ = reader->ReadIntptrValue();
756 library.raw_ptr()->num_imports_ = reader->ReadIntptrValue(); 756 library.raw_ptr()->num_imports_ = reader->ReadIntptrValue();
757 library.raw_ptr()->num_imported_into_ = reader->ReadIntptrValue();
758 library.raw_ptr()->num_anonymous_ = reader->ReadIntptrValue(); 757 library.raw_ptr()->num_anonymous_ = reader->ReadIntptrValue();
759 library.raw_ptr()->corelib_imported_ = reader->Read<bool>(); 758 library.raw_ptr()->corelib_imported_ = reader->Read<bool>();
760 library.raw_ptr()->debuggable_ = reader->Read<bool>(); 759 library.raw_ptr()->debuggable_ = reader->Read<bool>();
761 library.raw_ptr()->load_state_ = reader->Read<int8_t>(); 760 library.raw_ptr()->load_state_ = reader->Read<int8_t>();
762 // The native resolver is not serialized. 761 // The native resolver is not serialized.
763 Dart_NativeEntryResolver resolver = 762 Dart_NativeEntryResolver resolver =
764 reader->Read<Dart_NativeEntryResolver>(); 763 reader->Read<Dart_NativeEntryResolver>();
765 ASSERT(resolver == NULL); 764 ASSERT(resolver == NULL);
766 library.set_native_entry_resolver(resolver); 765 library.set_native_entry_resolver(resolver);
767 // The cache of loaded scripts is not serialized. 766 // The cache of loaded scripts is not serialized.
(...skipping 28 matching lines...) Expand all
796 writer->WriteIntptrValue(writer->GetObjectTags(this)); 795 writer->WriteIntptrValue(writer->GetObjectTags(this));
797 796
798 if (RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))) { 797 if (RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))) {
799 ASSERT(kind != Snapshot::kFull); 798 ASSERT(kind != Snapshot::kFull);
800 // Write out library URL so that it can be looked up when reading. 799 // Write out library URL so that it can be looked up when reading.
801 writer->WriteObjectImpl(ptr()->url_); 800 writer->WriteObjectImpl(ptr()->url_);
802 } else { 801 } else {
803 // Write out all non object fields. 802 // Write out all non object fields.
804 writer->WriteIntptrValue(ptr()->index_); 803 writer->WriteIntptrValue(ptr()->index_);
805 writer->WriteIntptrValue(ptr()->num_imports_); 804 writer->WriteIntptrValue(ptr()->num_imports_);
806 writer->WriteIntptrValue(ptr()->num_imported_into_);
807 writer->WriteIntptrValue(ptr()->num_anonymous_); 805 writer->WriteIntptrValue(ptr()->num_anonymous_);
808 writer->Write<bool>(ptr()->corelib_imported_); 806 writer->Write<bool>(ptr()->corelib_imported_);
809 writer->Write<bool>(ptr()->debuggable_); 807 writer->Write<bool>(ptr()->debuggable_);
810 writer->Write<int8_t>(ptr()->load_state_); 808 writer->Write<int8_t>(ptr()->load_state_);
811 // We do not serialize the native resolver over, this needs to be explicitly 809 // We do not serialize the native resolver over, this needs to be explicitly
812 // set after deserialization. 810 // set after deserialization.
813 writer->Write<Dart_NativeEntryResolver>(NULL); 811 writer->Write<Dart_NativeEntryResolver>(NULL);
814 // We do not write the loaded_scripts_ cache to the snapshot. It gets 812 // We do not write the loaded_scripts_ cache to the snapshot. It gets
815 // set to NULL when reading the library from the snapshot, and will 813 // set to NULL when reading the library from the snapshot, and will
816 // be rebuilt lazily. 814 // be rebuilt lazily.
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 // Write out the class and tags information. 2083 // Write out the class and tags information.
2086 writer->WriteIndexedObject(kWeakPropertyCid); 2084 writer->WriteIndexedObject(kWeakPropertyCid);
2087 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2085 writer->WriteIntptrValue(writer->GetObjectTags(this));
2088 2086
2089 // Write out all the other fields. 2087 // Write out all the other fields.
2090 writer->Write<RawObject*>(ptr()->key_); 2088 writer->Write<RawObject*>(ptr()->key_);
2091 writer->Write<RawObject*>(ptr()->value_); 2089 writer->Write<RawObject*>(ptr()->value_);
2092 } 2090 }
2093 2091
2094 } // namespace dart 2092 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698