aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-08-21 14:52:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-02 17:27:36 +0200
commit29f946cdad013d759aad05cbd22f40d0c152d6f3 (patch)
tree122bcf437d9c9f55bd5dabab7f0a278e440f339c /src/qml/jsruntime/qv4context_p.h
parentac1d0075a8a379de1aa31a588c7b86ce0813e48c (diff)
Add a SimpleScriptFunction class
Choose whether we use a stack based context for a function, when the actual closure is generated, not at call time. This speeds up function calling for leaf functions. Change-Id: Ibcbf3acb5610a7f59b6474e982122df03c1c5298 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4context_p.h')
-rw-r--r--src/qml/jsruntime/qv4context_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 07937541e2..dc2370f38d 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -113,6 +113,7 @@ struct Q_QML_EXPORT ExecutionContext
}
CallContext *newCallContext(void *stackSpace, FunctionObject *f, const QV4::Value &thisObject, QV4::Value *args, int argc);
+ CallContext *newCallContext(FunctionObject *f, const QV4::Value &thisObject, QV4::Value *args, int argc);
String * const *formals() const;
@@ -212,6 +213,8 @@ inline const CallContext *ExecutionContext::asCallContext() const
/* Function *f, int argc */
#define requiredMemoryForExecutionContect(f, argc) \
sizeof(CallContext) + sizeof(Value) * (f->varCount + qMax((uint)argc, f->formalParameterCount))
+#define requiredMemoryForExecutionContectSimple(f) \
+ sizeof(CallContext) + sizeof(Value) * f->varCount
#define requiredMemoryForQmlExecutionContect(f) \
sizeof(CallContext) + sizeof(Value) * (f->locals.size())
#define stackContextSize (sizeof(CallContext) + 32*sizeof(Value))