diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-11-28 09:31:10 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-19 16:30:19 +0100 |
commit | da2b7576daa58ad2881e41ad6f0f85ec55db4fd2 (patch) | |
tree | 1bb0dcfd7011f87aa1c238174205ce79c66273b6 /src/qml/jsruntime/qv4engine_p.h | |
parent | 45f77a6bfc05b97e6312a379c63840243b5815f3 (diff) |
Return Heap::ExecutionContext for currentContext()
Change-Id: I155ab996e24d7f36761d2ea62a04774e16469b34
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 813b5fce5b..bb5d1c543b 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -73,8 +73,8 @@ private: friend struct ExecutionContext; friend struct Heap::ExecutionContext; public: - ExecutionContext *current; - ExecutionContext *currentContext() const { return current; } + Heap::ExecutionContext *current; + Heap::ExecutionContext *currentContext() const { return current; } Value *jsStackTop; quint32 hasException; @@ -272,7 +272,7 @@ public: ExecutionContext *pushGlobalContext(); void pushContext(CallContext *context); - ExecutionContext *popContext(); + Heap::ExecutionContext *popContext(); Heap::Object *newObject(); Heap::Object *newObject(InternalClass *internalClass, Object *prototype); @@ -354,17 +354,16 @@ private: inline void ExecutionEngine::pushContext(CallContext *context) { - Q_ASSERT(current && current->d() && context && context->d()); - context->d()->parent = current->d(); - current = context; + Q_ASSERT(current && context && context->d()); + context->d()->parent = current; + current = context->d(); } -inline ExecutionContext *ExecutionEngine::popContext() +inline Heap::ExecutionContext *ExecutionEngine::popContext() { - Q_ASSERT(current->d()->parent); - // ### GC - current = reinterpret_cast<ExecutionContext *>(current->d()->parent); - Q_ASSERT(current && current->d()); + Q_ASSERT(current->parent); + current = current->parent; + Q_ASSERT(current); return current; } @@ -374,14 +373,13 @@ Heap::ExecutionContext::ExecutionContext(ExecutionEngine *engine, ContextType t) , type(t) , strictMode(false) , engine(engine) - , parent(engine->currentContext()->d()) + , parent(engine->currentContext()) , outer(0) , lookups(0) , compilationUnit(0) , lineNumber(-1) { - // ### GC - engine->current = reinterpret_cast<QV4::ExecutionContext *>(this); + engine->current = this; } |