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

Public Member Functions

 FieldSerializationCluster ()
 
 ~FieldSerializationCluster ()
 
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 ()
 
virtual void Trace (Serializer *serializer, ObjectPtr object)=0
 
virtual void WriteAlloc (Serializer *serializer)=0
 
virtual void WriteFill (Serializer *serializer)=0
 
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 2135 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ FieldSerializationCluster()

dart::FieldSerializationCluster::FieldSerializationCluster ( )
inline

Definition at line 2137 of file app_snapshot.cc.

2138 : SerializationCluster("Field",
2139 kFieldCid,
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~FieldSerializationCluster()

dart::FieldSerializationCluster::~FieldSerializationCluster ( )
inline

Definition at line 2141 of file app_snapshot.cc.

2141{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 2143 of file app_snapshot.cc.

2143 {
2144 FieldPtr field = Field::RawCast(object);
2145 objects_.Add(field);
2146
2147 Snapshot::Kind kind = s->kind();
2148
2149 s->Push(field->untag()->name());
2150 s->Push(field->untag()->owner());
2151 s->Push(field->untag()->type());
2152 // Write out the initializer function
2153 s->Push(field->untag()->initializer_function());
2154
2155 if (kind != Snapshot::kFullAOT) {
2156 s->Push(field->untag()->guarded_list_length());
2157 }
2158 if (kind == Snapshot::kFullJIT) {
2159 s->Push(field->untag()->dependent_code());
2160 }
2161 // Write out either the initial static value or field offset.
2162 if (Field::StaticBit::decode(field->untag()->kind_bits_)) {
2163 s->Push(field->untag()->host_offset_or_field_id());
2164 } else {
2165 s->Push(Smi::New(Field::TargetOffsetOf(field)));
2166 }
2167 }
void Add(const T &value)
static intptr_t TargetOffsetOf(FieldPtr field)
Definition: object.h:13255
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
static SmiPtr New(intptr_t value)
Definition: object.h:10006
struct MyStruct s
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 2169 of file app_snapshot.cc.

2169 {
2170 const intptr_t count = objects_.length();
2171 s->WriteUnsigned(count);
2172 for (intptr_t i = 0; i < count; i++) {
2173 FieldPtr field = objects_[i];
2174 s->AssignRef(field);
2175 }
2176 }
int count
Definition: FontMgrTest.cpp:50
intptr_t length() const

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 2178 of file app_snapshot.cc.

2178 {
2179 Snapshot::Kind kind = s->kind();
2180 const intptr_t count = objects_.length();
2181 for (intptr_t i = 0; i < count; i++) {
2182 FieldPtr field = objects_[i];
2183 AutoTraceObjectName(field, field->untag()->name());
2184
2185 WriteCompressedField(field, name);
2186 WriteCompressedField(field, owner);
2187 WriteCompressedField(field, type);
2188 // Write out the initializer function and initial value if not in AOT.
2189 WriteCompressedField(field, initializer_function);
2190 if (kind != Snapshot::kFullAOT) {
2191 WriteCompressedField(field, guarded_list_length);
2192 }
2193 if (kind == Snapshot::kFullJIT) {
2194 WriteCompressedField(field, dependent_code);
2195 }
2196
2197 if (kind != Snapshot::kFullAOT) {
2198 s->WriteTokenPosition(field->untag()->token_pos_);
2199 s->WriteTokenPosition(field->untag()->end_token_pos_);
2200 s->WriteCid(field->untag()->guarded_cid_);
2201 s->WriteCid(field->untag()->is_nullable_);
2202 s->Write<int8_t>(field->untag()->static_type_exactness_state_);
2203 s->Write<uint32_t>(field->untag()->kernel_offset_);
2204 }
2205 s->Write<uint16_t>(field->untag()->kind_bits_);
2206
2207 // Write out either the initial static value or field offset.
2208 if (Field::StaticBit::decode(field->untag()->kind_bits_)) {
2209 WriteFieldValue("id", field->untag()->host_offset_or_field_id());
2210 } else {
2212 }
2213 }
2214 }
#define AutoTraceObjectName(obj, str)
#define WriteCompressedField(obj, name)
#define WriteFieldValue(field, value)
GLenum type
const char * name() const

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