diff options
author | Lars Knoll <[email protected]> | 2016-12-09 10:47:57 +0100 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2016-12-11 17:00:29 +0000 |
commit | 4dd13bb4c3b8da79c7ae7f68d930cabff381ead0 (patch) | |
tree | 0fd13507bba269420dfb89e9d134065d2d8a4c7c /src/qml/jsruntime/qv4function_p.h | |
parent | 8c322d89ee13f15141f3115dcb5ee9567270ba32 (diff) |
Get rid of SimpleScriptFunction
Now that the code paths are very similar, we can simply to the
check whether to do a fast or slow function call in
ScriptFunction::call/contruct. To make this fast, cache the
result of the required check in QV4::Function
Change-Id: I03085ca2beb83b1721b60b0d7b2ab4c9266d1e48
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4function_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4function_p.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 802af43cdc..54d0528c42 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -71,6 +71,7 @@ struct Q_QML_EXPORT Function { uint nFormals; bool activationRequired; bool hasQmlDependencies; + bool canUseSimpleCall; Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function, ReturnedValue (*codePtr)(ExecutionEngine *, const uchar *)); @@ -91,14 +92,7 @@ struct Q_QML_EXPORT Function { inline bool needsActivation() const { return activationRequired; } - inline bool canUseSimpleFunction() const { - if (needsActivation() || - compiledFunction->flags & CompiledData::Function::HasCatchOrWith || - compiledFunction->nFormals > QV4::Global::ReservedArgumentCount || - isNamedExpression()) - return false; - return true; - } + inline bool canUseSimpleFunction() const { return canUseSimpleCall; } QQmlSourceLocation sourceLocation() const { |