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

Public Member Functions

 MintSerializationCluster (bool is_canonical)
 
 ~MintSerializationCluster ()
 
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 5297 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ MintSerializationCluster()

dart::MintSerializationCluster::MintSerializationCluster ( bool  is_canonical)
inlineexplicit

Definition at line 5299 of file app_snapshot.cc.

5300 : SerializationCluster("int", kMintCid, kSizeVaries, is_canonical) {}
static constexpr intptr_t kSizeVaries
SerializationCluster(const char *name, intptr_t cid, intptr_t target_instance_size=kSizeVaries, bool is_canonical=false)

◆ ~MintSerializationCluster()

dart::MintSerializationCluster::~MintSerializationCluster ( )
inline

Definition at line 5301 of file app_snapshot.cc.

5301{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 5303 of file app_snapshot.cc.

5303 {
5304 if (!object->IsHeapObject()) {
5305 SmiPtr smi = Smi::RawCast(object);
5306 smis_.Add(smi);
5307 } else {
5308 MintPtr mint = Mint::RawCast(object);
5309 mints_.Add(mint);
5310 }
5311 }
void Add(const T &value)
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 5313 of file app_snapshot.cc.

5313 {
5314 s->WriteUnsigned(smis_.length() + mints_.length());
5315 for (intptr_t i = 0; i < smis_.length(); i++) {
5316 SmiPtr smi = smis_[i];
5317 s->AssignRef(smi);
5318 AutoTraceObject(smi);
5319 const int64_t value = Smi::Value(smi);
5320 s->Write<int64_t>(value);
5321 if (!Smi::IsValid(value)) {
5322 // This Smi will become a Mint when loaded.
5324 }
5325 }
5326 for (intptr_t i = 0; i < mints_.length(); i++) {
5327 MintPtr mint = mints_[i];
5328 s->AssignRef(mint);
5329 AutoTraceObject(mint);
5330 s->Write<int64_t>(mint->untag()->value_);
5331 // All Mints on the host should be Mints on the target.
5332 ASSERT(!Smi::IsValid(mint->untag()->value_));
5334 }
5335 }
#define AutoTraceObject(obj)
intptr_t length() const
intptr_t Value() const
Definition: object.h:9990
static bool IsValid(int64_t value)
Definition: object.h:10026
#define ASSERT(E)
struct MyStruct s
uint8_t value

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 5337 of file app_snapshot.cc.

5337{}

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