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

Public Member Functions

 RecordSerializationCluster (bool is_canonical)
 
 ~RecordSerializationCluster ()
 
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 5581 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ RecordSerializationCluster()

dart::RecordSerializationCluster::RecordSerializationCluster ( bool  is_canonical)
inlineexplicit

Definition at line 5583 of file app_snapshot.cc.

5584 : SerializationCluster("Record", kRecordCid, kSizeVaries, is_canonical) {}
static constexpr intptr_t kSizeVaries
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~RecordSerializationCluster()

dart::RecordSerializationCluster::~RecordSerializationCluster ( )
inline

Definition at line 5585 of file app_snapshot.cc.

5585{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 5587 of file app_snapshot.cc.

5587 {
5588 RecordPtr record = Record::RawCast(object);
5589 objects_.Add(record);
5590
5591 const intptr_t num_fields = Record::NumFields(record);
5592 for (intptr_t i = 0; i < num_fields; ++i) {
5593 s->Push(record->untag()->field(i));
5594 }
5595 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
static intptr_t NumFields(RecordPtr ptr)
Definition: object.h:11426
struct MyStruct s

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 5597 of file app_snapshot.cc.

5597 {
5598 const intptr_t count = objects_.length();
5599 s->WriteUnsigned(count);
5600 for (intptr_t i = 0; i < count; ++i) {
5601 RecordPtr record = objects_[i];
5602 s->AssignRef(record);
5603 AutoTraceObject(record);
5604 const intptr_t num_fields = Record::NumFields(record);
5605 s->WriteUnsigned(num_fields);
5607 }
5608 }
int count
Definition: FontMgrTest.cpp:50
#define AutoTraceObject(obj)
intptr_t length() const

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 5610 of file app_snapshot.cc.

5610 {
5611 const intptr_t count = objects_.length();
5612 for (intptr_t i = 0; i < count; ++i) {
5613 RecordPtr record = objects_[i];
5614 AutoTraceObject(record);
5615 const RecordShape shape(record->untag()->shape());
5616 s->WriteUnsigned(shape.AsInt());
5617 const intptr_t num_fields = shape.num_fields();
5618 for (intptr_t j = 0; j < num_fields; ++j) {
5619 s->WriteElementRef(record->untag()->field(j), j);
5620 }
5621 }
5622 }

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