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/qv4engine_p.h | |
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/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 57aa7a782c..86e580db88 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -139,6 +139,20 @@ private: friend struct ExecutionContext; friend struct Heap::ExecutionContext; public: + enum class DiskCache { + Disabled = 0, + AotByteCode = 1 << 0, + AotNative = 1 << 1, + QmlcRead = 1 << 2, + QmlcWrite = 1 << 3, + Aot = AotByteCode | AotNative, + Qmlc = QmlcRead | QmlcWrite, + Enabled = Aot | Qmlc, + + }; + + Q_DECLARE_FLAGS(DiskCacheOptions, DiskCache); + ExecutableAllocator *executableAllocator; ExecutableAllocator *regExpAllocator; @@ -735,7 +749,7 @@ public: Module moduleForUrl(const QUrl &_url, const ExecutableCompilationUnit *referrer = nullptr) const; Module loadModule(const QUrl &_url, const ExecutableCompilationUnit *referrer = nullptr); - bool diskCacheEnabled() const; + DiskCacheOptions diskCacheOptions() const; void callInContext(QV4::Function *function, QObject *self, QV4::ExecutionContext *ctxt, int argc, void **args, QMetaType *types); @@ -886,6 +900,8 @@ inline bool ExecutionEngine::checkStackLimits() return false; } +Q_DECLARE_OPERATORS_FOR_FLAGS(ExecutionEngine::DiskCacheOptions); + } // namespace QV4 QT_END_NAMESPACE |