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

Public Member Functions

 TypedDataSerializationCluster (intptr_t cid)
 
 ~TypedDataSerializationCluster ()
 
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 5668 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ TypedDataSerializationCluster()

dart::TypedDataSerializationCluster::TypedDataSerializationCluster ( intptr_t  cid)
inlineexplicit

Definition at line 5670 of file app_snapshot.cc.

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

◆ ~TypedDataSerializationCluster()

dart::TypedDataSerializationCluster::~TypedDataSerializationCluster ( )
inline

Definition at line 5672 of file app_snapshot.cc.

5672{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 5674 of file app_snapshot.cc.

5674 {
5675 TypedDataPtr data = TypedData::RawCast(object);
5676 objects_.Add(data);
5677 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
static int8_t data[kExtLength]

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 5679 of file app_snapshot.cc.

5679 {
5680 const intptr_t count = objects_.length();
5681 s->WriteUnsigned(count);
5683 for (intptr_t i = 0; i < count; i++) {
5684 TypedDataPtr data = objects_[i];
5685 s->AssignRef(data);
5687 const intptr_t length = Smi::Value(data->untag()->length());
5688 s->WriteUnsigned(length);
5691 }
5692 }
int count
Definition: FontMgrTest.cpp:50
static size_t element_size(Layout layout, SkSLType type)
#define AutoTraceObject(obj)
intptr_t length() const
intptr_t Value() const
Definition: object.h:9990
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
struct MyStruct s
size_t length

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 5694 of file app_snapshot.cc.

5694 {
5695 const intptr_t count = objects_.length();
5697 for (intptr_t i = 0; i < count; i++) {
5698 TypedDataPtr data = objects_[i];
5700 const intptr_t length = Smi::Value(data->untag()->length());
5701 s->WriteUnsigned(length);
5702 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->untag()->data());
5703 s->WriteBytes(cdata, length * element_size);
5704 }
5705 }

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