diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-01-03 13:19:15 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-01-31 17:09:26 +0000 |
commit | eeb08d9537d0b4e77b91848169e0bb79ec3d912c (patch) | |
tree | 9eddd4e394a86cda373e11eba36040647bbc8b02 /src/qml/qml/qqmltypeloader.cpp | |
parent | 27c678cea66e3ab092b6788b6e403c232677041f (diff) |
Re-do QML type compilation of ahead-of-time generated QML cache files
As we currently lack the ability to do type resolution at AOT cache
generation time, we need to re-do the work after loading the cache file,
making us essentially only re-use the code and avoiding the step of
parsing.
Change-Id: I12844692d4766345d8a313b59d21abf1f868e2d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 8dea866c9a..f4f04e12c0 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -2075,6 +2075,11 @@ bool QQmlTypeData::tryLoadFromDiskCache() } } + if (unit->data->flags & QV4::CompiledData::Unit::PendingTypeCompilation) { + restoreIR(unit); + return true; + } + m_compiledData = unit; for (int i = 0, count = m_compiledData->objectCount(); i < count; ++i) @@ -2397,6 +2402,15 @@ bool QQmlTypeData::loadFromSource() return true; } +void QQmlTypeData::restoreIR(QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit) +{ + m_document.reset(new QmlIR::Document(isDebugging())); + QmlIR::IRLoader loader(unit->data, m_document.data()); + loader.load(); + m_document->javaScriptCompilationUnit = unit; + continueLoadFromIR(); +} + void QQmlTypeData::continueLoadFromIR() { m_typeReferences.collectFromObjects(m_document->objects.constBegin(), m_document->objects.constEnd()); |