aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsregistercontent.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-11-26 16:20:29 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-12-03 15:15:37 +0100
commitff0c2e53366c1f54cc7c79ffc7317b5f1248cbcf (patch)
tree1a91a1881f81fecf94ba44bfabf8fbede5618651 /src/qmlcompiler/qqmljsregistercontent.cpp
parent2e6468f9c49173d884df19c9bd7b33c0f7331cf9 (diff)
QmlCompiler: Periodically trim register content pool
The code generator uses temporary register contents for various purposes. None of those survive across instructions since there wouldn't be anywhere to store them. We don't need to keep those temporaries around until the end of the compilation. Trim them after each instruction. Task-number: QTBUG-124670 Change-Id: Ia6ff7ff2a9c7a5e99ab37ab2cc3e5f7ee756b57c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsregistercontent.cpp')
-rw-r--r--src/qmlcompiler/qqmljsregistercontent.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsregistercontent.cpp b/src/qmlcompiler/qqmljsregistercontent.cpp
index b96405e3bf..e17daa582c 100644
--- a/src/qmlcompiler/qqmljsregistercontent.cpp
+++ b/src/qmlcompiler/qqmljsregistercontent.cpp
@@ -668,6 +668,17 @@ void QQmlJSRegisterContentPool::generalizeType(
d->setType(generalized);
}
+void QQmlJSRegisterContentPool::setAllocationMode(AllocationMode mode)
+{
+ m_checkpoint = (mode == Temporary) ? m_pool.size() : -1;
+}
+
+void QQmlJSRegisterContentPool::clearTemporaries()
+{
+ if (m_checkpoint != -1)
+ m_pool.resize(m_checkpoint);
+}
+
QQmlJSRegisterContentPrivate *QQmlJSRegisterContentPool::clone(
const QQmlJSRegisterContentPrivate *from)
{