aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_debugger
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-24 16:47:48 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-15 19:12:40 +0000
commitfb52dab6b41ddd6955cb14e1474f90ee5333dac9 (patch)
treea6cfe97160f1f9b1b48ba35977b13e6bdce52b47 /src/plugins/qmltooling/qmldbg_debugger
parentda705f4036356a3203957c2a7852fa396227fc78 (diff)
Further cleanups
Reduce usage of ScopedContext. Change-Id: I84a6a7478065de3398fd0b21596ca1308e78ceb3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_debugger')
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp18
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h4
2 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index f788a0a217..db8c1feb92 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -43,14 +43,14 @@
QT_BEGIN_NAMESPACE
-QV4::Heap::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engine, int frame)
+QV4::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engine, int frame)
{
QV4::ExecutionContext *ctx = engine->currentContext;
while (ctx) {
QV4::CallContext *cCtxt = ctx->asCallContext();
if (cCtxt && cCtxt->d()->function) {
if (frame < 1)
- return cCtxt->d();
+ return cCtxt;
--frame;
}
ctx = engine->parentContext(ctx);
@@ -59,12 +59,12 @@ QV4::Heap::CallContext *QV4DataCollector::findContext(QV4::ExecutionEngine *engi
return 0;
}
-QV4::Heap::CallContext *QV4DataCollector::findScope(QV4::Heap::ExecutionContext *ctxt, int scope)
+QV4::Heap::CallContext *QV4DataCollector::findScope(QV4::ExecutionContext *ctxt, int scope)
{
if (!ctxt)
return 0;
- QV4::Scope s(ctxt->engine);
+ QV4::Scope s(ctxt->d()->engine);
QV4::ScopedContext ctx(s, ctxt);
for (; scope > 0 && ctx; --scope)
ctx = ctx->d()->outer;
@@ -78,11 +78,11 @@ QVector<QV4::Heap::ExecutionContext::ContextType> QV4DataCollector::getScopeType
QVector<QV4::Heap::ExecutionContext::ContextType> types;
QV4::Scope scope(engine);
- QV4::Scoped<QV4::CallContext> sctxt(scope, findContext(engine, frame));
+ QV4::CallContext *sctxt = findContext(engine, frame);
if (!sctxt || sctxt->d()->type < QV4::Heap::ExecutionContext::Type_QmlContext)
return types;
- QV4::ScopedContext it(scope, sctxt->d());
+ QV4::ScopedContext it(scope, sctxt);
for (; it; it = it->d()->outer)
types.append(it->d()->type);
@@ -379,8 +379,7 @@ void ArgumentCollectJob::run()
QV4::Scope scope(engine);
QV4::Scoped<QV4::CallContext> ctxt(
- scope, QV4DataCollector::findScope(
- QV4DataCollector::findContext(engine, frameNr), scopeNr));
+ scope, QV4DataCollector::findScope(QV4DataCollector::findContext(engine, frameNr), scopeNr));
if (!ctxt)
return;
@@ -412,8 +411,7 @@ void LocalCollectJob::run()
QV4::Scope scope(engine);
QV4::Scoped<QV4::CallContext> ctxt(
- scope, QV4DataCollector::findScope(
- QV4DataCollector::findContext(engine, frameNr), scopeNr));
+ scope, QV4DataCollector::findScope(QV4DataCollector::findContext(engine, frameNr), scopeNr));
if (!ctxt)
return;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
index f8cd0c1508..fb78c1614a 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.h
@@ -45,8 +45,8 @@ public:
typedef uint Ref;
typedef QVector<uint> Refs;
- static QV4::Heap::CallContext *findContext(QV4::ExecutionEngine *engine, int frame);
- static QV4::Heap::CallContext *findScope(QV4::Heap::ExecutionContext *ctxt, int scope);
+ static QV4::CallContext *findContext(QV4::ExecutionEngine *engine, int frame);
+ static QV4::Heap::CallContext *findScope(QV4::ExecutionContext *ctxt, int scope);
static QVector<QV4::Heap::ExecutionContext::ContextType> getScopeTypes(
QV4::ExecutionEngine *engine, int frame);