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>.
Loading...
Searching...
No Matches
QV4::IdentifierTable Struct Reference

#include <qv4identifiertable_p.h>

+ Collaboration diagram for QV4::IdentifierTable:

Public Types

enum  KeyConversionBehavior { Default , ForceConversionToId }
 

Public Member Functions

void addEntry (Heap::StringOrSymbol *str)
 
 IdentifierTable (ExecutionEngine *engine, int numBits=8)
 
 ~IdentifierTable ()
 
Heap::StringinsertString (const QString &s)
 
Heap::SymbolinsertSymbol (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::StringOrSymbolresolveId (PropertyKey i) const
 
Heap::StringstringForId (PropertyKey i) const
 
Heap::SymbolsymbolForId (PropertyKey i) const
 
void markObjects (MarkStack *markStack)
 
void sweep ()
 
void addIdentifierHash (IdentifierHashData *h)
 
void removeIdentifierHash (IdentifierHashData *h)
 

Public Attributes

ExecutionEngineengine
 
uint alloc
 
uint size
 
int numBits
 
Heap::StringOrSymbol ** entriesByHash
 
Heap::StringOrSymbol ** entriesById
 
QSet< IdentifierHashData * > idHashes
 

Detailed Description

Definition at line 27 of file qv4identifiertable_p.h.

Member Enumeration Documentation

◆ KeyConversionBehavior

Enumerator
Default 
ForceConversionToId 

Definition at line 58 of file qv4identifiertable_p.h.

Constructor & Destructor Documentation

◆ IdentifierTable()

QV4::IdentifierTable::IdentifierTable ( ExecutionEngine * engine,
int numBits = 8 )

Definition at line 12 of file qv4identifiertable.cpp.

References alloc, entriesByHash, entriesById, numBits, and qPrimeForNumBits().

+ Here is the call graph for this function:

◆ ~IdentifierTable()

QV4::IdentifierTable::~IdentifierTable ( )

Definition at line 24 of file qv4identifiertable.cpp.

References entriesByHash, entriesById, and idHashes.

Member Function Documentation

◆ addEntry()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addIdentifierHash()

void QV4::IdentifierTable::addIdentifierHash ( IdentifierHashData * h)
inline

Definition at line 70 of file qv4identifiertable_p.h.

Referenced by QV4::IdentifierHashData::IdentifierHashData(), and QV4::IdentifierHashData::IdentifierHashData().

+ Here is the caller graph for this function:

◆ asPropertyKey() [1/3]

◆ asPropertyKey() [2/3]

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.

+ Here is the call graph for this function:

◆ asPropertyKey() [3/3]

PropertyKey QV4::IdentifierTable::asPropertyKey ( const QV4::String * str)
inline

Definition at line 54 of file qv4identifiertable_p.h.

References str.

◆ asPropertyKeyImpl()

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.

+ Here is the call graph for this function:

◆ insertString()

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.

+ Here is the call graph for this function:

◆ insertSymbol()

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.

+ Here is the call graph for this function:

◆ markObjects()

void QV4::IdentifierTable::markObjects ( MarkStack * markStack)

Definition at line 212 of file qv4identifiertable.cpp.

References idHashes, and QV4::Heap::StringOrSymbol::markObjects().

Referenced by QV4::ExecutionEngine::markObjects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeIdentifierHash()

void QV4::IdentifierTable::removeIdentifierHash ( IdentifierHashData * h)
inline

Definition at line 73 of file qv4identifiertable_p.h.

Referenced by QV4::IdentifierHashData::~IdentifierHashData().

+ Here is the caller graph for this function:

◆ resolveId()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stringForId()

Heap::String * QV4::IdentifierTable::stringForId ( PropertyKey i) const

Definition at line 198 of file qv4identifiertable.cpp.

References i, Q_ASSERT, and resolveId().

+ Here is the call graph for this function:

◆ sweep()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ symbolForId()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ alloc

uint QV4::IdentifierTable::alloc

◆ engine

ExecutionEngine* QV4::IdentifierTable::engine

◆ entriesByHash

Heap::StringOrSymbol** QV4::IdentifierTable::entriesByHash

◆ entriesById

Heap::StringOrSymbol** QV4::IdentifierTable::entriesById

Definition at line 35 of file qv4identifiertable_p.h.

Referenced by IdentifierTable(), ~IdentifierTable(), addEntry(), resolveId(), and sweep().

◆ idHashes

QSet<IdentifierHashData *> QV4::IdentifierTable::idHashes

Definition at line 37 of file qv4identifiertable_p.h.

Referenced by ~IdentifierTable(), and markObjects().

◆ numBits

int QV4::IdentifierTable::numBits

Definition at line 33 of file qv4identifiertable_p.h.

Referenced by IdentifierTable(), and addEntry().

◆ size

uint QV4::IdentifierTable::size

Definition at line 32 of file qv4identifiertable_p.h.

Referenced by addEntry().


The documentation for this struct was generated from the following files: