diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-16 12:58:48 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-01-02 19:48:43 +0100 |
commit | 344f09bb98eba8e9add3cab2d72cc0fe029ec4d3 (patch) | |
tree | 05d0d395e437184b264147bf80612b4f36fe33f1 /src/qml/jsruntime/qv4script.cpp | |
parent | 3c2c53f0ba8995a50bbf44220f95f9cd93f58821 (diff) |
QtQml: Allow more fine grained control of the disk cache
You can now enable and disable the AOT-compiled code and the loading and
saving of .qmlc files separately.
Fixes: QTBUG-101358
Change-Id: I1305c4f2f75d8cff544a127e956589d1ed1aeb52
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index c72e1c4e19..395409ad4b 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -188,9 +188,16 @@ Script *Script::createFromFileOrCache(ExecutionEngine *engine, QmlContext *qmlCo error->clear(); QQmlMetaType::CachedUnitLookupError cacheError = QQmlMetaType::CachedUnitLookupError::NoError; - if (const QQmlPrivate::CachedQmlUnit *cachedUnit = engine->diskCacheEnabled() - ? QQmlMetaType::findCachedCompilationUnit(originalUrl, &cacheError) - : nullptr) { + const ExecutionEngine::DiskCacheOptions options = engine->diskCacheOptions(); + if (const QQmlPrivate::CachedQmlUnit *cachedUnit + = (options & ExecutionEngine::DiskCache::Aot) + ? QQmlMetaType::findCachedCompilationUnit( + originalUrl, + (options & ExecutionEngine::DiskCache::AotByteCode) + ? QQmlMetaType::AcceptUntyped + : QQmlMetaType::RequireFullyTyped, + &cacheError) + : nullptr) { QQmlRefPointer<QV4::ExecutableCompilationUnit> jsUnit = QV4::ExecutableCompilationUnit::create( QV4::CompiledData::CompilationUnit(cachedUnit->qmlData, cachedUnit->aotCompiledFunctions)); |