Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
dart::UnorderedHashSet< KeyTraits, TableStorageTraits > Class Template Reference

#include <hash_table.h>

Inheritance diagram for dart::UnorderedHashSet< KeyTraits, TableStorageTraits >:
dart::HashSet< UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >, ArrayStorageTraits > dart::UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits > dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits > dart::HashTableBase dart::ValueObject

Public Types

typedef HashSet< UnderlyingTable, TableStorageTraits > BaseSet
 
typedef TableStorageTraits::ArrayPtr ArrayPtr
 
typedef TableStorageTraits::ArrayHandle ArrayHandle
 
- Public Types inherited from dart::HashSet< UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >, ArrayStorageTraits >
typedef StorageTraits::ArrayPtr ArrayPtr
 
typedef StorageTraits::ArrayHandle ArrayHandle
 
- Public Types inherited from dart::UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >
typedef HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraitsBaseTable
 
typedef StorageTraits::ArrayPtr ArrayPtr
 
typedef StorageTraits::ArrayHandle ArrayHandle
 
- Public Types inherited from dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits >
typedef KeyTraits Traits
 
typedef ArrayStorageTraits Storage
 

Public Member Functions

 UnorderedHashSet (ArrayPtr data)
 
 UnorderedHashSet (Zone *zone, ArrayPtr data)
 
 UnorderedHashSet (Object *key, Smi *value, ArrayHandle *data)
 
void Dump () const
 
- Public Member Functions inherited from dart::HashSet< UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >, ArrayStorageTraits >
 HashSet (ArrayPtr data)
 
 HashSet (Zone *zone, ArrayPtr data)
 
 HashSet (Object *key, Smi *value, ArrayHandle *data)
 
bool Insert (const Object &key)
 
ObjectPtr InsertOrGet (const Object &key) const
 
ObjectPtr InsertNewOrGet (const Key &key) const
 
ObjectPtr GetOrNull (const Key &key, bool *present=nullptr) const
 
bool Remove (const Key &key) const
 
void Clear () const
 
- Public Member Functions inherited from dart::UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >
 UnorderedHashTable (ArrayPtr data)
 
 UnorderedHashTable (Zone *zone, ArrayPtr data)
 
 UnorderedHashTable (Object *key, Smi *value, ArrayHandle *data)
 
- Public Member Functions inherited from dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits >
 HashTable (Object *key, Smi *index, typename StorageTraits::ArrayHandle *data)
 
 HashTable (Zone *zone, typename StorageTraits::ArrayPtr data)
 
StorageTraits::ArrayHandle & Release ()
 
 ~HashTable ()
 
void Initialize () const
 
bool ContainsKey (const Key &key) const
 
intptr_t FindKey (const Key &key) const
 
bool FindKeyOrDeletedOrUnused (const Key &key, intptr_t *entry) const
 
void InsertKey (intptr_t entry, const Object &key) const
 
bool IsUnused (intptr_t entry) const
 
bool IsOccupied (intptr_t entry) const
 
bool IsDeleted (intptr_t entry) const
 
ObjectPtr GetKey (intptr_t entry) const
 
ObjectPtr GetPayload (intptr_t entry, intptr_t component) const
 
void UpdatePayload (intptr_t entry, intptr_t component, const Object &value) const
 
void DeleteEntry (intptr_t entry) const
 
intptr_t NumEntries () const
 
intptr_t NumUnused () const
 
intptr_t NumOccupied () const
 
intptr_t NumDeleted () const
 
ObjectKeyHandle () const
 
SmiSmiHandle () const
 
intptr_t NumGrows () const
 
intptr_t NumLT5Collisions () const
 
intptr_t NumLT25Collisions () const
 
intptr_t NumGT25Collisions () const
 
intptr_t NumProbes () const
 
void UpdateGrowth () const
 
void UpdateCollisions (intptr_t collisions) const
 
void PrintStats () const
 
void UpdateWeakDeleted () const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits >
static intptr_t ArrayLengthForNumOccupied (intptr_t num_occupied)
 
- Static Public Member Functions inherited from dart::HashTableBase
static const ObjectUnusedMarker ()
 
static const ObjectDeletedMarker ()
 
- Static Public Attributes inherited from dart::UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >
static constexpr intptr_t kPayloadSize
 
- Protected Member Functions inherited from dart::HashSet< UnorderedHashTable< KeyTraits, 0, ArrayStorageTraits >, ArrayStorageTraits >
void EnsureCapacity () const
 
