aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compat
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2024-10-01 15:22:47 +0200
committerUlf Hermann <[email protected]>2024-10-25 19:57:41 +0200
commit3a3c72ce0a85ee60b2955f2d620abed378e07f56 (patch)
tree6cb7cc80c1e026bb2d4f0f8e440907f4558dc4cd /src/qml/compat
parentb5684d1ca0501f3e607552c06c10db769018dd6e (diff)
QmlCompiler: Make loadGlobalLookup work like other lookups
Cache the metatype in the lookup rather than re-calculating it in every call. Change-Id: I5fde45a05a3d515466d9cf360bf51d7a8c9cb816 Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qml/compat')
-rw-r--r--src/qml/compat/removed_api.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qml/compat/removed_api.cpp b/src/qml/compat/removed_api.cpp
index bf58c2be99..3ee11717cd 100644
--- a/src/qml/compat/removed_api.cpp
+++ b/src/qml/compat/removed_api.cpp
@@ -98,4 +98,22 @@ void QQmlPrivate::AOTCompiledContext::initCallQmlContextPropertyLookup(uint inde
engine->handle()->amendException();
}
+bool QQmlPrivate::AOTCompiledContext::loadGlobalLookup(uint index, void *target, QMetaType type) const
+{
+ QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
+ if (!QV4::ExecutionEngine::metaTypeFromJS(
+ lookup->globalGetter(engine->handle()), type, target)) {
+ engine->handle()->throwTypeError();
+ return false;
+ }
+ return true;
+}
+
+void QQmlPrivate::AOTCompiledContext::initLoadGlobalLookup(uint index) const
+{
+ Q_UNUSED(index);
+ Q_ASSERT(engine->hasError());
+ engine->handle()->amendException();
+}
+
#endif