aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-23 10:40:41 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-31 05:13:48 +0000
commite56eeee9902ffc341506040e637654b2b0451209 (patch)
treeb316f49506739e96e85dfe25bb7759703bcb95f7 /src/qml/compiler/qv4compileddata_p.h
parent4ac9cf78969436dae456c8fec4a0a706a3d65ec4 (diff)
Encapsulate the unit data in CompilationUnit
This allows updating the constants table when the unit data is set / changes and removes the tie to the engine. Change-Id: Ice553650390589e30e18421c4e55422a55d0df89 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r--src/qml/compiler/qv4compileddata_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 5103c6901e..31e83e8f76 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -982,7 +982,6 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnitBase
QV4::Heap::String **runtimeStrings = nullptr; // Array
const Value* constants = nullptr;
QV4::Value *runtimeRegularExpressions = nullptr;
- const Unit *data = nullptr;
QV4::Heap::InternalClass **runtimeClasses = nullptr;
};
@@ -993,6 +992,7 @@ Q_STATIC_ASSERT(offsetof(CompilationUnitBase, runtimeRegularExpressions) == offs
struct Q_QML_PRIVATE_EXPORT CompilationUnit final : public CompilationUnitBase
{
+ const Unit *data = nullptr;
public:
CompilationUnit(const Unit *unitData = nullptr);
#ifdef V4_BOOTSTRAP
@@ -1019,7 +1019,10 @@ public:
}
// Called only when building QML, when we build the header for JS first and append QML data
- QV4::CompiledData::Unit *createUnitData(QmlIR::Document *irDocument);
+ Unit *createUnitData(QmlIR::Document *irDocument);
+
+ const Unit *unitData() const { return data; }
+ void setUnitData(const Unit *unitData);
#ifndef V4_BOOTSTRAP
QIntrusiveListNode nextCompilationUnit;