diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-16 13:06:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-17 11:06:18 +0000 |
commit | 4b2b1fc12137450d34e8324c0dbe2af1e90b9e6a (patch) | |
tree | 9e397602b5f584032cdc29354c0fcf485766cce2 /src/qml/jsruntime/qv4engine_p.h | |
parent | 29e4b97bad6511ebd6aa009a47594395957c0e8e (diff) |
Add support for compiling ES modules ahead of time
This is also pretty straight-forward by adding .mjs as supported
extension in the qmake and cmake support.
This also tweaks qv4engine.cpp to share the same module compilation
function across all code paths.
Change-Id: Ia0e23c78a794f2330ecf8f991ee6ea948f4ac89d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index c8f8efaebf..7608c04800 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -55,6 +55,8 @@ #include "qv4context_p.h" #include <private/qintrusivelist_p.h> #include "qv4enginebase_p.h" +#include <private/qqmlrefcount_p.h> +#include <private/qqmljsengine_p.h> #ifndef V4_BOOTSTRAP # include "qv4function_p.h" @@ -575,10 +577,10 @@ public: double localTZA = 0.0; // local timezone, initialized at startup + static QQmlRefPointer<CompiledData::CompilationUnit> compileModule(bool debugMode, const QString &url, const QString &sourceCode, const QDateTime &sourceTimeStamp, QList<QQmlJS::DiagnosticMessage> *diagnostics); #ifndef V4_BOOTSTRAP QQmlRefPointer<CompiledData::CompilationUnit> compileModule(const QUrl &url); QQmlRefPointer<CompiledData::CompilationUnit> compileModule(const QUrl &url, const QString &sourceCode, const QDateTime &sourceTimeStamp); - static QQmlRefPointer<CompiledData::CompilationUnit> compileModule(bool debugMode, const QUrl &url, const QString &sourceCode, const QDateTime &sourceTimeStamp, QList<QQmlJS::DiagnosticMessage> *diagnostics); mutable QMutex moduleMutex; QHash<QUrl, QQmlRefPointer<CompiledData::CompilationUnit>> modules; |