V8 Project
|
#include <hashmap.h>
Classes | |
struct | Entry |
Public Types | |
typedef bool(* | MatchFun) (void *key1, void *key2) |
Public Member Functions | |
TemplateHashMapImpl (MatchFun match, uint32_t capacity=kDefaultHashMapCapacity, AllocationPolicy allocator=AllocationPolicy()) | |
~TemplateHashMapImpl () | |
Entry * | Lookup (void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy()) |
void * | Remove (void *key, uint32_t hash) |
void | Clear () |
uint32_t | occupancy () const |
uint32_t | capacity () const |
Entry * | Start () const |
Entry * | Next (Entry *p) const |
Static Public Member Functions | |
static bool | PointersMatch (void *key1, void *key2) |
Static Public Attributes | |
static const uint32_t | kDefaultHashMapCapacity = 8 |
Private Member Functions | |
Entry * | map_end () const |
Entry * | Probe (void *key, uint32_t hash) |
void | Initialize (uint32_t capacity, AllocationPolicy allocator) |
void | Resize (AllocationPolicy allocator) |
Private Attributes | |
MatchFun | match_ |
Entry * | map_ |
uint32_t | capacity_ |
uint32_t | occupancy_ |
typedef bool(* v8::internal::TemplateHashMapImpl< AllocationPolicy >::MatchFun) (void *key1, void *key2) |
v8::internal::TemplateHashMapImpl< AllocationPolicy >::TemplateHashMapImpl | ( | MatchFun | match, |
uint32_t | capacity = kDefaultHashMapCapacity , |
||
AllocationPolicy | allocator = AllocationPolicy() |
||
) |
Definition at line 99 of file hashmap.h.
v8::internal::TemplateHashMapImpl< AllocationPolicy >::~TemplateHashMapImpl |
|
inline |
Definition at line 66 of file hashmap.h.
References v8::internal::TemplateHashMapImpl< AllocationPolicy >::capacity_.
Referenced by v8::internal::HeapObjectsMap::GetUsedMemorySize(), and v8::internal::StringsStorage::GetUsedMemorySize().
void v8::internal::TemplateHashMapImpl< AllocationPolicy >::Clear |
Definition at line 207 of file hashmap.h.
References NULL.
Referenced by v8::internal::HeapObjectsSet::Clear(), and v8::internal::LargeObjectSpace::SetUp().
|
private |
Definition at line 261 of file hashmap.h.
References DCHECK, v8::internal::FatalProcessOutOfMemory(), v8::base::bits::IsPowerOfTwo32(), and NULL.
TemplateHashMapImpl< AllocationPolicy >::Entry * v8::internal::TemplateHashMapImpl< AllocationPolicy >::Lookup | ( | void * | key, |
uint32_t | hash, | ||
bool | insert, | ||
AllocationPolicy | allocator = AllocationPolicy() |
||
) |
Definition at line 114 of file hashmap.h.
References v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::hash, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::key, NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::order, and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::value.
Referenced by v8::internal::AllocationTracker::AddFunctionInfo(), v8::internal::SerializationAddressMapper::AddMapping(), v8::internal::DuplicateFinder::AddSymbol(), v8::internal::LargeObjectSpace::AllocateRaw(), v8::internal::HeapObjectsSet::Contains(), v8::internal::Interface::DoAdd(), v8::internal::TemplateHashMap< Key, Value, AllocationPolicy >::find(), v8::internal::ProfileNode::FindChild(), v8::internal::HeapObjectsMap::FindEntry(), v8::internal::CodeAddressMap::NameMap::FindEntry(), v8::internal::ProfileNode::FindOrAddChild(), v8::internal::HeapObjectsMap::FindOrAddEntry(), v8::internal::NativeObjectsExplorer::FindOrAddGroupInfo(), v8::internal::CodeAddressMap::NameMap::FindOrCreateEntry(), v8::internal::LargeObjectSpace::FindPage(), v8::internal::HeapObjectsMap::FindUntrackedObjects(), v8::internal::StringsStorage::GetEntry(), v8::internal::NativeObjectsExplorer::GetListMaybeDisposeInfo(), v8::internal::AstValueFactory::GetString(), v8::internal::HeapSnapshotJSONSerializer::GetStringId(), v8::internal::HeapObjectsSet::GetTag(), v8::internal::ScriptCache::HandleWeakScript(), v8::internal::HeapObjectsSet::Insert(), v8::internal::SerializationAddressMapper::IsMapped(), v8::CounterMap::Lookup(), v8::internal::HeapEntriesMap::Map(), v8::internal::SerializationAddressMapper::MappedTo(), v8::internal::HeapObjectsMap::MoveObject(), v8::internal::HeapEntriesMap::Pair(), v8::internal::ExternalReferenceEncoder::Put(), v8::internal::HeapObjectsMap::RemoveDeadEntries(), v8::CounterMap::Set(), and v8::internal::HeapObjectsSet::SetTag().
|
inlineprivate |
Definition at line 90 of file hashmap.h.
References v8::internal::TemplateHashMapImpl< AllocationPolicy >::capacity_, and v8::internal::TemplateHashMapImpl< AllocationPolicy >::map_.
TemplateHashMapImpl< AllocationPolicy >::Entry * v8::internal::TemplateHashMapImpl< AllocationPolicy >::Next | ( | Entry * | p | ) | const |
Definition at line 226 of file hashmap.h.
References DCHECK, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::key, and NULL.
Referenced by v8::internal::Interface::Iterator::Advance(), v8::internal::Scope::AllocateNonParameterLocals(), v8::internal::Scope::CollectStackAndContextLocals(), v8::internal::StringsStorage::GetUsedMemorySize(), v8::internal::NativeObjectsExplorer::IterateAndExtractReferences(), v8::CounterMap::Iterator::Next(), v8::internal::ProfileNode::Print(), v8::internal::HeapSnapshotJSONSerializer::SerializeStrings(), v8::internal::NativeObjectsExplorer::SetRootNativeRootsReference(), v8::internal::CodeAddressMap::NameMap::~NameMap(), v8::internal::NativeObjectsExplorer::~NativeObjectsExplorer(), and v8::internal::StringsStorage::~StringsStorage().
|
inline |
Definition at line 61 of file hashmap.h.
References v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy_.
Referenced by v8::internal::Scope::AllocateNonParameterLocals(), v8::internal::Scope::CollectStackAndContextLocals(), v8::internal::Interface::DoUnify(), v8::internal::NativeObjectsExplorer::EstimateObjectsCount(), v8::internal::HeapObjectsMap::FindEntry(), v8::internal::HeapObjectsMap::FindOrAddEntry(), v8::internal::HeapObjectsMap::FindUntrackedObjects(), v8::internal::HeapObjectsSet::is_empty(), v8::internal::Interface::Length(), v8::internal::HeapObjectsMap::RemoveDeadEntries(), v8::internal::HeapSnapshotJSONSerializer::SerializeStrings(), v8::internal::Interface::Unify(), and v8::internal::HeapObjectsMap::UpdateHeapObjectsMap().
|
inlinestatic |
|
private |
Definition at line 240 of file hashmap.h.
References DCHECK, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::hash, v8::base::bits::IsPowerOfTwo32(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::key, and NULL.
void * v8::internal::TemplateHashMapImpl< AllocationPolicy >::Remove | ( | void * | key, |
uint32_t | hash | ||
) |
Definition at line 145 of file hashmap.h.
References DCHECK, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::hash, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::key, NULL, and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::value.
Referenced by v8::internal::LargeObjectSpace::FreeUnmarkedObjects(), v8::internal::ScriptCache::HandleWeakScript(), v8::internal::HeapObjectsMap::MoveObject(), v8::internal::HeapObjectsMap::RemoveDeadEntries(), and v8::internal::CodeAddressMap::NameMap::RemoveEntry().
|
private |
Definition at line 275 of file hashmap.h.
References map, NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::order, and v8::internal::TemplateHashMapImpl< AllocationPolicy >::Entry::value.
TemplateHashMapImpl< AllocationPolicy >::Entry * v8::internal::TemplateHashMapImpl< AllocationPolicy >::Start |
Definition at line 219 of file hashmap.h.
Referenced by v8::internal::Scope::AllocateNonParameterLocals(), v8::internal::TemplateHashMap< Key, Value, AllocationPolicy >::begin(), v8::internal::Scope::CollectStackAndContextLocals(), v8::internal::StringsStorage::GetUsedMemorySize(), v8::internal::NativeObjectsExplorer::IterateAndExtractReferences(), v8::internal::ProfileNode::Print(), v8::internal::HeapSnapshotJSONSerializer::SerializeStrings(), v8::internal::NativeObjectsExplorer::SetRootNativeRootsReference(), v8::internal::CodeAddressMap::NameMap::~NameMap(), v8::internal::NativeObjectsExplorer::~NativeObjectsExplorer(), and v8::internal::StringsStorage::~StringsStorage().
|
private |
Definition at line 87 of file hashmap.h.
Referenced by v8::internal::TemplateHashMapImpl< AllocationPolicy >::capacity(), and v8::internal::TemplateHashMapImpl< AllocationPolicy >::map_end().
|
static |
|
private |
Definition at line 86 of file hashmap.h.
Referenced by v8::internal::TemplateHashMapImpl< AllocationPolicy >::map_end().
|
private |
|
private |
Definition at line 88 of file hashmap.h.
Referenced by v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy().