Commit Graph

5 Commits

Author SHA1 Message Date
Ulf Hermann 4679710f4d QmlCompiler: Store arguments as QQmlJSRegisterContent
This way we can uniquely track the stored types throughout the
compilation.

Change-Id: Ibf3814a37f105c2eede2a08f547ab5fbfa1c16e2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-03 18:44:21 +01:00
Ulf Hermann 15ff88f0f1 QmlCompiler: Make InstructionAnnotations a QFlatMap
We will need to iterate the annotations in program order. Therefore, we
need an order map. QFlatMap fits here.

Change-Id: I9a7fe68b0e5aa817257ceabb4853b1554d3ad709
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-25 14:08:19 +01:00
Ulf Hermann fac9448361 QmlCompiler: Improve register tracking
You can only change one register per instruction, and it doesn't have to
be the accumulator. We don't have to store the full register set in
every instruction annotation. It's enough to store the changed register.

This simplifies the logic around choosing the in/out accumulator types.
Now you can rely on the "in" accumulator to always be in the register
set, and the "out" accumulator to be the changed register if applicable.

There will typically be less than 10 registers active at any given
instruction. Therefore, use QFlatMap to store them, rather than QHash.

Also, rename the storage for the type conversions so that we can
actually see what they are.

Change-Id: I694ac2bce7911a4c290c1dccef34d28cde50a1d3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-15 15:03:30 +01:00
Ulf Hermann 66a7ab6ac1 QmlCompiler: Document the compile passes
Task-number: QTBUG-98305
Change-Id: I910d48183c1d78edf6c9d5ca80ceca07d276c702
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-11-26 11:58:02 +01:00
Ulf Hermann cb3ec010ff QmlCompiler: Move type generalization into separate compile pass
We want to be able to skip it.

Task-number: QTBUG-98305
Change-Id: Ibb0293d348f2828a28be4c458cf955b4cc706caa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-11-26 11:57:52 +01:00