Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::InstanceDeserializationCluster Class Reference
Inheritance diagram for dart::InstanceDeserializationCluster:
dart::AbstractInstanceDeserializationCluster dart::DeserializationCluster dart::ZoneAllocated

Public Member Functions

 InstanceDeserializationCluster (intptr_t cid, bool is_canonical, bool is_immutable, bool is_root_unit)
 
 ~InstanceDeserializationCluster ()
 
void ReadAlloc (Deserializer *d) override
 
void ReadFill (Deserializer *d_) override
 
- Public Member Functions inherited from dart::DeserializationCluster
 DeserializationCluster (const char *name, bool is_canonical=false, bool is_immutable=false)
 
virtual ~DeserializationCluster ()
 
virtual void ReadAlloc (Deserializer *deserializer)=0
 
virtual void ReadFill (Deserializer *deserializer)=0
 
virtual void PostLoad (Deserializer *deserializer, const Array &refs)
 
const char * name () const
 
bool is_canonical () 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

- Protected Member Functions inherited from dart::AbstractInstanceDeserializationCluster
 AbstractInstanceDeserializationCluster (const char *name, bool is_canonical, bool is_root_unit)
 
- Protected Member Functions inherited from dart::DeserializationCluster
void ReadAllocFixedSize (Deserializer *deserializer, intptr_t instance_size)
 
- Protected Attributes inherited from dart::AbstractInstanceDeserializationCluster
const bool is_root_unit_
 
- Protected Attributes inherited from dart::DeserializationCluster
const char *const name_
 
const bool is_canonical_
 
const bool is_immutable_
 
intptr_t start_index_
 
intptr_t stop_index_
 

Detailed Description

Definition at line 4584 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ InstanceDeserializationCluster()

dart::InstanceDeserializationCluster::InstanceDeserializationCluster ( intptr_t  cid,
bool  is_canonical,
bool  is_immutable,
bool  is_root_unit 
)
inlineexplicit

Definition at line 4587 of file app_snapshot.cc.

4593 is_root_unit),
4594 cid_(cid),
4595 is_immutable_(is_immutable) {}
AbstractInstanceDeserializationCluster(const char *name, bool is_canonical, bool is_root_unit)
const intptr_t cid

◆ ~InstanceDeserializationCluster()

dart::InstanceDeserializationCluster::~InstanceDeserializationCluster ( )
inline

Definition at line 4596 of file app_snapshot.cc.

4596{}

Member Function Documentation

◆ ReadAlloc()

void dart::InstanceDeserializationCluster::ReadAlloc ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 4598 of file app_snapshot.cc.

4598 {
4599 start_index_ = d->next_index();
4600 const intptr_t count = d->ReadUnsigned();
4601 next_field_offset_in_words_ = d->Read<int32_t>();
4602 instance_size_in_words_ = d->Read<int32_t>();
4603 intptr_t instance_size = Object::RoundedAllocationSize(
4604 instance_size_in_words_ * kCompressedWordSize);
4605 for (intptr_t i = 0; i < count; i++) {
4606 d->AssignRef(d->Allocate(instance_size));
4607 }
4608 stop_index_ = d->next_index();
4609 }
int count
Definition: FontMgrTest.cpp:50
static constexpr intptr_t RoundedAllocationSize(intptr_t size)
Definition: object.h:758
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
static constexpr intptr_t kCompressedWordSize
Definition: globals.h:42

◆ ReadFill()

void dart::InstanceDeserializationCluster::ReadFill ( Deserializer d_)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 4611 of file app_snapshot.cc.

4611 {
4612 Deserializer::Local d(d_);
4613
4614 const intptr_t cid = cid_;
4615 const bool mark_canonical = is_root_unit_ && is_canonical();
4616 const bool is_immutable = is_immutable_;
4617 intptr_t next_field_offset = next_field_offset_in_words_
4619 intptr_t instance_size = Object::RoundedAllocationSize(
4620 instance_size_in_words_ * kCompressedWordSize);
4621 const UnboxedFieldBitmap unboxed_fields_bitmap(d.ReadUnsigned64());
4622
4623 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
4624 InstancePtr instance = static_cast<InstancePtr>(d.Ref(id));
4626 mark_canonical, is_immutable);
4627 intptr_t offset = Instance::NextFieldOffset();
4628 while (offset < next_field_offset) {
4629 if (unboxed_fields_bitmap.Get(offset / kCompressedWordSize)) {
4630 compressed_uword* p = reinterpret_cast<compressed_uword*>(
4631 reinterpret_cast<uword>(instance->untag()) + offset);
4632 // Reads 32 bits of the unboxed value at a time
4633 *p = d.ReadWordWith32BitReads();
4634 } else {
4635 CompressedObjectPtr* p = reinterpret_cast<CompressedObjectPtr*>(
4636 reinterpret_cast<uword>(instance->untag()) + offset);
4637 *p = d.ReadRef();
4638 }
4640 }
4641 while (offset < instance_size) {
4642 CompressedObjectPtr* p = reinterpret_cast<CompressedObjectPtr*>(
4643 reinterpret_cast<uword>(instance->untag()) + offset);
4644 *p = Object::null();
4646 }
4647 ASSERT(offset == instance_size);
4648 }
4649 }
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
static intptr_t NextFieldOffset()
Definition: object.h:8355
static ObjectPtr null()
Definition: object.h:433
#define ASSERT(E)
VkInstance instance
Definition: main.cc:48
static constexpr intptr_t kCompressedWordSizeLog2
Definition: globals.h:43
uintptr_t uword
Definition: globals.h:501
uintptr_t compressed_uword
Definition: globals.h:44
ObjectPtr CompressedObjectPtr
SeparatedVector2 offset

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