diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-23 23:27:14 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-02 19:29:47 +0000 |
commit | f1703895e2fc9ec5da3a38a3ffef927a8f4ed86c (patch) | |
tree | d5bc803ce71530f0c762f82f0a73ae04cfcbc03f | |
parent | 56bff8f7abc2f0eeadd4d197667132af6eed6f3a (diff) |
Rename IdentifierTable methods
identifier -> asPropertyKey
Change-Id: I4e6f33bdad12e901303ec6101dd2b8d6b0e99ac4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4function.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4identifier.cpp | 8 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4identifiertable.cpp | 8 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4identifiertable_p.h | 14 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4string.cpp | 2 |
7 files changed, 24 insertions, 24 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 773659b431..02aee47eea 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -160,7 +160,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine) const CompiledData::JSClassMember *member = data->jsClassAt(i, &memberCount); runtimeClasses[i] = engine->internalClasses(QV4::ExecutionEngine::Class_Object); for (int j = 0; j < memberCount; ++j, ++member) - runtimeClasses[i] = runtimeClasses[i]->addMember(engine->identifierTable->identifier(runtimeStrings[member->nameOffset]), member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data); + runtimeClasses[i] = runtimeClasses[i]->addMember(engine->identifierTable->asPropertyKey(runtimeStrings[member->nameOffset]), member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data); } } @@ -392,7 +392,7 @@ void CompilationUnit::linkBackendToEngine(ExecutionEngine *engine) // first locals const quint32_le *localsIndices = compiledBlock->localsTable(); for (quint32 i = 0; i < compiledBlock->nLocals; ++i) - ic = ic->addMember(engine->identifierTable->identifier(runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); + ic = ic->addMember(engine->identifierTable->asPropertyKey(runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); runtimeBlocks[i] = ic->d(); } } diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index f5fdc97d4f..7883961746 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -66,11 +66,11 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, // first locals const quint32_le *localsIndices = compiledFunction->localsTable(); for (quint32 i = 0; i < compiledFunction->nLocals; ++i) - ic = ic->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); + ic = ic->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); const quint32_le *formalsIndices = compiledFunction->formalsTable(); for (quint32 i = 0; i < compiledFunction->nFormals; ++i) - ic = ic->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[formalsIndices[i]]), Attr_NotConfigurable); + ic = ic->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[formalsIndices[i]]), Attr_NotConfigurable); internalClass = ic->d(); nFormals = compiledFunction->nFormals; @@ -114,7 +114,7 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr // first locals const quint32_le *localsIndices = compiledFunction->localsTable(); for (quint32 i = 0; i < compiledFunction->nLocals; ++i) - internalClass = internalClass->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); + internalClass = internalClass->addMember(engine->identifierTable->asPropertyKey(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); Scope scope(engine); ScopedString arg(scope); diff --git a/src/qml/jsruntime/qv4identifier.cpp b/src/qml/jsruntime/qv4identifier.cpp index fb2e9c29c2..5db5bd46ec 100644 --- a/src/qml/jsruntime/qv4identifier.cpp +++ b/src/qml/jsruntime/qv4identifier.cpp @@ -162,7 +162,7 @@ const IdentifierHashEntry *IdentifierHash::lookup(const QString &str) const if (!d) return nullptr; - PropertyKey id = d->identifierTable->identifier(str); + PropertyKey id = d->identifierTable->asPropertyKey(str); return lookup(id); } @@ -170,7 +170,7 @@ const IdentifierHashEntry *IdentifierHash::lookup(String *str) const { if (!d) return nullptr; - PropertyKey id = d->identifierTable->identifier(str); + PropertyKey id = d->identifierTable->asPropertyKey(str); if (id.isValid()) return lookup(id); return lookup(str->toQString()); @@ -179,13 +179,13 @@ const IdentifierHashEntry *IdentifierHash::lookup(String *str) const const PropertyKey IdentifierHash::toIdentifier(const QString &str) const { Q_ASSERT(d); - return d->identifierTable->identifier(str); + return d->identifierTable->asPropertyKey(str); } const PropertyKey IdentifierHash::toIdentifier(Heap::String *str) const { Q_ASSERT(d); - return d->identifierTable->identifier(str); + return d->identifierTable->asPropertyKey(str); } QString QV4::IdentifierHash::findId(int value) const diff --git a/src/qml/jsruntime/qv4identifiertable.cpp b/src/qml/jsruntime/qv4identifiertable.cpp index f6e0ef330a..c1457b2769 100644 --- a/src/qml/jsruntime/qv4identifiertable.cpp +++ b/src/qml/jsruntime/qv4identifiertable.cpp @@ -190,7 +190,7 @@ Heap::Symbol *IdentifierTable::insertSymbol(const QString &s) } -PropertyKey IdentifierTable::identifierImpl(const Heap::String *str) +PropertyKey IdentifierTable::asPropertyKeyImpl(const Heap::String *str) { if (str->identifier.isValid()) return str->identifier; @@ -306,17 +306,17 @@ void IdentifierTable::sweep() size -= freed; } -PropertyKey IdentifierTable::identifier(const QString &s) +PropertyKey IdentifierTable::asPropertyKey(const QString &s) { return insertString(s)->identifier; } -PropertyKey IdentifierTable::identifier(const char *s, int len) +PropertyKey IdentifierTable::asPropertyKey(const char *s, int len) { uint subtype; uint hash = String::createHashValue(s, len, &subtype); if (hash == UINT_MAX) - return identifier(QString::fromUtf8(s, len)); + return asPropertyKey(QString::fromUtf8(s, len)); QLatin1String latin(s, len); uint idx = hash % alloc; diff --git a/src/qml/jsruntime/qv4identifiertable_p.h b/src/qml/jsruntime/qv4identifiertable_p.h index 9d9f7c02cf..4f1656dddf 100644 --- a/src/qml/jsruntime/qv4identifiertable_p.h +++ b/src/qml/jsruntime/qv4identifiertable_p.h @@ -82,19 +82,19 @@ public: Heap::String *insertString(const QString &s); Heap::Symbol *insertSymbol(const QString &s); - PropertyKey identifier(const Heap::String *str) { + PropertyKey asPropertyKey(const Heap::String *str) { if (str->identifier.isValid()) return str->identifier; - return identifierImpl(str); + return asPropertyKeyImpl(str); } - PropertyKey identifier(const QV4::String *str) { - return identifier(str->d()); + PropertyKey asPropertyKey(const QV4::String *str) { + return asPropertyKey(str->d()); } - PropertyKey identifier(const QString &s); - PropertyKey identifier(const char *s, int len); + PropertyKey asPropertyKey(const QString &s); + PropertyKey asPropertyKey(const char *s, int len); - PropertyKey identifierImpl(const Heap::String *str); + PropertyKey asPropertyKeyImpl(const Heap::String *str); Heap::StringOrSymbol *resolveId(PropertyKey i) const; Q_QML_PRIVATE_EXPORT Heap::String *stringForId(PropertyKey i) const; diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index 446af3f9ef..daa5b2dfbd 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -70,7 +70,7 @@ void Lookup::resolveProtoGetter(PropertyKey name, const Heap::Object *proto) ReturnedValue Lookup::resolveGetter(ExecutionEngine *engine, const Object *object) { Heap::Object *obj = object->d(); - PropertyKey name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); + PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); if (name.isArrayIndex()) { indexedLookup.index = name.asArrayIndex(); getter = getterIndexed; @@ -131,7 +131,7 @@ ReturnedValue Lookup::resolvePrimitiveGetter(ExecutionEngine *engine, const Valu primitiveLookup.proto = engine->numberPrototype()->d(); } - PropertyKey name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); + PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); protoLookup.protoId = primitiveLookup.proto->internalClass->protoId; resolveProtoGetter(name, primitiveLookup.proto); @@ -145,7 +145,7 @@ ReturnedValue Lookup::resolvePrimitiveGetter(ExecutionEngine *engine, const Valu ReturnedValue Lookup::resolveGlobalGetter(ExecutionEngine *engine) { Object *o = engine->globalObject; - PropertyKey name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); + PropertyKey name = engine->identifierTable->asPropertyKey(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); protoLookup.protoId = o->internalClass()->protoId; resolveProtoGetter(name, o->d()); diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index 7c1aef482a..cd8b1b6da1 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -171,7 +171,7 @@ void String::createPropertyKeyImpl() const if (!d()->text) d()->simplifyString(); Q_ASSERT(d()->text); - engine()->identifierTable->identifier(this); + engine()->identifierTable->asPropertyKey(this); } void Heap::String::simplifyString() const |