aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-01-15 10:28:20 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2016-01-20 08:58:06 +0000
commit68beab39a76d567e153e631838a067db8fb7a7c4 (patch)
treea71f9001aef9fa77b3ea0a9bdc4c7031f50b852d
parentde846aec97647862c98419a3f37a432031d9a245 (diff)
V4: Tweak "enable JIT" ifdefs.
- indentation, to make it readable - on arm64: only enable for Linux (but only after future testing!) - add CONFIG+=force-compile-jit handling so the JIT can be compiled/used even on platforms that don't officially support it (like iOS, where it works if you run from Xcode). This is done for debugging purposes. Change-Id: I8611ba409e10305f480463a16d88bc854b1c218a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--src/3rdparty/masm/masm-defs.pri4
-rw-r--r--src/qml/jit/qv4targetplatform_p.h4
-rw-r--r--src/qml/jsruntime/qv4global_p.h27
3 files changed, 22 insertions, 13 deletions
diff --git a/src/3rdparty/masm/masm-defs.pri b/src/3rdparty/masm/masm-defs.pri
index bfcccfeeaa..c4c7d3ce9a 100644
--- a/src/3rdparty/masm/masm-defs.pri
+++ b/src/3rdparty/masm/masm-defs.pri
@@ -30,6 +30,10 @@ disassembler {
DEFINES += WTF_USE_UDIS86=0
}
+force-compile-jit {
+ DEFINES += V4_FORCE_COMPILE_JIT
+}
+
INCLUDEPATH += $$PWD/disassembler
INCLUDEPATH += $$PWD/disassembler/udis86
INCLUDEPATH += $$_OUT_PWD
diff --git a/src/qml/jit/qv4targetplatform_p.h b/src/qml/jit/qv4targetplatform_p.h
index 878c1dd9fd..80a18a7f5b 100644
--- a/src/qml/jit/qv4targetplatform_p.h
+++ b/src/qml/jit/qv4targetplatform_p.h
@@ -82,7 +82,7 @@ namespace JIT {
class TargetPlatform
{
public:
-#if CPU(X86) && (OS(LINUX) || OS(WINDOWS) || OS(QNX) || OS(FREEBSD))
+#if CPU(X86) && (OS(LINUX) || OS(WINDOWS) || OS(QNX) || OS(FREEBSD) || defined(Q_OS_IOS))
enum { RegAllocIsSupported = 1 };
static const JSC::MacroAssembler::RegisterID FramePointerRegister = JSC::X86Registers::ebp;
@@ -151,7 +151,7 @@ public:
#endif // Windows on x86
-#if CPU(X86_64) && (OS(LINUX) || OS(MAC_OS_X) || OS(FREEBSD))
+#if CPU(X86_64) && (OS(LINUX) || OS(MAC_OS_X) || OS(FREEBSD) || defined(Q_OS_IOS))
enum { RegAllocIsSupported = 1 };
static const JSC::MacroAssembler::RegisterID FramePointerRegister = JSC::X86Registers::ebp;
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index 99ba1ec81c..b0850a9db3 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -93,22 +93,22 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); }
#if defined(Q_PROCESSOR_X86) && !defined(__ILP32__) \
&& (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_QNX) || defined(Q_OS_FREEBSD))
-#define V4_ENABLE_JIT
+# define V4_ENABLE_JIT
#elif defined(Q_PROCESSOR_X86_64) && !defined(__ILP32__) \
&& (defined(Q_OS_WIN) || defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_FREEBSD))
-#define V4_ENABLE_JIT
+# define V4_ENABLE_JIT
#elif defined(Q_PROCESSOR_ARM_32)
-
-#if defined(thumb2) || defined(__thumb2__) || ((defined(__thumb) || defined(__thumb__)) && __TARGET_ARCH_THUMB-0 == 4)
-#define V4_ENABLE_JIT
-#elif defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2 // clang 3.5 and later will set this if the core supports the Thumb-2 ISA.
-#define V4_ENABLE_JIT
-#endif
-
+# if defined(thumb2) || defined(__thumb2__) || ((defined(__thumb) || defined(__thumb__)) && __TARGET_ARCH_THUMB-0 == 4)
+# define V4_ENABLE_JIT
+# elif defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2 // clang 3.5 and later will set this if the core supports the Thumb-2 ISA.
+# define V4_ENABLE_JIT
+# endif
#elif defined(Q_PROCESSOR_ARM_64)
-#define V4_ENABLE_JIT // iOS is disabled below.
+# if defined(Q_OS_LINUX) && 0 // TODO: test on Linux/aarch64 before enabling this
+# define V4_ENABLE_JIT
+# endif
#elif defined(Q_PROCESSOR_MIPS_32) && defined(Q_OS_LINUX)
-#define V4_ENABLE_JIT
+# define V4_ENABLE_JIT
#endif
// Black list some platforms
@@ -118,6 +118,11 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); }
#endif
#endif
+// For debug purposes: add CONFIG+=force-compile-jit to qmake's command-line to always compile the JIT.
+#if defined(V4_FORCE_COMPILE_JIT) && !defined(V4_ENABLE_JIT)
+# define V4_ENABLE_JIT
+#endif
+
// Do certain things depending on whether the JIT is enabled or disabled
#ifdef V4_ENABLE_JIT