Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qv4identifiertable_p.h>
Public Types | |
enum | KeyConversionBehavior { Default , ForceConversionToId } |
Public Member Functions | |
void | addEntry (Heap::StringOrSymbol *str) |
IdentifierTable (ExecutionEngine *engine, int numBits=8) | |
~IdentifierTable () | |
Heap::String * | insertString (const QString &s) |
Heap::Symbol * | insertSymbol (const QString &s) |
PropertyKey | asPropertyKey (const Heap::String *str) |
PropertyKey | asPropertyKey (const QV4::String *str) |
PropertyKey | asPropertyKey (const QString &s, KeyConversionBehavior conversionBehavior=Default) |
PropertyKey | asPropertyKeyImpl (const Heap::String *str) |
Heap::StringOrSymbol * | resolveId (PropertyKey i) const |
Heap::String * | stringForId (PropertyKey i) const |
Heap::Symbol * | symbolForId (PropertyKey i) const |
void | markObjects (MarkStack *markStack) |
void | sweep () |
void | addIdentifierHash (IdentifierHashData *h) |
void | removeIdentifierHash (IdentifierHashData *h) |
Public Attributes | |
ExecutionEngine * | engine |
uint | alloc |
uint | size |
int | numBits |
Heap::StringOrSymbol ** | entriesByHash |
Heap::StringOrSymbol ** | entriesById |
QSet< IdentifierHashData * > | idHashes |
Definition at line 27 of file qv4identifiertable_p.h.
Enumerator | |
---|---|
Default | |
ForceConversionToId |
Definition at line 58 of file qv4identifiertable_p.h.
QV4::IdentifierTable::IdentifierTable | ( | ExecutionEngine * | engine, |
int | numBits = 8 ) |
Definition at line 12 of file qv4identifiertable.cpp.
References alloc, entriesByHash, entriesById, numBits, and qPrimeForNumBits().
QV4::IdentifierTable::~IdentifierTable | ( | ) |
Definition at line 24 of file qv4identifiertable.cpp.
References entriesByHash, entriesById, and idHashes.
void QV4::IdentifierTable::addEntry | ( | Heap::StringOrSymbol * | str | ) |
Definition at line 32 of file qv4identifiertable.cpp.
References alloc, engine, entriesByHash, entriesById, QV4::PropertyKey::fromStringOrSymbol(), grow(), hash, i, QV4::PropertyKey::id(), QV4::Heap::StringOrSymbol::identifier, numBits, qPrimeForNumBits(), size, str, QV4::Heap::StringOrSymbol::stringHash, and QV4::Heap::StringOrSymbol::StringType_ArrayIndex.
Referenced by asPropertyKeyImpl(), and insertSymbol().
|
inline |
Definition at line 70 of file qv4identifiertable_p.h.
Referenced by QV4::IdentifierHashData::IdentifierHashData(), and QV4::IdentifierHashData::IdentifierHashData().
|
inline |
Definition at line 49 of file qv4identifiertable_p.h.
References str.
Referenced by QJSManagedValue::deleteProperty(), QJSManagedValue::hasOwnProperty(), QJSManagedValue::hasProperty(), QQmlPrivate::initObjectLookup(), QV4::ExecutableCompilationUnit::instantiate(), QV4::QQmlContextWrapper::lookupInParentContextHierarchy(), QJSManagedValue::property(), QV4::QQmlContextWrapper::resolveQmlContextPropertyLookupGetter(), QJSManagedValue::setProperty(), QV4::Object::virtualResolveLookupGetter(), and QV4::QQmlTypeWrapper::virtualResolveLookupGetter().
PropertyKey QV4::IdentifierTable::asPropertyKey | ( | const QString & | s, |
IdentifierTable::KeyConversionBehavior | conversionBehvior = Default ) |
Definition at line 255 of file qv4identifiertable.cpp.
References QV4::String::createHashValue(), QV4::String::createHashValueDisallowingArrayIndex(), ForceConversionToId, QV4::PropertyKey::fromArrayIndex(), hash, QV4::Heap::StringOrSymbol::identifier, Q_UNLIKELY, and QV4::Heap::StringOrSymbol::StringType_ArrayIndex.
|
inline |
Definition at line 54 of file qv4identifiertable_p.h.
References str.
PropertyKey QV4::IdentifierTable::asPropertyKeyImpl | ( | const Heap::String * | str | ) |
Definition at line 154 of file qv4identifiertable.cpp.
References addEntry(), alloc, engine, entriesByHash, QV4::PropertyKey::fromArrayIndex(), hash, QV4::WriteBarrier::markCustom(), str, and QV4::Heap::StringOrSymbol::StringType_ArrayIndex.
Heap::String * QV4::IdentifierTable::insertString | ( | const QString & | s | ) |
Definition at line 100 of file qv4identifiertable.cpp.
References QV4::String::createHashValue(), engine, QV4::PropertyKey::fromArrayIndex(), hash, QV4::ExecutionEngine::newString(), str, and QV4::Heap::StringOrSymbol::StringType_ArrayIndex.
Heap::Symbol * QV4::IdentifierTable::insertSymbol | ( | const QString & | s | ) |
Definition at line 131 of file qv4identifiertable.cpp.
References addEntry(), alloc, QV4::Symbol::create(), QV4::String::createHashValue(), engine, entriesByHash, hash, Q_ASSERT, and str.
Definition at line 212 of file qv4identifiertable.cpp.
References idHashes, and QV4::Heap::StringOrSymbol::markObjects().
Referenced by QV4::ExecutionEngine::markObjects().
|
inline |
Definition at line 73 of file qv4identifiertable_p.h.
Referenced by QV4::IdentifierHashData::~IdentifierHashData().
Heap::StringOrSymbol * QV4::IdentifierTable::resolveId | ( | PropertyKey | i | ) | const |
Definition at line 181 of file qv4identifiertable.cpp.
References alloc, engine, entriesById, i, QV4::Heap::StringOrSymbol::identifier, QV4::ExecutionEngine::newString(), and QString::number().
Referenced by stringForId(), and symbolForId().
Heap::String * QV4::IdentifierTable::stringForId | ( | PropertyKey | i | ) | const |
Definition at line 198 of file qv4identifiertable.cpp.
References i, Q_ASSERT, and resolveId().
void QV4::IdentifierTable::sweep | ( | ) |
Definition at line 218 of file qv4identifiertable.cpp.
References alloc, entriesByHash, entriesById, QV4::Heap::StringOrSymbol::hashValue(), i, QV4::PropertyKey::id(), QV4::Heap::StringOrSymbol::identifier, and QV4::Heap::Base::isMarked().
Referenced by QV4::MemoryManager::sweep().
Heap::Symbol * QV4::IdentifierTable::symbolForId | ( | PropertyKey | i | ) | const |
Definition at line 205 of file qv4identifiertable.cpp.
References i, Q_ASSERT, and resolveId().
Referenced by QV4::SymbolCtor::method_keyFor().
uint QV4::IdentifierTable::alloc |
Definition at line 31 of file qv4identifiertable_p.h.
Referenced by IdentifierTable(), addEntry(), asPropertyKeyImpl(), insertSymbol(), resolveId(), and sweep().
ExecutionEngine* QV4::IdentifierTable::engine |
Definition at line 29 of file qv4identifiertable_p.h.
Referenced by addEntry(), asPropertyKeyImpl(), insertString(), insertSymbol(), and resolveId().
Heap::StringOrSymbol** QV4::IdentifierTable::entriesByHash |
Definition at line 34 of file qv4identifiertable_p.h.
Referenced by IdentifierTable(), ~IdentifierTable(), addEntry(), asPropertyKeyImpl(), insertSymbol(), and sweep().
Heap::StringOrSymbol** QV4::IdentifierTable::entriesById |
Definition at line 35 of file qv4identifiertable_p.h.
Referenced by IdentifierTable(), ~IdentifierTable(), addEntry(), resolveId(), and sweep().
QSet<IdentifierHashData *> QV4::IdentifierTable::idHashes |
Definition at line 37 of file qv4identifiertable_p.h.
Referenced by ~IdentifierTable(), and markObjects().
int QV4::IdentifierTable::numBits |
Definition at line 33 of file qv4identifiertable_p.h.
Referenced by IdentifierTable(), and addEntry().
uint QV4::IdentifierTable::size |
Definition at line 32 of file qv4identifiertable_p.h.
Referenced by addEntry().