Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet > Class Template Reference
Inheritance diagram for dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >:
dart::DeserializationCluster dart::ZoneAllocated

Public Member Functions

 CanonicalSetDeserializationCluster (bool is_canonical, bool is_root_unit, const char *name)
 
void BuildCanonicalSetFromLayout (Deserializer *d)
 
- 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)
 

Protected Member Functions

void VerifyCanonicalSet (Deserializer *d, const Array &refs, const typename SetType::ArrayHandle &current_table)
 
- Protected Member Functions inherited from dart::DeserializationCluster
void ReadAllocFixedSize (Deserializer *deserializer, intptr_t instance_size)
 

Protected Attributes

const bool is_root_unit_
 
intptr_t first_element_
 
SetType::ArrayHandle & table_
 
- 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

template<typename SetType, bool kAllCanonicalObjectsAreIncludedIntoSet = true>
class dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >

Definition at line 1326 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ CanonicalSetDeserializationCluster()

template<typename SetType , bool kAllCanonicalObjectsAreIncludedIntoSet = true>
dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >::CanonicalSetDeserializationCluster ( bool  is_canonical,
bool  is_root_unit,
const char *  name 
)
inline

Definition at line 1328 of file app_snapshot.cc.

1332 is_root_unit_(is_root_unit),
1333 table_(SetType::ArrayHandle::Handle()) {}
DeserializationCluster(const char *name, bool is_canonical=false, bool is_immutable=false)
const char * name() const

Member Function Documentation

◆ BuildCanonicalSetFromLayout()

template<typename SetType , bool kAllCanonicalObjectsAreIncludedIntoSet = true>
void dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >::BuildCanonicalSetFromLayout ( Deserializer d)
inline

Definition at line 1335 of file app_snapshot.cc.

1335 {
1336 if (!is_root_unit_ || !is_canonical()) {
1337 return;
1338 }
1339
1340 const auto table_length = d->ReadUnsigned();
1341 first_element_ = d->ReadUnsigned();
1342 const intptr_t count = stop_index_ - (start_index_ + first_element_);
1343 auto table = StartDeserialization(d, table_length, count);
1344 for (intptr_t i = start_index_ + first_element_; i < stop_index_; i++) {
1345 table.FillGap(d->ReadUnsigned());
1346 table.WriteElement(d, d->Ref(i));
1347 }
1348 table_ = table.Finish();
1349 }
int count
Definition: FontMgrTest.cpp:50
SI F table(const skcms_Curve *curve, F v)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ VerifyCanonicalSet()

template<typename SetType , bool kAllCanonicalObjectsAreIncludedIntoSet = true>
void dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >::VerifyCanonicalSet ( Deserializer d,
const Array refs,
const typename SetType::ArrayHandle &  current_table 
)
inlineprotected

Definition at line 1356 of file app_snapshot.cc.

1358 {
1359#if defined(DEBUG)
1360 // First check that we are not overwriting a table and loosing information.
1361 if (!current_table.IsNull()) {
1362 SetType current_set(d->zone(), current_table.ptr());
1363 ASSERT(current_set.NumOccupied() == 0);
1364 current_set.Release();
1365 }
1366
1367 // Now check that manually created table behaves correctly as a canonical
1368 // set.
1369 SetType canonical_set(d->zone(), table_.ptr());
1370 Object& key = Object::Handle();
1371 for (intptr_t i = start_index_ + first_element_; i < stop_index_; i++) {
1372 key = refs.At(i);
1373 ASSERT(canonical_set.GetOrNull(key) != Object::null());
1374 }
1375 canonical_set.Release();
1376#endif // defined(DEBUG)
1377 }
static ObjectPtr null()
Definition: object.h:433
static Object & Handle()
Definition: object.h:407
#define ASSERT(E)

Member Data Documentation

◆ first_element_

template<typename SetType , bool kAllCanonicalObjectsAreIncludedIntoSet = true>
intptr_t dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >::first_element_
protected

Definition at line 1353 of file app_snapshot.cc.

◆ is_root_unit_

template<typename SetType , bool kAllCanonicalObjectsAreIncludedIntoSet = true>
const bool dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >::is_root_unit_
protected

Definition at line 1352 of file app_snapshot.cc.

◆ table_

template<typename SetType , bool kAllCanonicalObjectsAreIncludedIntoSet = true>
SetType::ArrayHandle& dart::CanonicalSetDeserializationCluster< SetType, kAllCanonicalObjectsAreIncludedIntoSet >::table_
protected

Definition at line 1354 of file app_snapshot.cc.


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