aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4function.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-05-17 16:38:25 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-10 11:53:19 +0200
commite20650e0702259b4be79be85a3d27e45db42efc1 (patch)
tree7536cee98f4cc502774f807d1a609940cd20d4f5 /src/qml/jsruntime/qv4function.cpp
parent7fa28f98824a94396106eadfc028b329985a0cfc (diff)
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
-rw-r--r--src/qml/jsruntime/qv4function.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index db767085da..7b5685a2a0 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -57,8 +57,8 @@ QT_BEGIN_NAMESPACE
using namespace QV4;
-bool Function::call(const Value *thisObject, void **a, const QMetaType *types, int argc,
- const ExecutionContext *context)
+bool Function::call(QObject *thisObject, void **a, const QMetaType *types, int argc,
+ ExecutionContext *context)
{
if (!aotFunction) {
return QV4::convertAndCall(
@@ -70,21 +70,19 @@ bool Function::call(const Value *thisObject, void **a, const QMetaType *types, i
ExecutionEngine *engine = context->engine();
MetaTypesStackFrame frame;
- frame.init(this, a, types, argc);
- frame.setupJSFrame(engine->jsStackTop, Value::undefinedValue(), context->d(),
- thisObject ? *thisObject : Value::undefinedValue());
+ frame.init(this, thisObject, context, a, types, argc);
frame.push(engine);
- engine->jsStackTop += frame.requiredJSStackFrameSize();
Moth::VME::exec(&frame, engine);
frame.pop(engine);
return true;
}
-ReturnedValue Function::call(const Value *thisObject, const Value *argv, int argc, const ExecutionContext *context) {
+ReturnedValue Function::call(
+ const Value *thisObject, const Value *argv, int argc, ExecutionContext *context) {
if (aotFunction) {
return QV4::convertAndCall(
context->engine(), aotFunction, thisObject, argv, argc,
- [this, context](const Value *thisObject,
+ [this, context](QObject *thisObject,
void **a, const QMetaType *types, int argc) {
call(thisObject, a, types, argc, context);
});