diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-08-21 14:55:53 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-09-15 07:37:08 +0000 |
commit | 7dab89a65ef859ef1982d5b882cb74a0a34e53a9 (patch) | |
tree | 496f65fb6c0c6d158facca02bf83944269874a77 /src/qml/jsruntime/qv4engine_p.h | |
parent | b5902bd43a3b45a25e3b960b20c3c1ecb41073fe (diff) |
Cleanup the ExecutionContextSaver
Always operate on the current context (as that's what we do
in practice anyway).
Change-Id: I4171207a7a86e69aa685754956c0764ac6e152a7
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 8f1047a373..09cde6a957 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -348,6 +348,7 @@ public: void enableProfiler(); Heap::ExecutionContext *pushGlobalContext(); + void pushContext(Heap::ExecutionContext *context); void pushContext(CallContext *context); Heap::ExecutionContext *popContext(); @@ -441,13 +442,19 @@ public: void assertObjectBelongsToEngine(const Heap::Base &baseObject); }; +inline void ExecutionEngine::pushContext(Heap::ExecutionContext *context) +{ + Q_ASSERT(current && context); + context->parent = current; + current = context; +} + inline void ExecutionEngine::pushContext(CallContext *context) { - Q_ASSERT(current && context && context->d()); - context->d()->parent = current; - current = context->d(); + pushContext(context->d()); } + inline Heap::ExecutionContext *ExecutionEngine::popContext() { Q_ASSERT(current->parent); @@ -467,7 +474,7 @@ Heap::ExecutionContext::ExecutionContext(ExecutionEngine *engine, ContextType t) , strictMode(false) , lineNumber(-1) { - engine->current = this; + engine->pushContext(this); } |