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

Public Member Functions

 TypedDataMessageSerializationCluster (Zone *zone, intptr_t cid)
 
 ~TypedDataMessageSerializationCluster ()
 
void Trace (MessageSerializer *s, Object *object)
 
void WriteNodes (MessageSerializer *s)
 
void TraceApi (ApiMessageSerializer *s, Dart_CObject *object)
 
void WriteNodesApi (ApiMessageSerializer *s)
 
- Public Member Functions inherited from dart::MessageSerializationCluster
 MessageSerializationCluster (const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)
 
virtual ~MessageSerializationCluster ()
 
virtual void Trace (MessageSerializer *s, Object *object)=0
 
virtual void WriteNodes (MessageSerializer *s)=0
 
virtual void WriteEdges (MessageSerializer *s)
 
virtual void TraceApi (ApiMessageSerializer *s, Dart_CObject *object)
 
virtual void WriteNodesApi (ApiMessageSerializer *s)
 
virtual void WriteEdgesApi (ApiMessageSerializer *s)
 
const char * name () const
 
MessagePhase phase () const
 
intptr_t cid () const
 
bool is_canonical () 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

- Protected Member Functions inherited from dart::MessageSerializationCluster
 DISALLOW_COPY_AND_ASSIGN (MessageSerializationCluster)
 
- Protected Attributes inherited from dart::MessageSerializationCluster
const char *const name_
 
const MessagePhase phase_
 
const intptr_t cid_
 
const bool is_canonical_
 

Detailed Description

Definition at line 1136 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ TypedDataMessageSerializationCluster()

dart::TypedDataMessageSerializationCluster::TypedDataMessageSerializationCluster ( Zone zone,
intptr_t  cid 
)
inlineexplicit

Definition at line 1139 of file message_snapshot.cc.

1140 : MessageSerializationCluster("TypedData",
1142 cid),
1143 objects_(zone, 0) {}
MessageSerializationCluster(const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)

◆ ~TypedDataMessageSerializationCluster()

dart::TypedDataMessageSerializationCluster::~TypedDataMessageSerializationCluster ( )
inline

Definition at line 1144 of file message_snapshot.cc.

1144{}

Member Function Documentation

◆ Trace()

void dart::TypedDataMessageSerializationCluster::Trace ( MessageSerializer s,
Object object 
)
inlinevirtual

Implements dart::MessageSerializationCluster.

Definition at line 1146 of file message_snapshot.cc.

1146 {
1147 TypedData* data = static_cast<TypedData*>(object);
1148 objects_.Add(data);
1149 }
static int8_t data[kExtLength]

◆ TraceApi()

void dart::TypedDataMessageSerializationCluster::TraceApi ( ApiMessageSerializer s,
Dart_CObject object 
)
inlinevirtual

Reimplemented from dart::MessageSerializationCluster.

Definition at line 1166 of file message_snapshot.cc.

1166 {
1167 objects_.Add(reinterpret_cast<TypedData*>(object));
1168 }

◆ WriteNodes()

void dart::TypedDataMessageSerializationCluster::WriteNodes ( MessageSerializer s)
inlinevirtual

Implements dart::MessageSerializationCluster.

Definition at line 1151 of file message_snapshot.cc.

1151 {
1153 intptr_t count = objects_.length();
1154 s->WriteUnsigned(count);
1155 for (intptr_t i = 0; i < count; i++) {
1156 TypedData* data = objects_[i];
1157 s->AssignRef(data);
1158 intptr_t length = data->Length();
1159 s->WriteUnsigned(length);
1160 NoSafepointScope no_safepoint;
1161 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->untag()->data());
1162 s->WriteBytes(cdata, length * element_size);
1163 }
1164 }
int count
Definition: FontMgrTest.cpp:50
static size_t element_size(Layout layout, SkSLType type)
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
struct MyStruct s
size_t length

◆ WriteNodesApi()

void dart::TypedDataMessageSerializationCluster::WriteNodesApi ( ApiMessageSerializer s)
inlinevirtual

Reimplemented from dart::MessageSerializationCluster.

Definition at line 1170 of file message_snapshot.cc.

1170 {
1172 intptr_t count = objects_.length();
1173 s->WriteUnsigned(count);
1174 for (intptr_t i = 0; i < count; i++) {
1175 Dart_CObject* data = reinterpret_cast<Dart_CObject*>(objects_[i]);
1176 s->AssignRef(data);
1177 intptr_t length = data->value.as_external_typed_data.length;
1178 s->WriteUnsigned(length);
1179 const uint8_t* cdata = data->value.as_typed_data.values;
1180 s->WriteBytes(cdata, length * element_size);
1181 }
1182 }

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