aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/CategorizerBase.qml
Commit message (Collapse)AuthorAgeFilesLines
* QmlCompiler: Fix side effect detection for callsUlf Hermann2025-10-311-0/+25
We cannot pass registers that are potentially affected by side effect as arguments to calls. For this to work, we need to sharpen the side effect detection some more. 1. A conversion is always "var" which can be affected by side effects. However, the actual question is whether one of the conversion origins can be affected by side effects. A conversion of "int" and "undefined", for example, can certainly not be affected. 2. When determining side effects we need to look at the original types, not the adjusted ones. Adjusted types are often "var" because we need to pass a value as "var" to some function. That doesn't mean the value can be affected by side effects, though. 3. When generating the write-back, we should first check if it's necessary at all before looking for side effects. Furthermore, we need to slightly adjust the deltablue benchmark since two values were potentially affected by side effects. The walkStrength may be shadowed by a type with internal structure. Only at the call site of the weaker() and stronger() functions it would then be collapsed into int. However, those function calls might change the original walkStrength, thereby producing a side effect for further calls. We can exclude this effect by collapsing to Number right away using the '+' operator. Finally, we need to make the initialization of the Categorizer benchmark non-Strict. The loop that writes into an array of type unknown until the return statement while calling a function on every iteration is obviously affected by side effects. However, the meat of the benchmark is actually not the initialization. So that should be fine. Pick-to: 6.10 6.8 Fixes: QTBUG-141420 Change-Id: Iad47eddcf0afaa4e502f1d151cf383a6fd23f5ba Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>