aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stackframe.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/qv4stackframe.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/qv4stackframe.cpp')
-rw-r--r--src/qml/jsruntime/qv4stackframe.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4stackframe.cpp b/src/qml/jsruntime/qv4stackframe.cpp
index a716c53aea..e99dda591f 100644
--- a/src/qml/jsruntime/qv4stackframe.cpp
+++ b/src/qml/jsruntime/qv4stackframe.cpp
@@ -36,7 +36,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include "qv4stackframe_p.h"
+#include <private/qv4qobjectwrapper_p.h>
#include <QtCore/qstring.h>
using namespace QV4;
@@ -68,7 +70,12 @@ int CppStackFrame::lineNumber() const
return line->line;
}
-ReturnedValue CppStackFrame::thisObject() const {
- return jsFrame->thisObject.asReturnedValue();
-}
+ReturnedValue QV4::CppStackFrame::thisObject() const
+{
+ if (isJSTypesFrame())
+ return static_cast<const JSTypesStackFrame *>(this)->thisObject();
+ Q_ASSERT(isMetaTypesFrame());
+ const auto metaTypesFrame = static_cast<const MetaTypesStackFrame *>(this);
+ return QObjectWrapper::wrap(metaTypesFrame->context()->engine(), metaTypesFrame->thisObject());
+}