Flutter Engine
The Flutter Engine
Public Member Functions | Private Member Functions | List of all members
dart::TypeSerializationCluster Class Reference
Inheritance diagram for dart::TypeSerializationCluster:
dart::CanonicalSetSerializationCluster< CanonicalTypeSet, Type, TypePtr, false > dart::SerializationCluster dart::ZoneAllocated

Public Member Functions

 TypeSerializationCluster (bool is_canonical, bool represents_canonical_set)
 
 ~TypeSerializationCluster ()
 
void Trace (Serializer *s, ObjectPtr object)
 
void WriteAlloc (Serializer *s)
 
void WriteFill (Serializer *s)
 
- Public Member Functions inherited from dart::SerializationCluster
 SerializationCluster (const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)
 
virtual ~SerializationCluster ()
 
virtual void Trace (Serializer *serializer, ObjectPtr object)=0
 
virtual void WriteAlloc (Serializer *serializer)=0
 
virtual void WriteFill (Serializer *serializer)=0
 
void WriteAndMeasureAlloc (Serializer *serializer)
 
void WriteAndMeasureFill (Serializer *serializer)
 
const char * name () const
 
intptr_t cid () const
 
bool is_canonical () const
 
bool is_immutable () const
 
intptr_t size () const
 
intptr_t num_objects () const
 
intptr_t target_memory_size () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Private Member Functions

virtual bool IsInCanonicalSet (Serializer *s, TypePtr type)
 

Additional Inherited Members

- Static Public Attributes inherited from dart::SerializationCluster
static constexpr intptr_t kSizeVaries = -1
 
- Protected Member Functions inherited from dart::CanonicalSetSerializationCluster< CanonicalTypeSet, Type, TypePtr, false >
 CanonicalSetSerializationCluster (intptr_t cid, bool is_canonical, bool represents_canonical_set, const char *name, intptr_t target_instance_size=0)
 
virtual bool IsInCanonicalSet (Serializer *s, TypePtr ptr)
 
void ReorderObjects (Serializer *s)
 
void WriteCanonicalSetLayout (Serializer *s)
 
- Protected Attributes inherited from dart::CanonicalSetSerializationCluster< CanonicalTypeSet, Type, TypePtr, false >
GrowableArray< TypePtr > objects_
 
- Protected Attributes inherited from dart::SerializationCluster
const char *const name_
 
const intptr_t cid_
 
const intptr_t target_instance_size_
 
const bool is_canonical_
 
const bool is_immutable_
 
intptr_t size_ = 0
 
intptr_t num_objects_ = 0
 
intptr_t target_memory_size_ = 0
 

Detailed Description

Definition at line 4724 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ TypeSerializationCluster()

dart::TypeSerializationCluster::TypeSerializationCluster ( bool  is_canonical,
bool  represents_canonical_set 
)
inline

Definition at line 4731 of file app_snapshot.cc.

4733 kTypeCid,
4735 represents_canonical_set,
4736 "Type",
CanonicalSetSerializationCluster(intptr_t cid, bool is_canonical, bool represents_canonical_set, const char *name, intptr_t target_instance_size=0)

◆ ~TypeSerializationCluster()

dart::TypeSerializationCluster::~TypeSerializationCluster ( )
inline

Definition at line 4738 of file app_snapshot.cc.

4738{}

Member Function Documentation

◆ IsInCanonicalSet()

virtual bool dart::TypeSerializationCluster::IsInCanonicalSet ( Serializer s,
TypePtr  type 
)
inlineprivatevirtual

Reimplemented from dart::CanonicalSetSerializationCluster< CanonicalTypeSet, Type, TypePtr, false >.

Definition at line 4779 of file app_snapshot.cc.

4779 {
4780 ClassPtr type_class =
4781 s->isolate_group()->class_table()->At(type->untag()->type_class_id());
4782 if (type_class->untag()->declaration_type() != type) {
4783 return true;
4784 }
4785
4786 type_ = type;
4787 cls_ = type_class;
4788 return !type_.IsDeclarationTypeOf(cls_);
4789 }
GLenum type
bool IsDeclarationTypeOf(const Class &cls) const
struct MyStruct s

◆ Trace()

void dart::TypeSerializationCluster::Trace ( Serializer s,
ObjectPtr  object 
)
inlinevirtual

Implements dart::SerializationCluster.

Definition at line 4740 of file app_snapshot.cc.

4740 {
4741 TypePtr type = Type::RawCast(object);
4742 objects_.Add(type);
4743
4745
4746 ASSERT(type->untag()->type_class_id() != kIllegalCid);
4747 ClassPtr type_class =
4748 s->isolate_group()->class_table()->At(type->untag()->type_class_id());
4749 s->Push(type_class);
4750 }
#define PushFromTo(obj,...)
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
#define ASSERT(E)
@ kIllegalCid
Definition: class_id.h:214

◆ WriteAlloc()

void dart::TypeSerializationCluster::WriteAlloc ( Serializer s)
inlinevirtual

Implements dart::SerializationCluster.

Definition at line 4752 of file app_snapshot.cc.

4752 {
4753 intptr_t count = objects_.length();
4754 s->WriteUnsigned(count);
4756 for (intptr_t i = 0; i < count; i++) {
4757 TypePtr type = objects_[i];
4758 s->AssignRef(type);
4759 }
4761 }
int count
Definition: FontMgrTest.cpp:50
intptr_t length() const

◆ WriteFill()

void dart::TypeSerializationCluster::WriteFill ( Serializer s)
inlinevirtual

Implements dart::SerializationCluster.

Definition at line 4763 of file app_snapshot.cc.

4763 {
4764 intptr_t count = objects_.length();
4765 for (intptr_t i = 0; i < count; i++) {
4766 WriteType(s, objects_[i]);
4767 }
4768 }

The documentation for this class was generated from the following file: