Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::WeakArraySerializationCluster Class Reference
Inheritance diagram for dart::WeakArraySerializationCluster:
dart::SerializationCluster dart::ZoneAllocated

Public Member Functions

 WeakArraySerializationCluster ()
 
 ~WeakArraySerializationCluster ()
 
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 ()
 
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 6526 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ WeakArraySerializationCluster()

dart::WeakArraySerializationCluster::WeakArraySerializationCluster ( )
inline

Definition at line 6528 of file app_snapshot.cc.

6529 : SerializationCluster("WeakArray", kWeakArrayCid, kSizeVaries) {}
static constexpr intptr_t kSizeVaries
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~WeakArraySerializationCluster()

dart::WeakArraySerializationCluster::~WeakArraySerializationCluster ( )
inline

Definition at line 6530 of file app_snapshot.cc.

6530{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 6532 of file app_snapshot.cc.

6532 {
6533 WeakArrayPtr array = WeakArray::RawCast(object);
6534 objects_.Add(array);
6535
6536 const intptr_t length = Smi::Value(array->untag()->length());
6537 for (intptr_t i = 0; i < length; i++) {
6538 s->PushWeak(array->untag()->element(i));
6539 }
6540 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition object.h:325
intptr_t Value() const
Definition object.h:9969
struct MyStruct s
size_t length

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 6542 of file app_snapshot.cc.

6542 {
6543 const intptr_t count = objects_.length();
6544 s->WriteUnsigned(count);
6545 for (intptr_t i = 0; i < count; i++) {
6546 WeakArrayPtr array = objects_[i];
6547 s->AssignRef(array);
6548 AutoTraceObject(array);
6549 const intptr_t length = Smi::Value(array->untag()->length());
6550 s->WriteUnsigned(length);
6551 target_memory_size_ += compiler::target::WeakArray::InstanceSize(length);
6552 }
6553 }
int count
#define AutoTraceObject(obj)
intptr_t length() const

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 6555 of file app_snapshot.cc.

6555 {
6556 const intptr_t count = objects_.length();
6557 for (intptr_t i = 0; i < count; i++) {
6558 WeakArrayPtr array = objects_[i];
6559 AutoTraceObject(array);
6560 const intptr_t length = Smi::Value(array->untag()->length());
6561 s->WriteUnsigned(length);
6562 for (intptr_t j = 0; j < length; j++) {
6563 if (s->HasRef(array->untag()->element(j))) {
6564 s->WriteElementRef(array->untag()->element(j), j);
6565 } else {
6566 s->WriteElementRef(Object::null(), j);
6567 }
6568 }
6569 }
6570 }
static ObjectPtr null()
Definition object.h:433

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