aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-12-21 13:25:11 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-01-10 11:22:29 +0100
commitcfdc612c3022b3f35545fd5e4e0bcd2661f657f1 (patch)
tree9630e15a9e8ea709cb8e1a9a0f004f1f7c785e7e /src/qml/common
parentd85de8da6011731e3ff31ae1361e71fecaedb0be (diff)
QtQml: Make base CU a member of ExecutableCompilationUnit
We want to re-use the base compilation unit across engines. For that to work it cannot be a slice of the engine-specific ExecutableCompilationUnit. Since CompiledData::CompilationUnit is refcounted on its own now, make it unmovable. Change-Id: I8418c9754d7a07e5210c1e7a7fc69355e1d57807 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/common')
-rw-r--r--src/qml/common/qv4compileddata_p.h32
1 files changed, 4 insertions, 28 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h
index f033a43aaa..82424c1c9d 100644
--- a/src/qml/common/qv4compileddata_p.h
+++ b/src/qml/common/qv4compileddata_p.h
@@ -30,7 +30,9 @@
#endif
#include <private/qendian_p.h>
+#include <private/qqmlrefcount_p.h>
#include <private/qv4staticvalue_p.h>
+
#include <functional>
#include <limits.h>
@@ -1421,9 +1423,9 @@ using DependentTypesHasher = std::function<QByteArray()>;
// This is how this hooks into the existing structures:
-struct CompilationUnit
+struct CompilationUnit final : public QQmlRefCounted<CompilationUnit>
{
- Q_DISABLE_COPY(CompilationUnit)
+ Q_DISABLE_COPY_MOVE(CompilationUnit)
const Unit *data = nullptr;
const QmlUnit *qmlData = nullptr;
@@ -1465,32 +1467,6 @@ public:
#endif
}
- CompilationUnit(CompilationUnit &&other) noexcept
- {
- *this = std::move(other);
- }
-
- CompilationUnit &operator=(CompilationUnit &&other) noexcept
- {
- if (this != &other) {
- data = other.data;
- other.data = nullptr;
- qmlData = other.qmlData;
- other.qmlData = nullptr;
- dynamicStrings = std::move(other.dynamicStrings);
- other.dynamicStrings.clear();
- aotCompiledFunctions = other.aotCompiledFunctions;
- other.aotCompiledFunctions = nullptr;
- constants = other.constants;
- other.constants = nullptr;
- m_fileName = std::move(other.m_fileName);
- other.m_fileName.clear();
- m_finalUrlString = std::move(other.m_finalUrlString);
- other.m_finalUrlString.clear();
- }
- return *this;
- }
-
const Unit *unitData() const { return data; }
void setUnitData(const Unit *unitData, const QmlUnit *qmlUnit = nullptr,