aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/Categorizer.qml
Commit message (Collapse)AuthorAgeFilesLines
* QmlCompiler: Fix side effect detection for callsUlf Hermann2025-10-311-29/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QmlCompiler: Discern between different kinds of side effectsUlf Hermann2025-06-231-1/+27
| | | | | | | | | | A mere jump does not cause all value types and lists to be invalidated. Only calls to other functions or writes to other properties do that. Pick-to: 6.10 6.9 6.8 6.5 Fixes: QTBUG-137540 Change-Id: I069c6873455c51bbea59cf876d2bc7ecd188f81b Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QmlCompiler: Sharpen side effect detectionUlf Hermann2025-06-231-0/+22
| | | | | | | | | | | Stack-created lists of primitives or pointers cannot be affected by side effects. We cannot write a value affected by side effects to a list that isn't, though. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-137540 Change-Id: I99ab4337cabc6111a81b8164fd94962edc0db25e Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QmlCompiler: Restore support for writing to temporary arraysUlf Hermann2025-06-231-0/+10
We use the JavaScript extension as "read" type to signify that the code generator will accept any type with such an extension. This requires some adjustments in the type resolver. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-137540 Change-Id: Ia34ca0a24c417c5372852268ba2f55825484639d Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>