aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4scopedvalue_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 5e3e71a30f..26b15838f3 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -371,6 +371,25 @@ struct ScopedCallData {
CallData *ptr;
};
+struct ScopedStackFrame {
+ Scope &scope;
+ EngineBase::StackFrame frame;
+
+ ScopedStackFrame(Scope &scope, Heap::ExecutionContext *context)
+ : scope(scope)
+ {
+ frame.parent = scope.engine->currentStackFrame;
+ if (!context)
+ return;
+ frame.jsFrame = reinterpret_cast<EngineBase::JSStackFrame *>(scope.alloc(sizeof(EngineBase::JSStackFrame)/sizeof(Value)));
+ frame.jsFrame->context = context;
+ frame.v4Function = frame.parent ? frame.parent->v4Function : 0;
+ scope.engine->currentStackFrame = &frame;
+ }
+ ~ScopedStackFrame() {
+ scope.engine->currentStackFrame = frame.parent;
+ }
+};
inline Value &Value::operator =(const ScopedValue &v)
{
@@ -399,25 +418,6 @@ struct ScopedProperty
Property *property;
};
-struct ExecutionContextSaver
-{
- ExecutionEngine *engine;
- ExecutionContext *savedContext;
-
- ExecutionContextSaver(ExecutionEngine *engine)
- : engine(engine)
- {
- savedContext = engine->currentContext;
- }
- ~ExecutionContextSaver()
- {
- Q_ASSERT(engine->jsStackTop > engine->currentContext);
- engine->currentContext = savedContext;
- engine->current = savedContext->d();
- }
-};
-
-
}
QT_END_NAMESPACE