aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4global_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4global_p.h')
-rw-r--r--src/qml/jsruntime/qv4global_p.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index 3569247459..2050ccd746 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -64,6 +64,37 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); }
#define qOffsetOf(s, m) ((size_t)((((char *)&(((s *)64)->m)) - 64)))
+// Decide whether to enable or disable the JIT
+
+// White list architectures
+
+#if defined(Q_PROCESSOR_X86)
+#define V4_ENABLE_JIT
+#elif defined(Q_PROCESSOR_X86_64)
+#define V4_ENABLE_JIT
+#elif defined(Q_PROCESSOR_ARM_32) && __TARGET_ARCH_THUMB-0 == 4
+#define V4_ENABLE_JIT
+#endif
+
+// Black list some platforms
+#if defined(V4_ENABLE_JIT)
+#if defined(Q_OS_WINCE) || defined(Q_OS_IOS) || defined(Q_OS_WIN64)
+ #undef V4_ENABLE_JIT
+#endif
+#endif
+
+// Do certain things depending on whether the JIT is enabled or disabled
+
+#ifdef V4_ENABLE_JIT
+#define ENABLE_YARR_JIT 1
+#define ENABLE_JIT 1
+#define ENABLE_ASSEMBLER 1
+#else
+#define ENABLE_YARR_JIT 0
+#define ENABLE_ASSEMBLER 0
+#define ENABLE_JIT 0
+#endif
+
#if defined(Q_OS_QNX)
#include <math.h>
#undef isnan