From 4dd13bb4c3b8da79c7ae7f68d930cabff381ead0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 9 Dec 2016 10:47:57 +0100 Subject: 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 --- src/qml/jsruntime/qv4function.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/qml/jsruntime/qv4function.cpp') diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index e3f839afd2..358c2d079c 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -84,6 +84,9 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, internalClass = internalClass->addMember(compilationUnit->runtimeStrings[localsIndices[i]]->identifier, Attr_NotConfigurable); activationRequired = compiledFunction->nInnerFunctions > 0 || (compiledFunction->flags & (CompiledData::Function::HasDirectEval | CompiledData::Function::UsesArgumentsObject)); + + canUseSimpleCall = !needsActivation() && !(compiledFunction->flags & CompiledData::Function::HasCatchOrWith) && + !(compiledFunction->nFormals > QV4::Global::ReservedArgumentCount) && !isNamedExpression(); } Function::~Function() -- cgit v1.2.1