diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-03 15:23:05 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-09 02:01:17 +0100 |
commit | 412eb94de4cae754130ae855236420ebd5c42482 (patch) | |
tree | 901af6051691c65a96abe3f69fcd3d5fc57ff80a /src/qml/jsruntime/qv4debugging.cpp | |
parent | e367f75d7285d2bcd10cbb35d088c96f33c02aff (diff) |
Simplify & speed up function calling
Get rid of the SimpleCallContext, instead simply
use the CallContext data structure, but don't
initialize the unused variables.
Change-Id: I11b311986da180c62c815b516a2c55844156d0ab
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4debugging.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4debugging.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index a9fc050483..0d2a9225da 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -125,7 +125,8 @@ Debugger::ExecutionState Debugger::currentExecutionState(const uchar *code) cons QV4::ExecutionContext *context = m_engine->current; QV4::Function *function = 0; - if (CallContext *callCtx = context->asCallContext()) + CallContext *callCtx = context->asCallContext(); + if (callCtx && callCtx->function) function = callCtx->function->function; else { Q_ASSERT(context->type == QV4::ExecutionContext::Type_GlobalContext); @@ -230,7 +231,8 @@ void Debugger::convert(ValueRef v, QVariant *varValue, VarInfo::Type *type) cons static CallContext *findContext(ExecutionContext *ctxt, int frame) { while (ctxt) { - if (CallContext *cCtxt = ctxt->asCallContext()) { + CallContext *cCtxt = ctxt->asCallContext(); + if (cCtxt && cCtxt->function) { if (frame < 1) return cCtxt; --frame; @@ -299,9 +301,10 @@ QList<Debugger::VarInfo> Debugger::retrieveLocalsFromContext(const QStringList & if (frame < 0) return args; - CallContext *ctxt = findContext(m_engine->current, frame); - if (!ctxt) + CallContext *sctxt = findContext(m_engine->current, frame); + if (!sctxt || sctxt->type < ExecutionContext::Type_SimpleCallContext) return args; + CallContext *ctxt = static_cast<CallContext *>(sctxt); Scope scope(m_engine); ScopedValue v(scope); |