aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-02-05 16:12:16 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-05 18:29:02 +0100
commitd89e2698669db83f0b3591ac43f054aacc8bfc85 (patch)
treee3739bc79f8b1b4dfb10c3587b8b3c69f20bc142 /src/qml/jsruntime/qv4vme_moth.cpp
parenta83444c1370a75733c47bd4f87a5a1248ab983c6 (diff)
Smaller performance fixes
Move commonly used variables in the ExecutionEngine to the beginning of the struct to increase cache locality. Keep the engine pointer in a register in the interpreter to save one memory load per instruction. Change-Id: If2540c66b62685701511f410aff495c0a20ca694 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 22fe4968a2..5f079a7d05 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -150,12 +150,12 @@ Param traceParam(const Param &param)
#define STOREVALUE(param, value) { \
QV4::ReturnedValue tmp = (value); \
- if (context->engine->hasException) \
+ if (engine->hasException) \
goto catchException; \
VALUE(param) = tmp; \
}
#define CHECK_EXCEPTION \
- if (context->engine->hasException) \
+ if (engine->hasException) \
goto catchException
QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
@@ -183,7 +183,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
const uchar *exceptionHandler = 0;
- QV4::Debugging::Debugger *debugger = context->engine->debugger;
+ QV4::ExecutionEngine *engine = context->engine;
#ifdef DO_TRACE_INSTR
qDebug("Starting VME with context=%p and code=%p", context, code);
@@ -658,6 +658,7 @@ QV4::ReturnedValue VME::run(QV4::ExecutionContext *context, const uchar *code,
MOTH_END_INSTR(Ret)
MOTH_BEGIN_INSTR(Debug)
+ QV4::Debugging::Debugger *debugger = context->engine->debugger;
if (debugger && (instr.breakPoint || debugger->pauseAtNextOpportunity()))
debugger->maybeBreakAtInstruction(code, instr.breakPoint);
MOTH_END_INSTR(Debug)