Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::RODataSerializationCluster Class Reference
Inheritance diagram for dart::RODataSerializationCluster:
dart::CanonicalSetSerializationCluster< CanonicalStringSet, String, ObjectPtr > dart::SerializationCluster dart::ZoneAllocated

Public Member Functions

 RODataSerializationCluster (Zone *zone, const char *type, intptr_t cid, bool is_canonical)
 
 ~RODataSerializationCluster ()
 
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 Member Functions inherited from dart::CanonicalSetSerializationCluster< CanonicalStringSet, String, ObjectPtr >
 CanonicalSetSerializationCluster (intptr_t cid, bool is_canonical, bool represents_canonical_set, const char *name, intptr_t target_instance_size=0)
 
virtual bool IsInCanonicalSet (Serializer *s, ObjectPtr ptr)
 
void ReorderObjects (Serializer *s)
 
void WriteCanonicalSetLayout (Serializer *s)
 
- Protected Attributes inherited from dart::CanonicalSetSerializationCluster< CanonicalStringSet, String, ObjectPtr >
GrowableArray< ObjectPtrobjects_
 
- 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 3612 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ RODataSerializationCluster()

dart::RODataSerializationCluster::RODataSerializationCluster ( Zone zone,
const char *  type,
intptr_t  cid,
bool  is_canonical 
)
inline

Definition at line 3617 of file app_snapshot.cc.

3622 cid,
3626 zone_(zone),
3627 cid_(cid),
3628 type_(type) {}
GLenum type
CanonicalSetSerializationCluster(intptr_t cid, bool is_canonical, bool represents_canonical_set, const char *name, intptr_t target_instance_size=0)
static const char * TagObjectTypeAsReadOnly(Zone *zone, const char *type)
bool IsStringClassId(intptr_t index)
Definition: class_id.h:350

◆ ~RODataSerializationCluster()

dart::RODataSerializationCluster::~RODataSerializationCluster ( )
inline

Definition at line 3629 of file app_snapshot.cc.

3629{}

Member Function Documentation

◆ Trace()

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

Implements dart::SerializationCluster.

Definition at line 3631 of file app_snapshot.cc.

3631 {
3632 // A string's hash must already be computed when we write it because it
3633 // will be loaded into read-only memory. Extra bytes due to allocation
3634 // rounding need to be deterministically set for reliable deduplication in
3635 // shared images.
3636 if (object->untag()->InVMIsolateHeap() ||
3637 s->heap()->old_space()->IsObjectFromImagePages(object)) {
3638 // This object is already read-only.
3639 } else {
3641 }
3642
3643 objects_.Add(object);
3644 }
void Add(const T &value)
static void FinalizeReadOnlyObject(ObjectPtr object)
Definition: object.cc:1556
struct MyStruct s

◆ WriteAlloc()

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

Implements dart::SerializationCluster.

Definition at line 3646 of file app_snapshot.cc.

3646 {
3647 const bool is_string_cluster = IsStringClassId(cid_);
3648
3649 intptr_t count = objects_.length();
3650 s->WriteUnsigned(count);
3652
3653 uint32_t running_offset = 0;
3654 for (intptr_t i = 0; i < count; i++) {
3655 ObjectPtr object = objects_[i];
3656 s->AssignRef(object);
3657 const StringPtr name =
3658 is_string_cluster ? String::RawCast(object) : nullptr;
3659 Serializer::WritingObjectScope scope(s, type_, object, name);
3660 uint32_t offset = s->GetDataOffset(object);
3661 s->TraceDataOffset(offset);
3664 ASSERT(offset > running_offset);
3665 s->WriteUnsigned((offset - running_offset) >>
3667 running_offset = offset;
3668 }
3670 }
int count
Definition: FontMgrTest.cpp:50
intptr_t length() const
static ObjectPtr RawCast(ObjectPtr obj)
Definition: object.h:325
const char * name() const
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:92
#define ASSERT(E)
SeparatedVector2 offset
static constexpr intptr_t kObjectAlignmentLog2
static constexpr intptr_t kObjectAlignment

◆ WriteFill()

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

Implements dart::SerializationCluster.

Definition at line 3672 of file app_snapshot.cc.

3672 {
3673 // No-op.
3674 }

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