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

Public Member Functions

 ExternalTypedDataMessageSerializationCluster (Zone *zone, intptr_t cid)
 
 ~ExternalTypedDataMessageSerializationCluster ()
 
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 1285 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ ExternalTypedDataMessageSerializationCluster()

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

Definition at line 1288 of file message_snapshot.cc.

1290 : MessageSerializationCluster("ExternalTypedData",
1292 cid),
1293 objects_(zone, 0) {}
MessageSerializationCluster(const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)

◆ ~ExternalTypedDataMessageSerializationCluster()

dart::ExternalTypedDataMessageSerializationCluster::~ExternalTypedDataMessageSerializationCluster ( )
inline

Definition at line 1294 of file message_snapshot.cc.

1294{}

Member Function Documentation

◆ Trace()

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

Implements dart::MessageSerializationCluster.

Definition at line 1296 of file message_snapshot.cc.

1296 {
1297 ExternalTypedData* data = static_cast<ExternalTypedData*>(object);
1298 objects_.Add(data);
1299 }
static int8_t data[kExtLength]

◆ TraceApi()

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

Reimplemented from dart::MessageSerializationCluster.

Definition at line 1322 of file message_snapshot.cc.

1322 {
1323 objects_.Add(reinterpret_cast<ExternalTypedData*>(object));
1324 }

◆ WriteNodes()

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

Implements dart::MessageSerializationCluster.

Definition at line 1301 of file message_snapshot.cc.

1301 {
1303
1304 intptr_t count = objects_.length();
1305 s->WriteUnsigned(count);
1306 for (intptr_t i = 0; i < count; i++) {
1307 ExternalTypedData* data = objects_[i];
1308 s->AssignRef(data);
1309 intptr_t length = Smi::Value(data->untag()->length_);
1310 s->WriteUnsigned(length);
1311
1312 intptr_t length_in_bytes = length * element_size;
1313 void* passed_data = malloc(length_in_bytes);
1314 memmove(passed_data, data->untag()->data_, length_in_bytes);
1315 s->finalizable_data()->Put(length_in_bytes,
1316 passed_data, // data
1317 passed_data, // peer,
1319 }
1320 }
int count
Definition: FontMgrTest.cpp:50
static size_t element_size(Layout layout, SkSLType type)
intptr_t Value() const
Definition: object.h:9990
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
struct MyStruct s
size_t length
void * malloc(size_t size)
Definition: allocation.cc:19
static void IsolateMessageTypedDataFinalizer(void *isolate_callback_data, void *buffer)

◆ WriteNodesApi()

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

Reimplemented from dart::MessageSerializationCluster.

Definition at line 1326 of file message_snapshot.cc.

1326 {
1328
1329 intptr_t count = objects_.length();
1330 s->WriteUnsigned(count);
1331 for (intptr_t i = 0; i < count; i++) {
1332 Dart_CObject* data = reinterpret_cast<Dart_CObject*>(objects_[i]);
1333 s->AssignRef(data);
1334
1335 intptr_t length = data->value.as_external_typed_data.length;
1336 s->WriteUnsigned(length);
1337
1338 s->finalizable_data()->Put(length * element_size,
1339 data->value.as_external_typed_data.data,
1340 data->value.as_external_typed_data.peer,
1341 data->value.as_external_typed_data.callback);
1342 }
1343 }

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