From 3b14e2ffdd8eb4b7f7f4508768b75f2acc399370 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 9 Sep 2016 15:37:57 +0200 Subject: QML: Make Heap::Object and all subclasses trivial GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann --- tools/qmljs/qmljs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/qmljs') diff --git a/tools/qmljs/qmljs.cpp b/tools/qmljs/qmljs.cpp index 964afc265b..e9454c0f8d 100644 --- a/tools/qmljs/qmljs.cpp +++ b/tools/qmljs/qmljs.cpp @@ -61,9 +61,9 @@ using namespace QV4; struct Print: FunctionObject { struct Data : Heap::FunctionObject { - Data(ExecutionContext *scope) - : Heap::FunctionObject(scope, QStringLiteral("print")) + void init(ExecutionContext *scope) { + Heap::FunctionObject::init(scope, QStringLiteral("print")); } }; V4_OBJECT(FunctionObject) @@ -86,9 +86,9 @@ DEFINE_OBJECT_VTABLE(Print); struct GC: public FunctionObject { struct Data : Heap::FunctionObject { - Data(ExecutionContext *scope) - : Heap::FunctionObject(scope, QStringLiteral("gc")) + void init(ExecutionContext *scope) { + Heap::FunctionObject::init(scope, QStringLiteral("gc")); } }; -- cgit v1.2.3 From 11e0e5574a529e337e43ab15fca357b109ea2834 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 5 Sep 2016 13:12:58 +0200 Subject: Make the Moth interpreter configurable Change-Id: I2b784820c4e39a7932f81bfee9ce78e01a2e96b5 Reviewed-by: Oswald Buddenhagen Reviewed-by: Simon Hausmann --- tools/qmljs/qmljs.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/qmljs') 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 @@ -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; -- cgit v1.2.3