Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ContextSerializationCluster Class Reference
Inheritance diagram for dart::ContextSerializationCluster:
dart::SerializationCluster dart::ZoneAllocated

Public Member Functions

 ContextSerializationCluster ()
 
 ~ContextSerializationCluster ()
 
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)
 

Additional Inherited Members

- Static Public Attributes inherited from dart::SerializationCluster
static constexpr intptr_t kSizeVaries = -1
 
- 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 3834 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ ContextSerializationCluster()

dart::ContextSerializationCluster::ContextSerializationCluster ( )
inline

Definition at line 3836 of file app_snapshot.cc.

3837 : SerializationCluster("Context", kContextCid) {}
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~ContextSerializationCluster()

dart::ContextSerializationCluster::~ContextSerializationCluster ( )
inline

Definition at line 3838 of file app_snapshot.cc.

3838{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 3840 of file app_snapshot.cc.

3840 {
3841 ContextPtr context = Context::RawCast(object);
3842 objects_.Add(context);
3843
3844 s->Push(context->untag()->parent());
3845 const intptr_t length = context->untag()->num_variables_;
3846 for (intptr_t i = 0; i < length; i++) {
3847 s->Push(context->untag()->element(i));
3848 }
3849 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
struct MyStruct s
size_t length

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 3851 of file app_snapshot.cc.

3851 {
3852 const intptr_t count = objects_.length();
3853 s->WriteUnsigned(count);
3854 for (intptr_t i = 0; i < count; i++) {
3855 ContextPtr context = objects_[i];
3856 s->AssignRef(context);
3857 AutoTraceObject(context);
3858 const intptr_t length = context->untag()->num_variables_;
3859 s->WriteUnsigned(length);
3861 }
3862 }
int count
Definition: FontMgrTest.cpp:50
#define AutoTraceObject(obj)
intptr_t length() const

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 3864 of file app_snapshot.cc.

3864 {
3865 const intptr_t count = objects_.length();
3866 for (intptr_t i = 0; i < count; i++) {
3867 ContextPtr context = objects_[i];
3868 AutoTraceObject(context);
3869 const intptr_t length = context->untag()->num_variables_;
3870 s->WriteUnsigned(length);
3871 WriteField(context, parent());
3872 for (intptr_t j = 0; j < length; j++) {
3873 s->WriteElementRef(context->untag()->element(j), j);
3874 }
3875 }
3876 }
#define WriteField(obj, field)

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