diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-21 14:52:15 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | 29f946cdad013d759aad05cbd22f40d0c152d6f3 (patch) | |
tree | 122bcf437d9c9f55bd5dabab7f0a278e440f339c /src/qml/jsruntime/qv4functionobject_p.h | |
parent | ac1d0075a8a379de1aa31a588c7b86ce0813e48c (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/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 71691ba1c4..89e2b14ca7 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -121,6 +121,8 @@ struct Q_QML_EXPORT FunctionObject: Object { return vtbl->call(this, thisObject, args, argc); } + static FunctionObject *creatScriptFunction(ExecutionContext *scope, Function *function); + protected: static const ManagedVTable static_vtbl; static void markObjects(Managed *that); @@ -199,6 +201,16 @@ protected: static const ManagedVTable static_vtbl; }; +struct SimpleScriptFunction: FunctionObject { + SimpleScriptFunction(ExecutionContext *scope, Function *function); + + static Value construct(Managed *, Value *args, int argc); + static Value call(Managed *that, const Value &, Value *, int); + +protected: + static const ManagedVTable static_vtbl; +}; + struct BoundFunction: FunctionObject { FunctionObject *target; Value boundThis; |