Make the Moth interpreter configurable

Change-Id: I2b784820c4e39a7932f81bfee9ce78e01a2e96b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Lars Knoll 2016-09-05 13:12:58 +02:00
parent e48c4134af
commit 11e0e5574a
8 changed files with 62 additions and 8 deletions

View File

@ -25,8 +25,6 @@ SOURCES += \
HEADERS += \ HEADERS += \
$$PWD/qqmltypecompiler_p.h \ $$PWD/qqmltypecompiler_p.h \
$$PWD/qv4isel_moth_p.h \
$$PWD/qv4instr_moth_p.h \
$$PWD/qqmlpropertycachecreator_p.h \ $$PWD/qqmlpropertycachecreator_p.h \
$$PWD/qqmlpropertyvalidator_p.h \ $$PWD/qqmlpropertyvalidator_p.h \
$$PWD/qv4compilationunitmapper_p.h $$PWD/qv4compilationunitmapper_p.h
@ -34,8 +32,6 @@ HEADERS += \
SOURCES += \ SOURCES += \
$$PWD/qqmltypecompiler.cpp \ $$PWD/qqmltypecompiler.cpp \
$$PWD/qv4instr_moth.cpp \
$$PWD/qv4isel_moth.cpp \
$$PWD/qqmlpropertycachecreator.cpp \ $$PWD/qqmlpropertycachecreator.cpp \
$$PWD/qqmlpropertyvalidator.cpp \ $$PWD/qqmlpropertyvalidator.cpp \
$$PWD/qv4compilationunitmapper.cpp $$PWD/qv4compilationunitmapper.cpp
@ -43,4 +39,14 @@ SOURCES += \
unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp
else: SOURCES += $$PWD/qv4compilationunitmapper_win.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
}
} }

View File

@ -50,12 +50,13 @@
// //
// We mean it. // We mean it.
// //
#include <private/qv4global_p.h>
#include <QtCore/qglobal.h>
#include <private/qv4value_p.h> #include <private/qv4value_p.h>
#include <private/qv4function_p.h> #include <private/qv4function_p.h>
#include <private/qv4runtime_p.h> #include <private/qv4runtime_p.h>
QT_REQUIRE_CONFIG(qml_interpreter);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifdef QT_NO_QML_DEBUGGER #ifdef QT_NO_QML_DEBUGGER

View File

@ -58,6 +58,8 @@
#include <private/qv4value_p.h> #include <private/qv4value_p.h>
#include "qv4instr_moth_p.h" #include "qv4instr_moth_p.h"
QT_REQUIRE_CONFIG(qml_interpreter);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace QV4 { namespace QV4 {

View File

@ -3,5 +3,28 @@
"depends": [ "depends": [
"core-private", "core-private",
"network-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"
]
}
] ]
} }

View File

@ -38,7 +38,6 @@ SOURCES += \
$$PWD/qv4sequenceobject.cpp \ $$PWD/qv4sequenceobject.cpp \
$$PWD/qv4include.cpp \ $$PWD/qv4include.cpp \
$$PWD/qv4qobjectwrapper.cpp \ $$PWD/qv4qobjectwrapper.cpp \
$$PWD/qv4vme_moth.cpp \
$$PWD/qv4arraybuffer.cpp \ $$PWD/qv4arraybuffer.cpp \
$$PWD/qv4typedarray.cpp \ $$PWD/qv4typedarray.cpp \
$$PWD/qv4dataview.cpp $$PWD/qv4dataview.cpp
@ -88,12 +87,18 @@ HEADERS += \
$$PWD/qv4sequenceobject_p.h \ $$PWD/qv4sequenceobject_p.h \
$$PWD/qv4include_p.h \ $$PWD/qv4include_p.h \
$$PWD/qv4qobjectwrapper_p.h \ $$PWD/qv4qobjectwrapper_p.h \
$$PWD/qv4vme_moth_p.h \
$$PWD/qv4profiling_p.h \ $$PWD/qv4profiling_p.h \
$$PWD/qv4arraybuffer_p.h \ $$PWD/qv4arraybuffer_p.h \
$$PWD/qv4typedarray_p.h \ $$PWD/qv4typedarray_p.h \
$$PWD/qv4dataview_p.h $$PWD/qv4dataview_p.h
qtConfig(qml-interpreter) {
HEADERS += \
$$PWD/qv4vme_moth_p.h
SOURCES += \
$$PWD/qv4vme_moth.cpp
}
} }

