aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common/qv4compileddata.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QV4: Mark CompilationUnit::saveToDisk constOlivier De Cannière11 days1-1/+1
| | | | | Change-Id: I6141df5776471aea755d0b57b2015571b250088a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CRA review: mark qml/common subfolderFabian Kosmale2025-11-101-0/+1
| | | | | | | | | | | | | | | | Give most things default significance, except for qjsnumbercoercion.cpp which only contains documentation and qv4compileddata.cpp which gets flagged as critical for being a data-parser. That's somewhat debatable, given that we also excepect qmlc files to be as trustworthy as qml files, but while that is not explicitly stated anywhere we might want to err on the side of caution. Pick-to: 6.10 6.8 Task-number: QTBUG-136194 QUIP: 23 Change-Id: I2987cea2453dcc3b828dc4ecf0ad22fdfd0d1000 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Be explicit about type-conversion for QString::args()Edward Welbourne2025-10-081-1/+1
| | | | | | | | | | | | | | | | Passing a quint32_le depended on a type conversion that might not be obvious to the reader. That's going to stop working when QString::arg() gets finnickier about which overloads get coerced to integral types, to avoid problems with types that convert fo floating-point but aren't recognised by the compiler *as* floating-point, so were otherwise being cast via integral types and losing precision. Pick-to: 6.10 Task-number: QTBUG-138471 Change-Id: I9b4df08159502c9109fa8489b2290e213bcff2b8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Only hold CU in ResolvedTypeReference where neededUlf Hermann2025-06-071-4/+1
| | | | | | | | | | | | | | | The only place that actually needs the compilation unit is the object creator. The object creator will only touch type references we need to create objects from. For everything else, the property cache and the QQmlType are good enough. Therefore, always store property cache and QQmlType in a uniform way. In turn drop the CU where we can. Task-number: QTBUG-135286 Change-Id: I1dfac132a1580679b165c2f891a8d9439fa14d1e Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Remove object/binding/parser status counts from CUsUlf Hermann2025-05-201-118/+0
| | | | | | | | | | | | | | Calculating those is a rather complex affair, and unlikely to pay off. Previously they were used to pre-allocate space in the object creator. We use standard containers with standard allocation strategies everywhere else. If this turns out to be an actual problem, we could record the actual numbers when we create a component and record those in the ExecutableCompilationUnit for next time. Task-number: QTBUG-135286 Change-Id: Ia44bbc9c49cbfb638f5d4bbbb345c48124e4fb09 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "QtQml: Remove dependency hashing"Ulf Hermann2025-05-151-0/+38
| | | | | | | | | | | This reverts commit 18c421fe6159dc921643c72ae335cf189eb1cc3a. Removing the dependency hashing is not safe because there are various other bits covered by it, not only the alias target IDs. Task-number: QTBUG-136806 Change-Id: I4a8a57d810203a47945ce67916ee5b54ee7a603d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Remove dependency hashingUlf Hermann2025-05-131-38/+0
| | | | | | | | | Since we don't store any property indices in the compilation units anymore, we don't need to hash the dependencies anymore. Task-number: QTBUG-135286 Change-Id: I2ea05c920475749f2a2d6cf309d0956a74d6c688 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Drop checks for compile hash and Qt version from the CUsUlf Hermann2025-03-181-36/+0
| | | | | | | | | | | | | | | The data structure version is supposed to encode any incompatible changes to our compilation unit format. Checking the compile hash and Qt version in addition is redundant and excessively restrictive. [ChangeLog][QtQml] You can now use QML code compiled with Qt Quick Compiler across Qt versions as long as the compilation unit format hasn't changed between those versions. You cannot rely on the compilation unit format to stay unchanged under any specific circumstances. However, we won't change it unnecessarily. Change-Id: I8c407b505ac7fa952f53fa25bb6d4e7caf0fba0c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Always load from existing compilation units firstUlf Hermann2025-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If a compilation unit for the given URL already exists in the type registry, we can safely use it since anything in the type registry is shareable. An exception to this are requests with explicit inline source code. Those cannot be cached at all. Conversely, if we were to re-compile, that's not only wasteful but we may end up with diverging type hierarchies and mismatched types. Revert commit d0e16e3f614d73f6694863d2cfb1fbd661c34e3f since it has become counter-productive now. We really want to have exactly one base compilation unit for each type, and that should be universally accessible. When d0e16e3f614d73f6694863d2cfb1fbd661c34e3f was written we had separate base CUs for each engine, and we didn't want those to accidentally find each other. Realize that composite types have to be indexed by url(), not finalUrl(), since url() includes any file selectors while finalUrl() does not. Fixes: QTBUG-134398 Pick-to: 6.9.0 6.9 6.8 6.8.3 Change-Id: I130cdc27ebd8a2814e194478a27eef5bb7f79eb7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move inlineComponentName from CU to ObjectCreatorFabian Kosmale2024-12-041-37/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A (base) compilation unit should ideally be immutable, as we otherwise open a can of worms when it comes to cross-thread usage of CUs. However, so far, we've been using a mutable inlineComponentName member of the compilation unit to select whether the root component of a CU should be constructed, or one of its inline components. This patch change prepares for making the CU immutable, by moving the inline component name tracking into the ObjectCreator itself, requiring that the name gets passed into its constructor – or that an empty string gets passed in case of the main component. The resulting refactoring makes it apparent that deferred properties did not handle inline components at all. Support for them gets added by also storing the inline component name inside of DeferredData, and passing it along when needed. A test case which verifies that deferred properties are now fixed is added as a follow-up commit. Besides the core engine, we also need to adjust qmltc which also generates code to handle deferred properties. Consequently, we also need to pass the inline component name along in the qmltc generated code. Task-number: QTBUG-131442 Pick-to: 6.5 6.8 Change-Id: Ide9bc98223c01225b954662b3f4989bbbfda7672 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Move header verification into CompiledData::UnitUlf Hermann2024-01-231-0/+66
| | | | | | | | There is nothing that makes it depend on ExecutableCompilationUnit. Change-Id: I482dfc0177530f748bb90e5373c64ca5558d8629 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Use CompiledData::CompilationUnit in more placesUlf Hermann2024-01-201-0/+138
| | | | | | | | | | We rarely actually need the executable CU, and where we need it, we can dynamically create or retrieve it from the engine. To that end, store all the CUs in the same container in the engine. Change-Id: I0b786048c578ac4f41ae4aee601da850fa400f2e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move dependentScripts into base CUUlf Hermann2024-01-181-0/+1
| | | | | Change-Id: Ia332a691a4a5f04fcca50eb1c3e2018f8368dbe6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move type name cache into base CUUlf Hermann2024-01-181-0/+7
| | | | | Change-Id: Ie3504f16b34859cdef72f8138e6058dcc2d1f58f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move qmlType into base CUUlf Hermann2024-01-181-0/+7
| | | | | Change-Id: I81ae9a4d24518dffc5b924994d45203958bb9546 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move checksum verification into base CUUlf Hermann2024-01-131-0/+15
| | | | | Change-Id: I49d48a7bc38e727bb23f3154311e1f7876f8cc03 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move binding, object and parser status counts to base CUUlf Hermann2024-01-131-0/+21
| | | | | Change-Id: Id52e3d50b02649010ebcb2309253aa689a536770 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move ResolvedTypeReference into base CUUlf Hermann2024-01-131-1/+54
| | | | | Change-Id: I25063457aad3a6d29a8c2a5b236f9a51b56a2f51 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Get rid of the module mutexUlf Hermann2024-01-101-0/+9
| | | | | | | | | | | | | It only exists so that the type loader can query pre-compiled and native modules from the loader thread. However, the type loader already has a mutex of its own. We can use that to inject a "native" blob into its script cache for the same effect. We need to get rid of the mutex so that we can use the module map for other compilation units, too. Change-Id: I5a9c266ea36b50f5ea69214110def644f7501674 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Always link executable CU on creationUlf Hermann2024-01-101-0/+114
We don't want floating unlinked executable CUs. They should always be tied to an engine, and the engine should not change. This gives us one definite point where to register them with the engine (to be done in subsequent change). Unfortunately, due to the refcounting, we need to remove the engine from any still-referenced CUs when the engine itself is destructed. We will be able to drop the refcounting and make the engine fully own its executable CUs once we can hold base CUs in most places. Change-Id: I9a53e83d5c4746c2b2bca896b51baa4fe7fee757 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>