aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4executablecompilationunit.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-01-08 12:56:38 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-01-13 16:03:58 +0100
commitc225e23e00bc539daefa357f687fe4a1b51ade9f (patch)
tree0cbb680ae5171ab0c84effd88af02d5b7bb3369a /src/qml/jsruntime/qv4executablecompilationunit.cpp
parent21cf48781655e03c099e54f180f78e7435367386 (diff)
QtQml: Move ResolvedTypeReference into base CU
Change-Id: I25063457aad3a6d29a8c2a5b236f9a51b56a2f51 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp')
-rw-r--r--src/qml/jsruntime/qv4executablecompilationunit.cpp41
1 files changed, 3 insertions, 38 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp
index 14444c6ed4..ffd8b787e1 100644
--- a/src/qml/jsruntime/qv4executablecompilationunit.cpp
+++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp
@@ -268,9 +268,6 @@ void ExecutableCompilationUnit::clear()
typeNameCache.reset();
- qDeleteAll(resolvedTypes);
- resolvedTypes.clear();
-
delete [] runtimeLookups;
runtimeLookups = nullptr;
@@ -391,7 +388,7 @@ void ExecutableCompilationUnit::finalizeCompositeType(const QQmlType &type)
QQmlMetaType::registerInternalCompositeType(this);
} else {
const QV4::CompiledData::Object *obj = objectAt(/*root object*/0);
- auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex);
+ auto *typeRef = m_compilationUnit->resolvedTypes.value(obj->inheritedTypeNameIndex);
Q_ASSERT(typeRef);
if (const auto compilationUnit = typeRef->compilationUnit())
qmlType = compilationUnit->qmlType;
@@ -435,7 +432,7 @@ void ExecutableCompilationUnit::finalizeCompositeType(const QQmlType &type)
m_compilationUnit->inlineComponentData[lastICRootName].totalBindingCount
+= obj->nBindings;
- if (auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex)) {
+ if (auto *typeRef = m_compilationUnit->resolvedTypes.value(obj->inheritedTypeNameIndex)) {
const auto type = typeRef->type();
if (type.isValid() && type.parserStatusCast() != -1)
++m_compilationUnit->inlineComponentData[lastICRootName].totalParserStatusCount;
@@ -463,7 +460,7 @@ void ExecutableCompilationUnit::finalizeCompositeType(const QQmlType &type)
continue;
bindingCount += obj->nBindings;
- if (auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex)) {
+ if (auto *typeRef = m_compilationUnit->resolvedTypes.value(obj->inheritedTypeNameIndex)) {
const auto type = typeRef->type();
if (type.isValid() && type.parserStatusCast() != -1)
++parserStatusCount;
@@ -495,15 +492,6 @@ int ExecutableCompilationUnit::totalObjectCount() const {
return m_compilationUnit->inlineComponentData[*icRootName()].totalObjectCount;
}
-ResolvedTypeReference *ExecutableCompilationUnit::resolvedType(QMetaType type) const
-{
- for (ResolvedTypeReference *ref : std::as_const(resolvedTypes)) {
- if (ref->type().typeId() == type)
- return ref;
- }
- return nullptr;
-}
-
int ExecutableCompilationUnit::totalParserStatusCount() const {
if (!m_compilationUnit->icRootName)
return m_totalParserStatusCount;
@@ -854,29 +842,6 @@ void ExecutableCompilationUnit::evaluateModuleRequests()
}
}
-/*!
- \internal
- This function creates a temporary key vector and sorts it to guarantuee a stable
- hash. This is used to calculate a check-sum on dependent meta-objects.
- */
-bool ResolvedTypeReferenceMap::addToHash(
- QCryptographicHash *hash, QHash<quintptr, QByteArray> *checksums) const
-{
- std::vector<int> keys (size());
- int i = 0;
- for (auto it = constBegin(), end = constEnd(); it != end; ++it) {
- keys[i] = it.key();
- ++i;
- }
- std::sort(keys.begin(), keys.end());
- for (int key: keys) {
- if (!this->operator[](key)->addToHash(hash, checksums))
- return false;
- }
-
- return true;
-}
-
QString ExecutableCompilationUnit::bindingValueAsString(const CompiledData::Binding *binding) const
{
#if QT_CONFIG(translation)