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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 154393003: Implement eager instantiation and canonicalization of type arguments at run (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 32446)
+++ runtime/vm/raw_object_snapshot.cc (working copy)
@@ -435,23 +435,6 @@
}
-RawAbstractTypeArguments* AbstractTypeArguments::ReadFrom(
- SnapshotReader* reader,
- intptr_t object_id,
- intptr_t tags,
- Snapshot::Kind kind) {
- UNREACHABLE(); // AbstractTypeArguments is an abstract class.
- return TypeArguments::null();
-}
-
-
-void RawAbstractTypeArguments::WriteTo(SnapshotWriter* writer,
- intptr_t object_id,
- Snapshot::Kind kind) {
- UNREACHABLE(); // AbstractTypeArguments is an abstract class.
-}
-
-
RawTypeArguments* TypeArguments::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
intptr_t tags,
@@ -518,57 +501,6 @@
}
-RawInstantiatedTypeArguments* InstantiatedTypeArguments::ReadFrom(
- SnapshotReader* reader,
- intptr_t object_id,
- intptr_t tags,
- Snapshot::Kind kind) {
- ASSERT(reader != NULL);
- ASSERT(kind == Snapshot::kMessage);
-
- // Allocate instantiated types object.
- InstantiatedTypeArguments& instantiated_type_arguments =
- InstantiatedTypeArguments::ZoneHandle(reader->isolate(),
- InstantiatedTypeArguments::New());
- reader->AddBackRef(object_id, &instantiated_type_arguments, kIsDeserialized);
-
- // Set the object tags.
- instantiated_type_arguments.set_tags(tags);
-
- // Set all the object fields.
- // TODO(5411462): Need to assert No GC can happen here, even though
- // allocations may happen.
- intptr_t num_flds = (instantiated_type_arguments.raw()->to() -
- instantiated_type_arguments.raw()->from());
- for (intptr_t i = 0; i <= num_flds; i++) {
- (*reader->ObjectHandle()) = reader->ReadObjectRef();
- instantiated_type_arguments.StorePointer(
- (instantiated_type_arguments.raw()->from() + i),
- reader->ObjectHandle()->raw());
- }
- return instantiated_type_arguments.raw();
-}
-
-
-void RawInstantiatedTypeArguments::WriteTo(SnapshotWriter* writer,
- intptr_t object_id,
- Snapshot::Kind kind) {
- ASSERT(writer != NULL);
- ASSERT(kind == Snapshot::kMessage);
-
- // Write out the serialization header value for this object.
- writer->WriteInlinedObjectHeader(object_id);
-
- // Write out the class and tags information.
- writer->WriteVMIsolateObject(kInstantiatedTypeArgumentsCid);
- writer->WriteIntptrValue(writer->GetObjectTags(this));
-
- // Write out all the object pointer fields.
- SnapshotWriterVisitor visitor(writer);
- visitor.VisitPointers(from(), to());
-}
-
-
RawPatchClass* PatchClass::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
intptr_t tags,
@@ -2181,8 +2113,8 @@
Array& contents = Array::Handle();
contents ^= reader->ReadObjectImpl();
array.SetData(contents);
- const AbstractTypeArguments& type_arguments =
- AbstractTypeArguments::Handle(contents.GetTypeArguments());
+ const TypeArguments& type_arguments =
+ TypeArguments::Handle(contents.GetTypeArguments());
array.SetTypeArguments(type_arguments);
return array.raw();
}

Powered by Google App Engine
This is Rietveld 408576698