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 += \
$$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
}
}

View File

@ -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

View File

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

View File

@ -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"
]
}
]
}

View File

@ -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
}
}

View File

@ -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);

View File

@ -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 {

View File

@ -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;