View File

@ -86,7 +86,9 @@
#include "qv4isel_masm_p.h" #include "qv4isel_masm_p.h"
#endif // V4_ENABLE_JIT #endif // V4_ENABLE_JIT
#if QT_CONFIG(qml_interpreter)
#include "qv4isel_moth_p.h" #include "qv4isel_moth_p.h"
#endif
#if USE(PTHREADS) #if USE(PTHREADS)
# include <pthread.h> # include <pthread.h>
@ -160,6 +162,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
MemoryManager::GCBlocker gcBlocker(memoryManager); MemoryManager::GCBlocker gcBlocker(memoryManager);
if (!factory) { if (!factory) {
#if QT_CONFIG(qml_interpreter)
bool jitDisabled = true; bool jitDisabled = true;
#ifdef V4_ENABLE_JIT #ifdef V4_ENABLE_JIT
@ -180,6 +183,9 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
"very slow. Visit https://wiki.qt.io/V4 to learn about possible " "very slow. Visit https://wiki.qt.io/V4 to learn about possible "
"solutions for your platform."); "solutions for your platform.");
} }
#else
factory = new JIT::ISelFactory;
#endif
} }
iselFactory.reset(factory); iselFactory.reset(factory);

View File

@ -51,9 +51,12 @@
// We mean it. // We mean it.
// //
#include <private/qv4global_p.h>
#include <private/qv4runtime_p.h> #include <private/qv4runtime_p.h>
#include <private/qv4instr_moth_p.h> #include <private/qv4instr_moth_p.h>
QT_REQUIRE_CONFIG(qml_interpreter);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace QV4 { namespace QV4 {

View File

@ -32,8 +32,10 @@
#include "private/qv4errorobject_p.h" #include "private/qv4errorobject_p.h"
#include "private/qv4globalobject_p.h" #include "private/qv4globalobject_p.h"
#include "private/qv4codegen_p.h" #include "private/qv4codegen_p.h"
#if QT_CONFIG(qml_interpreter)
#include "private/qv4isel_moth_p.h" #include "private/qv4isel_moth_p.h"
#include "private/qv4vme_moth_p.h" #include "private/qv4vme_moth_p.h"
#endif
#include "private/qv4objectproto_p.h" #include "private/qv4objectproto_p.h"
#include "private/qv4isel_p.h" #include "private/qv4isel_p.h"
#include "private/qv4mm_p.h" #include "private/qv4mm_p.h"
@ -43,6 +45,8 @@
#ifdef V4_ENABLE_JIT #ifdef V4_ENABLE_JIT
# include "private/qv4isel_masm_p.h" # include "private/qv4isel_masm_p.h"
#else
QT_REQUIRE_CONFIG(qml_interpreter);
#endif // V4_ENABLE_JIT #endif // V4_ENABLE_JIT
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
@ -150,10 +154,12 @@ int main(int argc, char *argv[])
args.removeFirst(); args.removeFirst();
} }
#if QT_CONFIG(qml_interpreter)
if (args.first() == QLatin1String("--interpret")) { if (args.first() == QLatin1String("--interpret")) {
mode = use_moth; mode = use_moth;
args.removeFirst(); args.removeFirst();
} }
#endif
if (args.first() == QLatin1String("--qml")) { if (args.first() == QLatin1String("--qml")) {
runAsQml = true; runAsQml = true;
@ -171,7 +177,9 @@ int main(int argc, char *argv[])
case use_moth: { case use_moth: {
QV4::EvalISelFactory* iSelFactory = 0; QV4::EvalISelFactory* iSelFactory = 0;
if (mode == use_moth) { if (mode == use_moth) {
#if QT_CONFIG(qml_interpreter)
iSelFactory = new QV4::Moth::ISelFactory; iSelFactory = new QV4::Moth::ISelFactory;
#endif
#ifdef V4_ENABLE_JIT #ifdef V4_ENABLE_JIT
} else { } else {
iSelFactory = new QV4::JIT::ISelFactory; iSelFactory = new QV4::JIT::ISelFactory;