aboutsummaryrefslogtreecommitdiffstats
path: root/src/v4/qv4engine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/v4/qv4engine.h')
-rw-r--r--src/v4/qv4engine.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/v4/qv4engine.h b/src/v4/qv4engine.h
index dad9db37ac..051c51f26e 100644
--- a/src/v4/qv4engine.h
+++ b/src/v4/qv4engine.h
@@ -203,11 +203,12 @@ struct Q_V4_EXPORT ExecutionEngine
CallContext *newCallContext(FunctionObject *f, const QQmlJS::VM::Value &thisObject, QQmlJS::VM::Value *args, int argc);
CallContext *newCallContext(void *stackSpace, FunctionObject *f, const QQmlJS::VM::Value &thisObject, QQmlJS::VM::Value *args, int argc);
ExecutionContext *pushGlobalContext();
+ void pushContext(SimpleCallContext *context);
ExecutionContext *popContext();
VM::Function *newFunction(const QString &name);
- FunctionObject *newBuiltinFunction(ExecutionContext *scope, String *name, Value (*code)(CallContext *));
+ FunctionObject *newBuiltinFunction(ExecutionContext *scope, String *name, Value (*code)(SimpleCallContext *));
FunctionObject *newBuiltinFunction(ExecutionContext *scope, String *name, Value (*code)(ExecutionContext *, Value, Value *, int));
FunctionObject *newScriptFunction(ExecutionContext *scope, VM::Function *function);
BoundFunction *newBoundFunction(ExecutionContext *scope, FunctionObject *target, Value boundThis, const QVector<Value> &boundArgs);
@@ -248,6 +249,16 @@ struct Q_V4_EXPORT ExecutionEngine
void ensureContextStackSize();
};
+inline void ExecutionEngine::pushContext(SimpleCallContext *context)
+{
+ ensureContextStackSize();
+ assert(contextStack[contextStackPosition + 1] == 0);
+
+ current = context;
+
+ contextStack[++contextStackPosition] = current;
+}
+
} // namespace VM
} // namespace QQmlJS