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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 1815733003: Remove recently introduced FunctionType vm class by merging it into class Type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comment Created 4 years, 9 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
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index d02909c40cd87194a6527e2618c9295b151e3267..17cf3372b85ca254369c4ffb8db68c15cff0ab05 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -281,83 +281,6 @@ void RawType::WriteTo(SnapshotWriter* writer,
}
-RawFunctionType* FunctionType::ReadFrom(SnapshotReader* reader,
- intptr_t object_id,
- intptr_t tags,
- Snapshot::Kind kind,
- bool as_reference) {
- ASSERT(reader != NULL);
-
- // Determine if the scope class of this function type is in the full snapshot.
- bool scopeclass_is_in_fullsnapshot = reader->Read<bool>();
-
- // Allocate function type object.
- FunctionType& function_type =
- FunctionType::ZoneHandle(reader->zone(), NEW_OBJECT(FunctionType));
- bool is_canonical = RawObject::IsCanonical(tags);
- bool defer_canonicalization = is_canonical &&
- (kind != Snapshot::kFull && scopeclass_is_in_fullsnapshot);
- reader->AddBackRef(object_id,
- &function_type,
- kIsDeserialized,
- defer_canonicalization);
-
- // Set all non object fields.
- function_type.set_token_pos(
- TokenPosition::SnapshotDecode(reader->Read<int32_t>()));
- function_type.set_type_state(reader->Read<int8_t>());
-
- // Set all the object fields.
- READ_OBJECT_FIELDS(function_type,
- function_type.raw()->from(), function_type.raw()->to(),
- kAsReference);
-
- // Set the canonical bit.
- if (!defer_canonicalization && is_canonical) {
- function_type.SetCanonical();
- }
-
- return function_type.raw();
-}
-
-
-void RawFunctionType::WriteTo(SnapshotWriter* writer,
- intptr_t object_id,
- Snapshot::Kind kind,
- bool as_reference) {
- ASSERT(writer != NULL);
-
- // Only resolved and finalized function types should be written to a snapshot.
- ASSERT((ptr()->type_state_ == RawFunctionType::kFinalizedInstantiated) ||
- (ptr()->type_state_ == RawFunctionType::kFinalizedUninstantiated));
- ASSERT(ptr()->scope_class_ != Object::null());
-
- // Write out the serialization header value for this object.
- writer->WriteInlinedObjectHeader(object_id);
-
- // Write out the class and tags information.
- writer->WriteIndexedObject(kFunctionTypeCid);
- writer->WriteTags(writer->GetObjectTags(this));
-
- // Write out scopeclass_is_in_fullsnapshot first as this will
- // help the reader decide on how to canonicalize the type object.
- intptr_t tags = writer->GetObjectTags(ptr()->scope_class_);
- bool scopeclass_is_in_fullsnapshot =
- (ClassIdTag::decode(tags) == kClassCid) &&
- Class::IsInFullSnapshot(reinterpret_cast<RawClass*>(ptr()->scope_class_));
- writer->Write<bool>(scopeclass_is_in_fullsnapshot);
-
- // Write out all the non object pointer fields.
- writer->Write<int32_t>(ptr()->token_pos_.SnapshotEncode());
- writer->Write<int8_t>(ptr()->type_state_);
-
- // Write out all the object pointer fields.
- ASSERT(ptr()->scope_class_ != Object::null());
- SnapshotWriterVisitor visitor(writer, kAsReference);
- visitor.VisitPointers(from(), to());
-}
-
-
RawTypeRef* TypeRef::ReadFrom(SnapshotReader* reader,
intptr_t object_id,
intptr_t tags,
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698