- Protected Member Functions inherited from dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits >
intptr_t KeyIndex (intptr_t entry) const
 
intptr_t PayloadIndex (intptr_t entry, intptr_t component) const
 
ObjectPtr InternalGetKey (intptr_t entry) const
 
void InternalSetKey (intptr_t entry, const Object &key) const
 
intptr_t GetSmiValueAt (intptr_t index) const
 
void SetSmiValueAt (intptr_t index, intptr_t value) const
 
void AdjustSmiValueAt (intptr_t index, intptr_t delta) const
 
- Protected Attributes inherited from dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits >
Objectkey_handle_
 
Smismi_handle_
 
StorageTraits::ArrayHandle * data_
 
StorageTraits::ArrayHandle * released_data_
 
- Static Protected Attributes inherited from dart::HashTable< KeyTraits, kUserPayloadSize, 0, ArrayStorageTraits >
static constexpr intptr_t kOccupiedEntriesIndex
 
static constexpr intptr_t kDeletedEntriesIndex
 
static constexpr intptr_t kNumGrowsIndex
 
static constexpr intptr_t kNumLT5LookupsIndex
 
static constexpr intptr_t kNumLT25LookupsIndex
 
static constexpr intptr_t kNumGT25LookupsIndex
 
static constexpr intptr_t kNumProbesIndex
 
static constexpr intptr_t kHeaderSize
 
static constexpr intptr_t kMetaDataIndex
 
static constexpr intptr_t kFirstKeyIndex
 
static constexpr intptr_t kEntrySize
 

Detailed Description

template<typename KeyTraits, typename TableStorageTraits = ArrayStorageTraits>
class dart::UnorderedHashSet< KeyTraits, TableStorageTraits >

Definition at line 868 of file hash_table.h.

Member Typedef Documentation

◆ ArrayHandle

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
typedef TableStorageTraits::ArrayHandle dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::ArrayHandle

Definition at line 876 of file hash_table.h.

◆ ArrayPtr

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
typedef TableStorageTraits::ArrayPtr dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::ArrayPtr

Definition at line 875 of file hash_table.h.

◆ BaseSet

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
typedef HashSet<UnderlyingTable, TableStorageTraits> dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::BaseSet

Definition at line 874 of file hash_table.h.

Constructor & Destructor Documentation

◆ UnorderedHashSet() [1/3]

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::UnorderedHashSet ( ArrayPtr  data)
inlineexplicit

Definition at line 877 of file hash_table.h.

878 : BaseSet(Thread::Current()->zone(), data) {
880 }
static ObjectPtr null()
Definition: object.h:433
static Thread * Current()
Definition: thread.h:362
HashSet< UnderlyingTable, TableStorageTraits > BaseSet
Definition: hash_table.h:874
#define ASSERT(E)
static int8_t data[kExtLength]

◆ UnorderedHashSet() [2/3]

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::UnorderedHashSet ( Zone zone,
ArrayPtr  data 
)
inline

Definition at line 881 of file hash_table.h.

881: BaseSet(zone, data) {}

◆ UnorderedHashSet() [3/3]

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::UnorderedHashSet ( Object key,
Smi value,
ArrayHandle data 
)
inline

Definition at line 882 of file hash_table.h.

Member Function Documentation

◆ Dump()

template<typename KeyTraits , typename TableStorageTraits = ArrayStorageTraits>
void dart::UnorderedHashSet< KeyTraits, TableStorageTraits >::Dump ( ) const
inline

Definition at line 885 of file hash_table.h.

885 {
886 Object& entry = Object::Handle();
887 for (intptr_t i = 0; i < this->data_->Length(); i++) {
889 TableStorageTraits::At(this->data_, i));
890 if (entry.ptr() == BaseSet::UnusedMarker().ptr() ||
891 entry.ptr() == BaseSet::DeletedMarker().ptr() || entry.IsSmi()) {
892 // empty, deleted, num_used/num_deleted
893 OS::PrintErr("%" Pd ": %s\n", i, entry.ToCString());
894 } else {
895 intptr_t hash = KeyTraits::Hash(entry);
896 OS::PrintErr("%" Pd ": %" Pd ", %s\n", i, hash, entry.ToCString());
897 }
898 }
899 }
static uint32_t hash(const SkShaderBase::GradientInfo &v)
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static Object & Handle()
Definition: object.h:407
static ObjectPtr Unwrap(ObjectPtr obj)
Definition: object.h:6667
static uint32_t Hash(uint32_t key)
Definition: hashmap_test.cc:65
#define Pd
Definition: globals.h:408

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