diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-28 16:07:24 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-12-23 09:02:37 +0100 |
| commit | b1df14cfc00f175947ec7170935b704cf18a439b (patch) | |
| tree | b7c6707f84f43432ebe760c251bb116f51fd2199 /src/qmlcompiler/qqmljsstoragegeneralizer.cpp | |
| parent | 35e2bb0906b229658c45a0a5fd4a47494701559e (diff) | |
QmlCompiler: std::move() registers where possible
In the common case that we read a register only once, in the same basic
block, generate a std::move() in order to move it into place.
Especially for QVariants holding large internal objects, this should
help performance.
Fixes: QTBUG-101452
Change-Id: I015892e1046ca7b739dbd296756f3f012dba5f9b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsstoragegeneralizer.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsstoragegeneralizer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljsstoragegeneralizer.cpp b/src/qmlcompiler/qqmljsstoragegeneralizer.cpp index ed3743bc61..543dec9ff6 100644 --- a/src/qmlcompiler/qqmljsstoragegeneralizer.cpp +++ b/src/qmlcompiler/qqmljsstoragegeneralizer.cpp @@ -41,10 +41,9 @@ QQmlJSCompilePass::InstructionAnnotations QQmlJSStorageGeneralizer::run( m_typeResolver->generalizeType(specific); }; - const auto transformRegisters - = [&](QFlatMap<int, QQmlJSRegisterContent> ®isters) { + const auto transformRegisters = [&](VirtualRegisters ®isters) { for (auto j = registers.begin(), jEnd = registers.end(); j != jEnd; ++j) { - QQmlJSRegisterContent &content = j.value(); + QQmlJSRegisterContent &content = j.value().content; transformRegister(content); } }; |
