From 9694e0631da9ae94dab4229091f382528700af90 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 7 Jan 2021 16:07:00 +0100 Subject: Pass a more comprehensive context to AOT-compiled functions We need the compilation unit, and a way to retrieve JavaScript metatypes from it. Also, prepare for cases where we only have a QJSEngine, not a QQmlEngine, and pass the scope object as part of the AOT context. Change-Id: Ica81e92c99f3c9b6baffd04db1e0e91603fd2ac7 Reviewed-by: Andrei Golubev Reviewed-by: Fabian Kosmale --- src/qml/qml/qqmlprivate.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/qqmlprivate.h') diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index a2cd9452ac..ce83b33eaa 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -589,12 +589,20 @@ namespace QQmlPrivate QVector *qmlTypeIds; }; + struct AOTCompiledContext { + QQmlContext *qmlContext; + QObject *qmlScopeObject; + QJSEngine *engine; + QV4::CompiledData::CompilationUnit *compilationUnit; + + QJSValue Q_QML_EXPORT jsMetaType(int index) const; + }; + struct AOTCompiledFunction { int index; QMetaType returnType; QList argumentTypes; - void (*functionPtr)(QQmlContext *context, QObject *scopeObject, void *resultPtr, - void **arguments); + void (*functionPtr)(const AOTCompiledContext *context, void *resultPtr, void **arguments); }; struct CachedQmlUnit { -- cgit v1.2.3