aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljscompiler.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-06-10 11:21:15 +0200
committerUlf Hermann <ulf.hermann@qt.io>2024-06-16 00:17:34 +0200
commitdd731b880b4bfbe7bad7b0b4d1ac3b72503c0071 (patch)
tree6a00d633cccc1d3ce0236cfcaa3bd4a1816430e0 /src/qmlcompiler/qqmljscompiler.cpp
parent9542b4b93576dd42cfbfe2dd8692b317fe6f7e3c (diff)
QmlCompiler: Create QQmlJSRegisterContent unstored
Add a separate pass to populate the stored types and only run that after we're done with all the type propagation and optimization. Task-number: QTBUG-124670 Change-Id: I740063908b22684f5d2c72d6261fad98850d8636 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljscompiler.cpp')
-rw-r--r--src/qmlcompiler/qqmljscompiler.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljscompiler.cpp b/src/qmlcompiler/qqmljscompiler.cpp
index 908ef4fe79..2fd893ca2a 100644
--- a/src/qmlcompiler/qqmljscompiler.cpp
+++ b/src/qmlcompiler/qqmljscompiler.cpp
@@ -15,6 +15,7 @@
#include <private/qqmljsparser_p.h>
#include <private/qqmljsshadowcheck_p.h>
#include <private/qqmljsstoragegeneralizer_p.h>
+#include <private/qqmljsstorageinitializer_p.h>
#include <private/qqmljstypepropagator_p.h>
#include <QtCore/qfile.h>
@@ -775,8 +776,13 @@ QQmlJSAotFunction QQmlJSAotCompiler::doCompile(
if (error->isValid())
return compileError();
+ QQmlJSStorageInitializer initializer(
+ m_unitGenerator, &m_typeResolver, m_logger, blocks, annotations);
+ passResult = initializer.run(function, error);
+
// Generalize all arguments, registers, and the return type.
- QQmlJSStorageGeneralizer generalizer(m_unitGenerator, &m_typeResolver, m_logger, blocks, annotations);
+ QQmlJSStorageGeneralizer generalizer(
+ m_unitGenerator, &m_typeResolver, m_logger, blocks, annotations);
passResult = generalizer.run(function, error);
if (error->isValid())
return compileError();