diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-05-16 09:27:14 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-05-23 13:53:22 +0200 |
commit | ba64b7a70eedf6a2023ef86eda542cad6f4b21be (patch) | |
tree | 2a7663132b2717a2c361c3b0c03b09fe85fcc884 /src/qml | |
parent | 1559e6707e276b521b52876c539fcfe5a1e85a4e (diff) |
Undeprecate AOTCompiledFunction
We're going to call the JavaScript-typed functions a different name.
Change-Id: If92c3fb1b16b1b0bd7d009e7dd712ae6405e1232
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/common/qv4compileddata_p.h | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4function.cpp | 16 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4function_p.h | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4jscall_p.h | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 12 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlprivate.h | 10 |
10 files changed, 33 insertions, 33 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h index 3a30938de4..dde4082172 100644 --- a/src/qml/common/qv4compileddata_p.h +++ b/src/qml/common/qv4compileddata_p.h @@ -51,7 +51,7 @@ class QQmlType; class QQmlEngine; namespace QQmlPrivate { -struct TypedFunction; +struct AOTCompiledFunction; } namespace QmlIR { @@ -1454,7 +1454,7 @@ struct CompilationUnit : public CompilationUnitBase const Unit *data = nullptr; const QmlUnit *qmlData = nullptr; QStringList dynamicStrings; - const QQmlPrivate::TypedFunction *aotCompiledFunctions = nullptr; + const QQmlPrivate::AOTCompiledFunction *aotCompiledFunctions = nullptr; public: using CompiledObject = CompiledData::Object; @@ -1464,7 +1464,7 @@ public: setUnitData(unitData, nullptr, fileName, finalUrlString); } - explicit CompilationUnit(const Unit *unitData, const QQmlPrivate::TypedFunction *aotCompiledFunctions, + explicit CompilationUnit(const Unit *unitData, const QQmlPrivate::AOTCompiledFunction *aotCompiledFunctions, const QString &fileName = QString(), const QString &finalUrlString = QString()) : CompilationUnit(unitData, fileName, finalUrlString) { diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index a73d5031ec..ca3e7e3141 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -178,10 +178,10 @@ QV4::Function *ExecutableCompilationUnit::linkToEngine(ExecutionEngine *engine) = qEnvironmentVariableIsSet("QV4_FORCE_INTERPRETER") || !(engine->diskCacheOptions() & ExecutionEngine::DiskCache::AotNative); - const QQmlPrivate::TypedFunction *aotFunction + const QQmlPrivate::AOTCompiledFunction *aotFunction = ignoreAotCompiledFunctions ? nullptr : aotCompiledFunctions; - auto advanceAotFunction = [&](int i) -> const QQmlPrivate::TypedFunction * { + auto advanceAotFunction = [&](int i) -> const QQmlPrivate::AOTCompiledFunction * { if (aotFunction) { if (aotFunction->functionPtr) { if (aotFunction->extraData == i) diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index c2f23279ba..5edccafa3c 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -61,14 +61,14 @@ ReturnedValue Function::call( switch (kind) { case AotCompiled: return QV4::convertAndCall( - context->engine(), typedFunction, thisObject, argv, argc, + context->engine(), aotCompiledFunction, thisObject, argv, argc, [this, context]( QObject *thisObject, void **a, const QMetaType *types, int argc) { call(thisObject, a, types, argc, context); }); case JsTyped: return QV4::coerceAndCall( - context->engine(), typedFunction, thisObject, argv, argc, + context->engine(), aotCompiledFunction, thisObject, argv, argc, [this, context](const Value *thisObject, const Value *argv, int argc) { return doCall(this, thisObject, argv, argc, context); }); @@ -81,7 +81,7 @@ ReturnedValue Function::call( Function *Function::create(ExecutionEngine *engine, ExecutableCompilationUnit *unit, const CompiledData::Function *function, - const QQmlPrivate::TypedFunction *aotFunction) + const QQmlPrivate::AOTCompiledFunction *aotFunction) { return new Function(engine, unit, function, aotFunction); } @@ -93,13 +93,13 @@ void Function::destroy() Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit, const CompiledData::Function *function, - const QQmlPrivate::TypedFunction *aotFunction) + const QQmlPrivate::AOTCompiledFunction *aotFunction) : FunctionData(unit) , compiledFunction(function) , codeData(function->code()) , jittedCode(nullptr) , codeRef(nullptr) - , typedFunction(aotFunction) + , aotCompiledFunction(aotFunction) , kind(aotFunction ? AotCompiled : JsUntyped) { Scope scope(engine); @@ -135,7 +135,7 @@ Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit, return; } - QQmlPrivate::TypedFunction *synthesized = new QQmlPrivate::TypedFunction; + QQmlPrivate::AOTCompiledFunction *synthesized = new QQmlPrivate::AOTCompiledFunction; QQmlEnginePrivate *enginePrivate = QQmlEnginePrivate::get(engine->qmlEngine()); auto findMetaType = [&](const CompiledData::ParameterType ¶m) { @@ -177,7 +177,7 @@ Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit, synthesized->argumentTypes.append(findMetaType(formalsIndices[i].type)); synthesized->returnType = findMetaType(compiledFunction->returnType); - typedFunction = synthesized; + aotCompiledFunction = synthesized; kind = JsTyped; } @@ -188,7 +188,7 @@ Function::~Function() delete codeRef; } if (kind == JsTyped) - delete typedFunction; + delete aotCompiledFunction; } void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArray> ¶meters) diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 181c88a1e2..20356b9192 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -47,7 +47,7 @@ Q_STATIC_ASSERT(std::is_standard_layout< FunctionData >::value); struct Q_QML_EXPORT Function : public FunctionData { protected: Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit, - const CompiledData::Function *function, const QQmlPrivate::TypedFunction *aotFunction); + const CompiledData::Function *function, const QQmlPrivate::AOTCompiledFunction *aotFunction); ~Function(); public: @@ -74,7 +74,7 @@ public: typedef ReturnedValue (*JittedCode)(CppStackFrame *, ExecutionEngine *); JittedCode jittedCode; JSC::MacroAssemblerCodeRef *codeRef; - const QQmlPrivate::TypedFunction *typedFunction = nullptr; + const QQmlPrivate::AOTCompiledFunction *aotCompiledFunction = nullptr; // first nArguments names in internalClass are the actual arguments Heap::InternalClass *internalClass; @@ -86,7 +86,7 @@ public: static Function *create(ExecutionEngine *engine, ExecutableCompilationUnit *unit, const CompiledData::Function *function, - const QQmlPrivate::TypedFunction *aotFunction); + const QQmlPrivate::AOTCompiledFunction *aotFunction); void destroy(); // used when dynamically assigning signal handlers (QQmlConnection) diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 3fd85ab44d..a9cd25d569 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -539,13 +539,13 @@ ReturnedValue ArrowFunction::virtualCall(const QV4::FunctionObject *fo, const Va switch (function->kind) { case Function::AotCompiled: return QV4::convertAndCall( - fo->engine(), function->typedFunction, thisObject, argv, argc, + fo->engine(), function->aotCompiledFunction, thisObject, argv, argc, [fo](QObject *thisObject, void **a, const QMetaType *types, int argc) { ArrowFunction::virtualCallWithMetaTypes(fo, thisObject, a, types, argc); }); case Function::JsTyped: return QV4::coerceAndCall( - fo->engine(), function->typedFunction, thisObject, argv, argc, + fo->engine(), function->aotCompiledFunction, thisObject, argv, argc, [fo](const Value *thisObject, const Value *argv, int argc) { return qfoDoCall(fo, thisObject, argv, argc); }); diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h index cb6e708eee..2f6af8dd8b 100644 --- a/src/qml/jsruntime/qv4jscall_p.h +++ b/src/qml/jsruntime/qv4jscall_p.h @@ -98,7 +98,7 @@ void populateJSCallArguments(ExecutionEngine *v4, JSCallArguments &jsCall, int a template<typename Callable> ReturnedValue convertAndCall( - ExecutionEngine *engine, const QQmlPrivate::TypedFunction *aotFunction, + ExecutionEngine *engine, const QQmlPrivate::AOTCompiledFunction *aotFunction, const Value *thisObject, const Value *argv, int argc, Callable call) { const qsizetype numFunctionArguments = aotFunction->argumentTypes.size(); @@ -191,7 +191,7 @@ bool convertAndCall(ExecutionEngine *engine, QObject *thisObject, template<typename Callable> ReturnedValue coerceAndCall( - ExecutionEngine *engine, const QQmlPrivate::TypedFunction *typedFunction, + ExecutionEngine *engine, const QQmlPrivate::AOTCompiledFunction *typedFunction, const Value *thisObject, const Value *argv, int argc, Callable call) { Scope scope(engine); diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 38a7652ef0..0d4ba41fee 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -405,21 +405,21 @@ void VME::exec(MetaTypesStackFrame *frame, ExecutionEngine *engine) ExecutionEngineCallDepthRecorder executionEngineCallDepthRecorder(engine); Function *function = frame->v4Function; - Q_ASSERT(function->typedFunction); + Q_ASSERT(function->aotCompiledFunction); Q_TRACE_SCOPE(QQmlV4_function_call, engine, function->name()->toQString(), function->executableCompilationUnit()->fileName(), function->compiledFunction->location.line(), function->compiledFunction->location.column()); Profiling::FunctionCallProfiler profiler(engine, function); // start execution profiling - const qsizetype numFunctionArguments = function->typedFunction->argumentTypes.size(); + const qsizetype numFunctionArguments = function->aotCompiledFunction->argumentTypes.size(); Q_ALLOCA_DECLARE(void *, transformedArguments); for (qsizetype i = 0; i < numFunctionArguments; ++i) { const bool isValid = frame->argc() > i; const QMetaType frameType = isValid ? frame->argTypes()[i] : QMetaType(); - const QMetaType argumentType = function->typedFunction->argumentTypes[i]; + const QMetaType argumentType = function->aotCompiledFunction->argumentTypes[i]; if (isValid && argumentType == frameType) continue; @@ -473,7 +473,7 @@ void VME::exec(MetaTypesStackFrame *frame, ExecutionEngine *engine) transformedArguments[i] = arg; } - const QMetaType returnType = function->typedFunction->returnType; + const QMetaType returnType = function->aotCompiledFunction->returnType; const QMetaType frameReturn = frame->returnType(); bool returnsQVariantWrapper = false; Q_ALLOCA_DECLARE(void, transformedResult); @@ -500,7 +500,7 @@ void VME::exec(MetaTypesStackFrame *frame, ExecutionEngine *engine) aotContext.engine = engine->jsEngine(); aotContext.compilationUnit = function->executableCompilationUnit(); - function->typedFunction->functionPtr( + function->aotCompiledFunction->functionPtr( &aotContext, transformedResult ? transformedResult : frame->returnValue(), transformedArguments ? transformedArguments : frame->argv()); @@ -539,7 +539,7 @@ void VME::exec(MetaTypesStackFrame *frame, ExecutionEngine *engine) if (arg == nullptr) continue; if (i >= frame->argc() || arg != frame->argv()[i]) - function->typedFunction->argumentTypes[i].destruct(arg); + function->aotCompiledFunction->argumentTypes[i].destruct(arg); } } } diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 96a7b6343f..434d92d3d2 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -673,7 +673,7 @@ void QQmlBinding::doUpdate(const DeleteWatcher &watcher, QQmlPropertyData::Write auto canWrite = [&]() { return !watcher.wasDeleted() && isAddedToObject() && !hasError(); }; const QV4::Function *v4Function = function(); if (v4Function && v4Function->kind == QV4::Function::AotCompiled && !hasBoundFunction()) { - const auto returnType = v4Function->typedFunction->returnType; + const auto returnType = v4Function->aotCompiledFunction->returnType; if (returnType == QMetaType::fromType<QVariant>()) { // It expects uninitialized memory Q_ALLOCA_VAR(QVariant, result, sizeof(QVariant)); diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 26ab192c31..d1123f3c4e 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1558,7 +1558,7 @@ QList<QQmlType> QQmlMetaType::qmlSingletonTypes() static bool isFullyTyped(const QQmlPrivate::CachedQmlUnit *unit) { quint32 numTypedFunctions = 0; - for (const QQmlPrivate::TypedFunction *function = unit->aotCompiledFunctions; + for (const QQmlPrivate::AOTCompiledFunction *function = unit->aotCompiledFunctions; function; ++function) { if (function->functionPtr) ++numTypedFunctions; diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 80746b0f58..fbb36ba606 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -714,21 +714,21 @@ namespace QQmlPrivate void initSetValueLookup(uint index, const QMetaObject *metaObject, QMetaType type) const; }; - struct TypedFunction { + struct AOTCompiledFunction { qintptr extraData; QMetaType returnType; QList<QMetaType> argumentTypes; void (*functionPtr)(const AOTCompiledContext *context, void *resultPtr, void **arguments); }; -#if QT_DEPRECATED_SINCE(6, 5) - QT_DEPRECATED_VERSION_X(6, 5, "Use TypedFunction instead") - typedef TypedFunction AOTCompiledFunction; +#if QT_DEPRECATED_SINCE(6, 6) + QT_DEPRECATED_VERSION_X(6, 6, "Use AOTCompiledFunction instead") + typedef AOTCompiledFunction TypedFunction; #endif struct CachedQmlUnit { const QV4::CompiledData::Unit *qmlData; - const TypedFunction *aotCompiledFunctions; + const AOTCompiledFunction *aotCompiledFunctions; void *unused2; }; |