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

Public Member Functions

 TypedDataDeserializationCluster (intptr_t cid)
 
 ~TypedDataDeserializationCluster ()
 
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::DeserializationCluster
void ReadAllocFixedSize (Deserializer *deserializer, intptr_t instance_size)
 
- 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 5712 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ TypedDataDeserializationCluster()

dart::TypedDataDeserializationCluster::TypedDataDeserializationCluster ( intptr_t  cid)
inlineexplicit

Definition at line 5714 of file app_snapshot.cc.

5715 : DeserializationCluster("TypedData"), cid_(cid) {}
DeserializationCluster(const char *name, bool is_canonical=false, bool is_immutable=false)
const intptr_t cid

◆ ~TypedDataDeserializationCluster()

dart::TypedDataDeserializationCluster::~TypedDataDeserializationCluster ( )
inline

Definition at line 5716 of file app_snapshot.cc.

5716{}

Member Function Documentation

◆ ReadAlloc()

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

Implements dart::DeserializationCluster.

Definition at line 5718 of file app_snapshot.cc.

5718 {
5719 start_index_ = d->next_index();
5720 const intptr_t count = d->ReadUnsigned();
5722 for (intptr_t i = 0; i < count; i++) {
5723 const intptr_t length = d->ReadUnsigned();
5724 d->AssignRef(d->Allocate(TypedData::InstanceSize(length * element_size)));
5725 }
5726 stop_index_ = d->next_index();
5727 }
int count
Definition: FontMgrTest.cpp:50
static size_t element_size(Layout layout, SkSLType type)
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
static intptr_t InstanceSize()
Definition: object.h:11673
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
size_t length

◆ ReadFill()

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

Implements dart::DeserializationCluster.

Definition at line 5729 of file app_snapshot.cc.

5729 {
5730 Deserializer::Local d(d_);
5731
5732 ASSERT(!is_canonical()); // Never canonical.
5734
5735 const intptr_t cid = cid_;
5736 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
5737 TypedDataPtr data = static_cast<TypedDataPtr>(d.Ref(id));
5738 const intptr_t length = d.ReadUnsigned();
5739 const intptr_t length_in_bytes = length * element_size;
5741 TypedData::InstanceSize(length_in_bytes));
5742 data->untag()->length_ = Smi::New(length);
5743 data->untag()->RecomputeDataField();
5744 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->untag()->data());
5745 d.ReadBytes(cdata, length_in_bytes);
5746 }
5747 }
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
static SmiPtr New(intptr_t value)
Definition: object.h:10006
#define ASSERT(E)
static int8_t data[kExtLength]

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