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

Public Member Functions

 ArrayMessageSerializationCluster (Zone *zone, bool is_canonical, intptr_t cid)
 
 ~ArrayMessageSerializationCluster ()
 
void Trace (MessageSerializer *s, Object *object)
 
void WriteNodes (MessageSerializer *s)
 
void WriteEdges (MessageSerializer *s)
 
void TraceApi (ApiMessageSerializer *s, Dart_CObject *object)
 
void WriteNodesApi (ApiMessageSerializer *s)
 
void WriteEdgesApi (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 2302 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ ArrayMessageSerializationCluster()

dart::ArrayMessageSerializationCluster::ArrayMessageSerializationCluster ( Zone zone,
bool  is_canonical,
intptr_t  cid 
)
inline

Definition at line 2304 of file message_snapshot.cc.

2309 cid,
2310 is_canonical),
2311 objects_(zone, 0) {}
MessageSerializationCluster(const char *name, MessagePhase phase, intptr_t cid, bool is_canonical=false)

◆ ~ArrayMessageSerializationCluster()

dart::ArrayMessageSerializationCluster::~ArrayMessageSerializationCluster ( )
inline

Definition at line 2312 of file message_snapshot.cc.

2312{}

Member Function Documentation

◆ Trace()

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

Implements dart::MessageSerializationCluster.

Definition at line 2314 of file message_snapshot.cc.

2314 {
2315 Array* array = static_cast<Array*>(object);
2316 objects_.Add(array);
2317
2318 // Compensation for bogus type prefix optimization.
2319 TypeArguments& args =
2320 TypeArguments::Handle(s->zone(), array->untag()->type_arguments());
2321 if (!args.IsNull() && (args.Length() != 1)) {
2322 args = args.TruncatedTo(1);
2323 array->untag()->set_type_arguments(args.ptr());
2324 }
2325
2326 s->Push(array->untag()->type_arguments());
2327 intptr_t length = Smi::Value(array->untag()->length());
2328 for (intptr_t i = 0; i < length; i++) {
2329 s->Push(array->untag()->element(i));
2330 }
2331 }
static Object & Handle()
Definition: object.h:407
intptr_t Value() const
Definition: object.h:9990
struct MyStruct s
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
size_t length

◆ TraceApi()

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

Reimplemented from dart::MessageSerializationCluster.

Definition at line 2356 of file message_snapshot.cc.

2356 {
2357 objects_.Add(reinterpret_cast<Array*>(object));
2358
2359 for (intptr_t i = 0, n = object->value.as_array.length; i < n; i++) {
2360 s->Push(object->value.as_array.values[i]);
2361 }
2362 }
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@89 as_array
struct _Dart_CObject ** values

◆ WriteEdges()

void dart::ArrayMessageSerializationCluster::WriteEdges ( MessageSerializer s)
inlinevirtual

Reimplemented from dart::MessageSerializationCluster.

Definition at line 2344 of file message_snapshot.cc.

2344 {
2345 const intptr_t count = objects_.length();
2346 for (intptr_t i = 0; i < count; i++) {
2347 Array* array = objects_[i];
2348 intptr_t length = array->Length();
2349 s->WriteRef(array->untag()->type_arguments());
2350 for (intptr_t j = 0; j < length; j++) {
2351 s->WriteRef(array->untag()->element(j));
2352 }
2353 }
2354 }
int count
Definition: FontMgrTest.cpp:50

◆ WriteEdgesApi()

void dart::ArrayMessageSerializationCluster::WriteEdgesApi ( ApiMessageSerializer s)
inlinevirtual

Reimplemented from dart::MessageSerializationCluster.

Definition at line 2374 of file message_snapshot.cc.

2374 {
2375 intptr_t count = objects_.length();
2376 for (intptr_t i = 0; i < count; i++) {
2377 Dart_CObject* array = reinterpret_cast<Dart_CObject*>(objects_[i]);
2378 intptr_t length = array->value.as_array.length;
2379 s->WriteRef(PredefinedCObjects::cobj_null()); // TypeArguments
2380 for (intptr_t j = 0; j < length; j++) {
2381 s->WriteRef(array->value.as_array.values[j]);
2382 }
2383 }
2384 }
static Dart_CObject * cobj_null()

◆ WriteNodes()

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

Implements dart::MessageSerializationCluster.

Definition at line 2333 of file message_snapshot.cc.

2333 {
2334 const intptr_t count = objects_.length();
2335 s->WriteUnsigned(count);
2336 for (intptr_t i = 0; i < count; i++) {
2337 Array* array = objects_[i];
2338 s->AssignRef(array);
2339 intptr_t length = Smi::Value(array->untag()->length());
2340 s->WriteUnsigned(length);
2341 }
2342 }

◆ WriteNodesApi()

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

Reimplemented from dart::MessageSerializationCluster.

Definition at line 2364 of file message_snapshot.cc.

2364 {
2365 intptr_t count = objects_.length();
2366 s->WriteUnsigned(count);
2367 for (intptr_t i = 0; i < count; i++) {
2368 Dart_CObject* array = reinterpret_cast<Dart_CObject*>(objects_[i]);
2369 s->AssignRef(array);
2370 s->WriteUnsigned(array->value.as_array.length);
2371 }
2372 }

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