diff options
-rw-r--r-- | src/qml/compiler/compiler.pri | 14 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 5 | ||||
-rw-r--r-- | src/qml/compiler/qv4isel_moth_p.h | 2 | ||||
-rw-r--r-- | src/qml/configure.json | 23 | ||||
-rw-r--r-- | src/qml/jsruntime/jsruntime.pri | 9 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth_p.h | 3 | ||||
-rw-r--r-- | tools/qmljs/qmljs.cpp | 8 |
8 files changed, 62 insertions, 8 deletions
diff --git a/src/qml/compiler/compiler.pri b/src/qml/compiler/compiler.pri index e49f5c40a5..a63de67b4c 100644 --- a/src/qml/compiler/compiler.pri +++ b/src/qml/compiler/compiler.pri @@ -25,8 +25,6 @@ SOURCES += \ HEADERS += \ $$PWD/qqmltypecompiler_p.h \ - $$PWD/qv4isel_moth_p.h \ - $$PWD/qv4instr_moth_p.h \ $$PWD/qqmlpropertycachecreator_p.h \ $$PWD/qqmlpropertyvalidator_p.h \ $$PWD/qv4compilationunitmapper_p.h @@ -34,8 +32,6 @@ HEADERS += \ SOURCES += \ $$PWD/qqmltypecompiler.cpp \ - $$PWD/qv4instr_moth.cpp \ - $$PWD/qv4isel_moth.cpp \ $$PWD/qqmlpropertycachecreator.cpp \ $$PWD/qqmlpropertyvalidator.cpp \ $$PWD/qv4compilationunitmapper.cpp @@ -43,4 +39,14 @@ SOURCES += \ unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp else: SOURCES += $$PWD/qv4compilationunitmapper_win.cpp +qtConfig(qml-interpreter) { + HEADERS += \ + $$PWD/qv4instr_moth_p.h \ + $$PWD/qv4isel_moth_p.h + SOURCES += \ + $$PWD/qv4instr_moth.cpp \ + $$PWD/qv4isel_moth.cpp +} + + } diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index beb43376ee..b83bcdb83b 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -50,12 +50,13 @@ // // We mean it. // - -#include <QtCore/qglobal.h> +#include <private/qv4global_p.h> #include <private/qv4value_p.h> #include <private/qv4function_p.h> #include <private/qv4runtime_p.h> +QT_REQUIRE_CONFIG(qml_interpreter); + QT_BEGIN_NAMESPACE #ifdef QT_NO_QML_DEBUGGER diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index c304284cbc..74323a2912 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -58,6 +58,8 @@ #include <private/qv4value_p.h> #include "qv4instr_moth_p.h" +QT_REQUIRE_CONFIG(qml_interpreter); + QT_BEGIN_NAMESPACE namespace QV4 { diff --git a/src/qml/configure.json b/src/qml/configure.json index 34b83ba9ff..b3a7f9d8f2 100644 --- a/src/qml/configure.json +++ b/src/qml/configure.json @@ -3,5 +3,28 @@ "depends": [ "core-private", "network-private" + ], + + "commandline": { + "options": { + "qml-interpreter": "boolean" + } + }, + + "features": { + "qml-interpreter": { + "label": "QML interpreter", + "purpose": "Support for the QML interpreter", + "output": [ "privateFeature" ] + } + }, + + "summary": [ + { + "section": "Qt QML", + "entries": [ + "qml-interpreter" + ] + } ] } diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri index e72b06359e..dcc04cbd54 100644 --- a/src/qml/jsruntime/jsruntime.pri +++ b/src/qml/jsruntime/jsruntime.pri @@ -38,7 +38,6 @@ SOURCES += \ $$PWD/qv4sequenceobject.cpp \ $$PWD/qv4include.cpp \ $$PWD/qv4qobjectwrapper.cpp \ - $$PWD/qv4vme_moth.cpp \ $$PWD/qv4arraybuffer.cpp \ $$PWD/qv4typedarray.cpp \ $$PWD/qv4dataview.cpp @@ -88,12 +87,18 @@ HEADERS += \ $$PWD/qv4sequenceobject_p.h \ $$PWD/qv4include_p.h \ $$PWD/qv4qobjectwrapper_p.h \ - $$PWD/qv4vme_moth_p.h \ $$PWD/qv4profiling_p.h \ $$PWD/qv4arraybuffer_p.h \ $$PWD/qv4typedarray_p.h \ $$PWD/qv4dataview_p.h +qtConfig(qml-interpreter) { + HEADERS += \ + $$PWD/qv4vme_moth_p.h + SOURCES += \ + $$PWD/qv4vme_moth.cpp +} + } diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index f630dfaee0..a9284f2e69 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -86,7 +86,9 @@ #include "qv4isel_masm_p.h" #endif // V4_ENABLE_JIT +#if QT_CONFIG(qml_interpreter) #include "qv4isel_moth_p.h" +#endif #if USE(PTHREADS) # include <pthread.h> @@ -160,6 +162,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) MemoryManager::GCBlocker gcBlocker(memoryManager); if (!factory) { +#if QT_CONFIG(qml_interpreter) bool jitDisabled = true; #ifdef V4_ENABLE_JIT @@ -180,6 +183,9 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) "very slow. Visit https://wiki.qt.io/V4 to learn about possible " "solutions for your platform."); } +#else + factory = new JIT::ISelFactory; +#endif } iselFactory.reset(factory); diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h index cd8d335f1c..f8893509d9 100644 --- a/src/qml/jsruntime/qv4vme_moth_p.h +++ b/src/qml/jsruntime/qv4vme_moth_p.h @@ -51,9 +51,12 @@ // We mean it. // +#include <private/qv4global_p.h> #include <private/qv4runtime_p.h> #include <private/qv4instr_moth_p.h> +QT_REQUIRE_CONFIG(qml_interpreter); + QT_BEGIN_NAMESPACE namespace QV4 { diff --git a/tools/qmljs/qmljs.cpp b/tools/qmljs/qmljs.cpp index e9454c0f8d..b4ffc9be16 100644 --- a/tools/qmljs/qmljs.cpp +++ b/tools/qmljs/qmljs.cpp @@ -32,8 +32,10 @@ #include "private/qv4errorobject_p.h" #include "private/qv4globalobject_p.h" #include "private/qv4codegen_p.h" +#if QT_CONFIG(qml_interpreter) #include "private/qv4isel_moth_p.h" #include "private/qv4vme_moth_p.h" +#endif #include "private/qv4objectproto_p.h" #include "private/qv4isel_p.h" #include "private/qv4mm_p.h" @@ -43,6 +45,8 @@ #ifdef V4_ENABLE_JIT # include "private/qv4isel_masm_p.h" +#else +QT_REQUIRE_CONFIG(qml_interpreter); #endif // V4_ENABLE_JIT #include <QtCore/QCoreApplication> @@ -150,10 +154,12 @@ int main(int argc, char *argv[]) args.removeFirst(); } +#if QT_CONFIG(qml_interpreter) if (args.first() == QLatin1String("--interpret")) { mode = use_moth; args.removeFirst(); } +#endif if (args.first() == QLatin1String("--qml")) { runAsQml = true; @@ -171,7 +177,9 @@ int main(int argc, char *argv[]) case use_moth: { QV4::EvalISelFactory* iSelFactory = 0; if (mode == use_moth) { +#if QT_CONFIG(qml_interpreter) iSelFactory = new QV4::Moth::ISelFactory; +#endif #ifdef V4_ENABLE_JIT } else { iSelFactory = new QV4::JIT::ISelFactory; |