From e20650e0702259b4be79be85a3d27e45db42efc1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 17 May 2021 16:38:25 +0200 Subject: Eliminate JS call frame from metatypes calls If we call an AOT-compiled function we never need the JavaScript call frame. We can just skip its setup and save some overhead. Change-Id: I39dc2ca6eea5b5a66f3b87b642a310534cecf6cd Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4engine.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/qml/jsruntime/qv4engine.cpp') diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index fb5f5802f8..6b4fc81bf3 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -2112,12 +2112,11 @@ void ExecutionEngine::callInContext(Function *function, QObject *self, QV4::Scope scope(this); ExecutionContext *ctx = currentStackFrame ? currentContext() : scriptContext(); QV4::Scoped qmlContext(scope, QV4::QmlContext::create(ctx, ctxtdata, self)); - QV4::ScopedValue selfValue(scope, QV4::QObjectWrapper::wrap(this, self)); if (!args) { Q_ASSERT(argc == 0); void *dummyArgs[] = { nullptr }; QMetaType dummyTypes[] = { QMetaType::fromType() }; - function->call(selfValue, dummyArgs, dummyTypes, argc, qmlContext); + function->call(self, dummyArgs, dummyTypes, argc, qmlContext); return; } @@ -2125,7 +2124,7 @@ void ExecutionEngine::callInContext(Function *function, QObject *self, return; // implicitly sets the return value, which is args[0] - function->call(selfValue, args, types, argc, qmlContext); + function->call(self, args, types, argc, qmlContext); } void ExecutionEngine::initQmlGlobalObject() -- cgit v1.2.3