aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-24 09:36:19 +0200
committerLars Knoll <lars.knoll@theqtcompany.com>2015-09-15 07:37:14 +0000
commitfb059f697a128f87ceecf5ddff1dd735ae78db20 (patch)
tree93ca45c213ef29fbc03b9f2d1a0d011b94ba1405 /src/qml/jsruntime/qv4context.cpp
parentcedd73279403244bbf4b74da4c3ec60111e60399 (diff)
Reduce usage of context->parent
Change-Id: I31bb8019783311a7e6065e2aac7fec67c1120ebf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index b1aaf06e80..57c791e6a8 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -85,12 +85,12 @@ Heap::CallContext *ExecutionContext::newCallContext(const FunctionObject *functi
Heap::WithContext *ExecutionContext::newWithContext(Object *with)
{
- return d()->engine->memoryManager->alloc<WithContext>(d()->engine, with);
+ return d()->engine->memoryManager->alloc<WithContext>(d(), with);
}
Heap::CatchContext *ExecutionContext::newCatchContext(String *exceptionVarName, const Value &exceptionValue)
{
- return d()->engine->memoryManager->alloc<CatchContext>(d()->engine, exceptionVarName, exceptionValue);
+ return d()->engine->memoryManager->alloc<CatchContext>(d(), exceptionVarName, exceptionValue);
}
Heap::QmlContext *ExecutionContext::newQmlContext(QmlContextWrapper *qml)
@@ -150,38 +150,38 @@ Heap::GlobalContext::GlobalContext(ExecutionEngine *eng)
global = eng->globalObject->d();
}
-Heap::WithContext::WithContext(ExecutionEngine *engine, QV4::Object *with)
- : Heap::ExecutionContext(engine, Heap::ExecutionContext::Type_WithContext)
+Heap::WithContext::WithContext(ExecutionContext *outerContext, QV4::Object *with)
+ : Heap::ExecutionContext(outerContext->engine, Heap::ExecutionContext::Type_WithContext)
{
- callData = parent->callData;
- outer = parent;
- lookups = parent->lookups;
- compilationUnit = parent->compilationUnit;
+ outer = outerContext;
+ callData = outer->callData;
+ lookups = outer->lookups;
+ compilationUnit = outer->compilationUnit;
withObject = with ? with->d() : 0;
}
-Heap::CatchContext::CatchContext(ExecutionEngine *engine, QV4::String *exceptionVarName, const Value &exceptionValue)
- : Heap::ExecutionContext(engine, Heap::ExecutionContext::Type_CatchContext)
+Heap::CatchContext::CatchContext(ExecutionContext *outerContext, QV4::String *exceptionVarName, const Value &exceptionValue)
+ : Heap::ExecutionContext(outerContext->engine, Heap::ExecutionContext::Type_CatchContext)
{
- strictMode = parent->strictMode;
- callData = parent->callData;
- outer = parent;
- lookups = parent->lookups;
- compilationUnit = parent->compilationUnit;
+ outer = outerContext;
+ strictMode = outer->strictMode;
+ callData = outer->callData;
+ lookups = outer->lookups;
+ compilationUnit = outer->compilationUnit;
this->exceptionVarName = exceptionVarName->d();
this->exceptionValue = exceptionValue;
}
-Heap::QmlContext::QmlContext(QV4::ExecutionContext *outer, QV4::QmlContextWrapper *qml)
- : Heap::ExecutionContext(outer->engine(), Heap::ExecutionContext::Type_QmlContext)
+Heap::QmlContext::QmlContext(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml)
+ : Heap::ExecutionContext(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext)
{
+ outer = outerContext->d();
strictMode = false;
- callData = parent->callData;
- this->outer = outer->d();
- lookups = parent->lookups;
- compilationUnit = parent->compilationUnit;
+ callData = outer->callData;
+ lookups = outer->lookups;
+ compilationUnit = outer->compilationUnit;
this->qml = qml->d();
}
@@ -546,7 +546,7 @@ Heap::FunctionObject *ExecutionContext::getFunctionObject() const
{
Scope scope(d()->engine);
ScopedContext it(scope, this->d());
- for (; it; it = it->d()->parent) {
+ for (; it; it = it->d()->outer) {
if (const CallContext *callCtx = it->asCallContext())
return callCtx->d()->function;
else if (it->asCatchContext() || it->asWithContext())