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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 8247014: Changes to handle unresolved qualified identifiers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/raw_object_snapshot.cc
===================================================================
--- runtime/vm/raw_object_snapshot.cc (revision 383)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -97,6 +97,51 @@
}
+RawUnresolvedClass* UnresolvedClass::ReadFrom(SnapshotReader* reader,
+ intptr_t object_id,
+ bool classes_serialized) {
+ ASSERT(reader != NULL);
+
+ // Allocate parameterized type object.
+ UnresolvedClass& unresolved_class =
+ UnresolvedClass::ZoneHandle(UnresolvedClass::New());
+ reader->AddBackwardReference(object_id, &unresolved_class);
+
+ // Set all non object fields.
+ unresolved_class.set_token_index(reader->Read<intptr_t>());
+
+ // Set all the object fields.
+ // TODO(5411462): Need to assert No GC can happen here, even though
+ // allocations may happen.
+ intptr_t num_flds = (unresolved_class.raw()->to() -
+ unresolved_class.raw()->from());
+ for (intptr_t i = 0; i <= num_flds; i++) {
+ *(unresolved_class.raw()->from() + i) = reader->ReadObject();
+ }
+ return unresolved_class.raw();
+}
+
+
+void RawUnresolvedClass::WriteTo(SnapshotWriter* writer,
+ intptr_t object_id,
+ bool serialize_classes) {
+ ASSERT(writer != NULL);
+ SnapshotWriterVisitor visitor(writer);
+
+ // Write out the serialization header value for this object.
+ writer->WriteObjectHeader(kInlined, object_id);
+
+ // Write out the class information.
+ writer->WriteObjectHeader(kObjectId, Object::kUnresolvedClassClass);
+
+ // Write out all the non object pointer fields.
+ writer->Write<intptr_t>(ptr()->token_index_);
+
+ // Write out all the object pointer fields.
+ visitor.VisitPointers(from(), to());
+}
+
+
RawType* Type::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
bool classes_serialized) {

Powered by Google App Engine
This is Rietveld 408576698