diff options
Diffstat (limited to 'src/qml/jsruntime/qv4internalclass.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4internalclass.cpp | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp index 2f69defd5b..d17da9af0c 100644 --- a/src/qml/jsruntime/qv4internalclass.cpp +++ b/src/qml/jsruntime/qv4internalclass.cpp @@ -101,20 +101,6 @@ void PropertyHash::addEntry(const PropertyHash::Entry &entry, int classSize) ++d->size; } -uint PropertyHash::lookup(const Identifier *identifier) const -{ - Q_ASSERT(d->entries); - - uint idx = identifier->hashValue % d->alloc; - while (1) { - if (d->entries[idx].identifier == identifier) - return d->entries[idx].index; - if (!d->entries[idx].identifier) - return UINT_MAX; - ++idx; - idx %= d->alloc; - } -} InternalClass::InternalClass(ExecutionEngine *engine) : engine(engine) @@ -364,18 +350,6 @@ void InternalClass::removeMember(Object *object, Identifier *id) Q_ASSERT(t.lookup); } -uint InternalClass::find(const String *string) -{ - engine->identifierTable->identifier(string); - const Identifier *id = string->d()->identifier; - - uint index = propertyTable.lookup(id); - if (index < size) - return index; - - return UINT_MAX; -} - uint InternalClass::find(const Identifier *id) { uint index = propertyTable.lookup(id); @@ -433,11 +407,13 @@ InternalClass *InternalClass::propertiesFrozen() const void InternalClass::destroy() { - QList<InternalClass *> destroyStack; - destroyStack.append(this); + std::vector<InternalClass *> destroyStack; + destroyStack.reserve(64); + destroyStack.push_back(this); - while (!destroyStack.isEmpty()) { - InternalClass *next = destroyStack.takeLast(); + while (!destroyStack.empty()) { + InternalClass *next = destroyStack.back(); + destroyStack.pop_back(); if (!next->engine) continue; next->engine = 0; @@ -445,13 +421,13 @@ void InternalClass::destroy() next->nameMap.~SharedInternalClassData<Identifier *>(); next->propertyData.~SharedInternalClassData<PropertyAttributes>(); if (next->m_sealed) - destroyStack.append(next->m_sealed); + destroyStack.push_back(next->m_sealed); if (next->m_frozen) - destroyStack.append(next->m_frozen); + destroyStack.push_back(next->m_frozen); for (size_t i = 0; i < next->transitions.size(); ++i) { Q_ASSERT(next->transitions.at(i).lookup); - destroyStack.append(next->transitions.at(i).lookup); + destroyStack.push_back(next->transitions.at(i).lookup); } next->transitions.~vector<Transition>(); |