aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-11-23 11:34:27 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2017-12-14 09:24:03 +0000
commit6793683b165bca058e4bd9ee1b3beac8cff12b9d (patch)
treea3d4b875bd7a5f98d67cd5a870ceb7e756c9f63c /src/qml/jsruntime/qv4engine_p.h
parenta1fd2866465c4be2815a6ada776867b3d4efc557 (diff)
V4: Only start JITting after a minimum of 3 calls
Change-Id: I748e06041f3085980ce48391ba2d829a9d86a727 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r--src/qml/jsruntime/qv4engine_p.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 346f290feb..61efe0c41e 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -56,7 +56,9 @@
#include <private/qintrusivelist_p.h>
#include "qv4enginebase_p.h"
+
#ifndef V4_BOOTSTRAP
+# include "qv4function_p.h"
# include <private/qv8engine_p.h>
# include <private/qv4compileddata_p.h>
#endif
@@ -85,6 +87,7 @@ namespace CompiledData {
struct CompilationUnit;
}
+struct Function;
struct InternalClass;
struct InternalClassPool;
@@ -481,13 +484,22 @@ public:
bool checkStackLimits();
- static bool canJIT();
+ bool canJIT(Function *f)
+ {
+#if defined(V4_ENABLE_JIT) && !defined(V4_BOOTSTRAP)
+ return f->interpreterCallCount > jitCallCountThreshold;
+#else
+ Q_UNUSED(f);
+ return false;
+#endif
+ }
private:
#if QT_CONFIG(qml_debug)
QScopedPointer<QV4::Debugging::Debugger> m_debugger;
QScopedPointer<QV4::Profiling::Profiler> m_profiler;
#endif
+ int jitCallCountThreshold;
};
// This is a trick to tell the code generators that functions taking a NoThrowContext won't