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

Public Member Functions

 WeakPropertySerializationCluster ()
 
 ~WeakPropertySerializationCluster ()
 
void Trace (Serializer *s, ObjectPtr object)
 
void RetraceEphemerons (Serializer *s)
 
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 6142 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ WeakPropertySerializationCluster()

dart::WeakPropertySerializationCluster::WeakPropertySerializationCluster ( )
inline

Definition at line 6144 of file app_snapshot.cc.

6145 : SerializationCluster("WeakProperty",
6146 kWeakPropertyCid,
6147 compiler::target::WeakProperty::InstanceSize()) {}
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~WeakPropertySerializationCluster()

dart::WeakPropertySerializationCluster::~WeakPropertySerializationCluster ( )
inline

Definition at line 6148 of file app_snapshot.cc.

6148{}

Member Function Documentation

◆ RetraceEphemerons()

void dart::WeakPropertySerializationCluster::RetraceEphemerons ( Serializer s)
inline

Definition at line 6157 of file app_snapshot.cc.

6157 {
6158 for (intptr_t i = 0; i < objects_.length(); i++) {
6159 WeakPropertyPtr property = objects_[i];
6160 if (s->IsReachable(property->untag()->key())) {
6161 s->Push(property->untag()->value());
6162 }
6163 }
6164 }
intptr_t length() const
struct MyStruct s

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 6150 of file app_snapshot.cc.

6150 {
6151 WeakPropertyPtr property = WeakProperty::RawCast(object);
6152 objects_.Add(property);
6153
6154 s->PushWeak(property->untag()->key());
6155 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition object.h:325

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 6166 of file app_snapshot.cc.

6166 {
6167 const intptr_t count = objects_.length();
6168 s->WriteUnsigned(count);
6169 for (intptr_t i = 0; i < count; i++) {
6170 WeakPropertyPtr property = objects_[i];
6171 s->AssignRef(property);
6172 }
6173 }
int count

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 6175 of file app_snapshot.cc.

6175 {
6176 const intptr_t count = objects_.length();
6177 for (intptr_t i = 0; i < count; i++) {
6178 WeakPropertyPtr property = objects_[i];
6179 AutoTraceObject(property);
6180 if (s->HasRef(property->untag()->key())) {
6181 s->WriteOffsetRef(property->untag()->key(), WeakProperty::key_offset());
6182 s->WriteOffsetRef(property->untag()->value(),
6184 } else {
6185 s->WriteOffsetRef(Object::null(), WeakProperty::key_offset());
6186 s->WriteOffsetRef(Object::null(), WeakProperty::value_offset());
6187 }
6188 }
6189 }
#define AutoTraceObject(obj)
static ObjectPtr null()
Definition object.h:433
static intptr_t key_offset()
Definition object.h:12896
static intptr_t value_offset()
Definition object.h:12900

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