From cfdc612c3022b3f35545fd5e4e0bcd2661f657f1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 21 Dec 2023 13:25:11 +0100 Subject: 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 --- src/qml/common/qv4compileddata_p.h | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'src/qml/common') 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 +#include #include + #include #include @@ -1421,9 +1423,9 @@ using DependentTypesHasher = std::function; // This is how this hooks into the existing structures: -struct CompilationUnit +struct CompilationUnit final : public QQmlRefCounted { - 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, -- cgit v1.2.3