From 6a91dcba2e4fa85dc345c2d403c757ab7676e28c Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 9 Aug 2017 16:02:55 +0200 Subject: Always create a valid CallData object for interpreter calls This will allow removing a few more special cases and to simplify the code further. Change-Id: I3a958e9f68e3c103ea4f2ee6825f893e5931b11d Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4function.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/qml/jsruntime/qv4function.cpp') diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index bcc776dc98..78fb46327a 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -38,12 +38,14 @@ ****************************************************************************/ #include "qv4function_p.h" +#include "qv4functionobject_p.h" #include "qv4managed_p.h" #include "qv4string_p.h" #include "qv4value_p.h" #include "qv4engine_p.h" #include "qv4lookup_p.h" #include +#include QT_BEGIN_NAMESPACE @@ -117,4 +119,26 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QListinternalClass->engine; + + if (!function->canUseSimpleCall) { + context = ExecutionContext::newCallContext(context, function, callData); + if (f) + static_cast(context)->function.set(engine, f->d()); + } + + ReturnedValue res = function->execute(context, callData, f); + + if (function->hasQmlDependencies) { + Q_ASSERT(context->type == Heap::ExecutionContext::Type_QmlContext); + QQmlPropertyCapture::registerQmlDependencies(static_cast(context), engine, function->compiledFunction); + } + + return res; +} + QT_END_NAMESPACE -- cgit v1.2.1