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

Public Member Functions

 DeltaEncodedTypedDataDeserializationCluster ()
 
 ~DeltaEncodedTypedDataDeserializationCluster ()
 
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 5965 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ DeltaEncodedTypedDataDeserializationCluster()

dart::DeltaEncodedTypedDataDeserializationCluster::DeltaEncodedTypedDataDeserializationCluster ( )
inline

Definition at line 5968 of file app_snapshot.cc.

5969 : DeserializationCluster("DeltaEncodedTypedData") {}
DeserializationCluster(const char *name, bool is_canonical=false, bool is_immutable=false)

◆ ~DeltaEncodedTypedDataDeserializationCluster()

dart::DeltaEncodedTypedDataDeserializationCluster::~DeltaEncodedTypedDataDeserializationCluster ( )
inline

Definition at line 5970 of file app_snapshot.cc.

5970{}

Member Function Documentation

◆ ReadAlloc()

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

Implements dart::DeserializationCluster.

Definition at line 5972 of file app_snapshot.cc.

5972 {
5973 start_index_ = d->next_index();
5974 const intptr_t count = d->ReadUnsigned();
5975 for (intptr_t i = 0; i < count; i++) {
5976 const intptr_t length_in_bytes = d->ReadUnsigned();
5977 d->AssignRef(d->Allocate(TypedData::InstanceSize(length_in_bytes)));
5978 }
5979 stop_index_ = d->next_index();
5980 }
int count
Definition: FontMgrTest.cpp:50
static intptr_t InstanceSize()
Definition: object.h:11673
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ ReadFill()

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

Implements dart::DeserializationCluster.

Definition at line 5982 of file app_snapshot.cc.

5982 {
5983 Deserializer::Local d(d_);
5984 TypedData& typed_data = TypedData::Handle(d_->zone());
5985
5986 ASSERT(!is_canonical()); // Never canonical.
5987
5988 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
5989 TypedDataPtr data = static_cast<TypedDataPtr>(d.Ref(id));
5990 const intptr_t encoded_length = d.ReadUnsigned();
5991 const intptr_t length = encoded_length >> 1;
5992 const intptr_t cid = (encoded_length & 0x1) == 0
5993 ? kTypedDataUint16ArrayCid
5994 : kTypedDataUint32ArrayCid;
5996 const intptr_t length_in_bytes = length * element_size;
5998 TypedData::InstanceSize(length_in_bytes));
5999 data->untag()->length_ = Smi::New(length);
6000 data->untag()->RecomputeDataField();
6001 intptr_t value = 0;
6002 typed_data = data;
6003 for (intptr_t j = 0; j < length; ++j) {
6004 value += d.ReadUnsigned();
6005 if (cid == kTypedDataUint16ArrayCid) {
6006 typed_data.SetUint16(j << 1, static_cast<uint16_t>(value));
6007 } else {
6008 typed_data.SetUint32(j << 2, value);
6009 }
6010 }
6011 }
6012 }
static size_t element_size(Layout layout, SkSLType type)
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
static Object & Handle()
Definition: object.h:407
static SmiPtr New(intptr_t value)
Definition: object.h:10006
intptr_t ElementSizeInBytes() const
Definition: object.h:11531
#define ASSERT(E)
uint8_t value
size_t length
const intptr_t cid
static int8_t data[kExtLength]

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