diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-06 11:46:01 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-06-17 09:06:01 +0000 |
commit | 8a33d37006e8ad9010fe076105ada9f1ca5d9871 (patch) | |
tree | 37e95149dce4f164c495157b9fb1b78ff756dab4 /src/qml/compiler/qv4compileddata_p.h | |
parent | 0dfd0a1c09e36bb80c575c097ea6a5809df5e640 (diff) |
Added basic support for saving compilation units to disk
Hidden behind a QML_DISK_CACHE=1 environment variable we will now attempt to
save a binary representation of the type compilation for Foo.qml next to it called
Foo.qmlc.
Change-Id: I27e800b50cdb186669256fd277578ea1f1e70513
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.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 10bc01e883..b960901402 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE +class QIODevice; class QQmlPropertyCache; class QQmlPropertyData; class QQmlTypeNameCache; @@ -207,6 +208,11 @@ struct Function quint32 dependingScopePropertiesOffset; // Array of int pairs (property index and notify index) // Qml Extensions End + // Absolute offset into file where the code for this function is located. Only used when the function + // is serialized. + quint64 codeOffset; + quint64 codeSize; + // quint32 formalsIndex[nFormals] // quint32 localsIndex[nLocals] // quint32 offsetForInnerFunctions[nInnerFunctions] @@ -830,8 +836,13 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public QQmlRefCount void markObjects(QV4::ExecutionEngine *e); void destroy() Q_DECL_OVERRIDE; + + bool saveToDisk(QString *errorString); + protected: virtual void linkBackendToEngine(QV4::ExecutionEngine *engine) = 0; + virtual void prepareCodeOffsetsForDiskStorage(CompiledData::Unit *unit); + virtual bool saveCodeToDisk(QIODevice *device, const CompiledData::Unit *unit, QString *errorString); #endif // V4_BOOTSTRAP }; |