aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlpropertycachecreator_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate qmldevtools_buildUlf Hermann2019-05-311-843/+0
| | | | | | | | Move the relevant files into more fitting locations and build the devtools from only parser, compiler and qmldirparser. Change-Id: Ibf37a1187f36d02983f9f43c6622acb243785b7b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move PropertyResolver out of qqmlirbuilder*Ulf Hermann2019-05-061-1/+2
| | | | | | | | The "early" compilation doesn't use it and we can get rid of a few V4_BOOTSTRAP checks this way. Change-Id: I1c4845aba445b105ddace0b6810e0e5c28a25b29 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-021-2/+3
|\ | | | | | | Change-Id: I5d2c3da38df35922b2147c3c0bc55c6c3bae2fe5
| * Fix coverity warningSimon Hausmann2019-04-291-2/+3
| | | | | | | | | | | | | | | | | | | | Commit bc00353cffbfe0f74b602a16452f2e7bcd588152 accidentally removed the assert that expressed how objectForId will always succeed with the alias target. That caused coverity to complain that objectAt() may be called with a negative (then array) index. Change-Id: I8651e0826c92e41ab00bf8a44f1abfd1cbfb0e06 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Dissolve QQmlPropertyRawDataLars Knoll2019-04-181-1/+1
| | | | | | | | | | | | | | There is no reason anymore to split the class in two parts. Change-Id: Iabef7acec1db7afc0ed4e89e1fd5b78699dc0847 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-181-10/+30
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I6add6267297ea50a646d43d212027a168dca8916
| * Detect and reject cyclic aliasesUlf Hermann2019-04-091-10/+30
| | | | | | | | | | | | | | | | Previously those would result in infinite recursion. Fixes: QTBUG-74867 Change-Id: I6c0043b43e72fe7bc3a2a139ca600af2d5bca5ad Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-211-4/+5
|\| | | | | | | Change-Id: Ie33d1c736992abcbde6568131374a7a7891f965c
| * Avoid unnecessary re-generation qml cache files in some circumstancesUlf Hermann2019-02-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | The map of name IDs to resolved types so far is copied several times during compilation and different compile passes see different copies of it. Compile passes may add things to the map, and if they do that on copies that are inaccessible to other code, we get nondeterministic results. Furthermore all the copies and pointers are confusing and inefficient. Fixes: QTBUG-69340 Change-Id: I43ad3cbeeec34f90e05570eddc901fe8aa64c709 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QML: Split propertyCache into multiple filesUlf Hermann2019-02-011-0/+1
|/ | | | | | | I want to be able to read the code. Change-Id: I063143ff63b0a476d783c892e1d328e7f5133fab Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up manual reference of QQmlTypeData and QQmlPropertyCacheSimon Hausmann2018-04-261-17/+11
| | | | | | | | | | | | | | | | | | | | | | | We have a few places in the type loader where we do adventurous manual reference counting, where getType() returns a raw pointer that has been addref()'ed and then sometimes somehow we call release() later. Commit 0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d is an example of where this can easily go wrong. As a consequence and also in preparation for future work on the type loader, this patch starts replacing the manual reference counting there. Changing the return type from QQmlTypeData *getType() to a QQmlRefPointer<> itself is not sufficient though, as the implicit operator T*() will still allow the caller to store the result as a raw pointer. Therefore this patch removes the "unsafe" implicit extraction operator. As a result of that change, other types that are sometimes stored in QQmlRefPointer are also affected and their usage needs to be adapted to QQmlRefPointer usage or manual raw pointer extraction with .data(). Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix group property bindings for aliases that point to id objectsSimon Hausmann2018-03-081-13/+38
| | | | | | | | | | | | | | | | | | When declaring bindings within a group property and that group property itself is a locally declared alias, then by the time we try to determine property caches for the group property we will fail as the aliases haven't been resolved yet. To fix this we can keep track of such group property declarations (encapsulated in the QQmlInstantiatingBindingContext that has all we need) and after we've resolved the aliases (added them to the property caches), we can go back and fill in the entries in the propertyCaches array for the group properties. Task-number: QTBUG-51043 Change-Id: I5613513db3977934bcc51a3df530de47d57326f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-4/+4
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Liang Qi2018-02-121-9/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/shapes/qquickshape.cpp src/imports/shapes/qquickshape_p_p.h src/qml/compiler/qqmlpropertycachecreator_p.h src/qml/jsruntime/qv4value_p.h src/quick/items/qquickloader_p.h tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp tools/qmlprofiler/qmlprofilerapplication.cpp Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-311-9/+18
| |\ | | | | | | | | | Change-Id: Idde38761897f078cd9957f01d34a9751217e4c53
| | * Fix segfault when alias target refers to lowercase-named typeMitch Curtis2018-01-271-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Create an error via QQmlCompileError and return it instead of asserting. Task-number: QTBUG-43567 Change-Id: I0c0741943d30516379eff5f44ed8618a0f0116a4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Allow exported signal handlers for signals with revisionThomas Hartmann2018-01-121-7/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properties of QML objects or alias properties to QML objects have to know about the revision of the QML type. If the property is used as a grouped property and a signal or property is assigned. Without this patch this is not working with signals that have a revision. To get this working we store the minor version of the QML type in QQmlPropertyData and retrieve the QQmlPropertyCache with the correct AllowedRevisionCache using this minor version. Task-number: QTCREATORBUG-18820 Change-Id: I1e20169e0d5a2ae11059a951aa83a5c94106accb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-09-201-5/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata.cpp src/qml/compiler/qv4compileddata_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qmlcontext_p.h src/qml/jsruntime/qv4regexpobject.cpp src/qml/jsruntime/qv4regexpobject_p.h src/qml/types/qqmllistmodel.cpp src/quick/items/qquickanimatedimage_p.h src/quick/scenegraph/qsgrenderloop.cpp tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
| * Get rid of the root object index variableSimon Hausmann2017-09-081-7/+7
| | | | | | | | | | | | | | | | This is a follow-up to the parent commit to remove the variable that is really a constant (zero). Change-Id: I8fc20027c5c7b871269b814cb8b93636e94be267 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix crash with loading cache files originating from top-level componentsSimon Hausmann2017-09-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a .qml file starts with Component {} and its item(s) define their own properties, alias, etc. then loading this file initially would work, but loading it from a cache file would crash with dangling pointers in the property cache. This was due to us registering aliases, properties, etc. twice in the property cache, exceeding the reservation in the property cache vectors. The minimal fix is to skip the root object in the property cache creating loop as we do handle it separately afterwards. It needs to be separate because the first object index within the component does not stem from a binding. However as the root object index is always zero, I'll make a follow-up patch to get rid of of the variable. Task-number: QTBUG-62263 Change-Id: I86b76d38cb490750a561eac2b0ad6fff6ef2e20a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-08-181-17/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/qml/qqmlcustomparser.cpp src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypenamecache.cpp src/qml/qml/qqmltypenamecache_p.h src/qml/qml/qqmltypewrapper.cpp src/qml/qml/qqmltypewrapper_p.h src/qml/qml/qqmlvmemetaobject.cpp src/qml/util/qqmladaptormodel.cpp Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131
| * Use QQmlType by valueLars Knoll2017-08-021-17/+17
| | | | | | | | | | | | | | | | | | | | | | QQmlType is now refcounted, and we need to use it by value, to control it's lifetime properly. This is required, so we can clean up the QQmlMetaTypeData cache on engine destruction and with trimComponentCache() Task-number: QTBUG-61536 Change-Id: If86391c86ea20a646ded7c9925d8f743f628fb91 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for enum declarations in QMLMichael Brasser2017-07-131-2/+17
|/ | | | | | | | | | | | | | | | | Enums can be declared with the following syntax: enum MyEnum { Value1, Value2 } Grammar changes done by Simon Hausmann. [ChangeLog][QtQml] Enums can now be declared directly in QML. Task-number: QTBUG-14861 Change-Id: Ic6b6e032651d01ee2ecf9d5ce5734976cb3ad7ab Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix compilation error with ICC 17: it doesn't like auto and commaThiago Macieira2016-12-041-14/+42
| | | | | | | | | | | | The error is a warning upgraded via -Werror and the message doesn't even make sense to me: error #3373: nonstandard use of "auto" to both deduce the type from an initializer and to announce a trailing return type Intel-Issue-ID: 6000164202 Change-Id: I73fa1e59a4844c43a109fffd148caf09a1952e92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Make all fields in QQmlPropertyRawData privateErik Verbruggen2016-08-101-5/+5
| | | | | | | | And add accessors. This makes it easier later on to change the storage of the fields. Change-Id: I21163668ac83a7d52f398981baf3c27ef161c177 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix restoring of local aliases from disk cacheSimon Hausmann2016-08-061-0/+3
| | | | | | | | Local aliases are always "resolved". We must be careful not to access the same field in the union otherwise and mistake it as property index. Change-Id: I6369cdba145a62dcdaa10d8f4ee84bfa3cbfa0e3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QML: Change the property data flags into a bit fieldErik Verbruggen2016-08-051-32/+25
| | | | | | | | | This will make it easier in follow-up patches to add or remove flags. It also shrinks the flags, because each type doesn't need its own bit (as those are mutually exclusive). Change-Id: I5ba6de5f330eb20c82aa16b4467ed6c952725979 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Introduce QQmlPropertyIndexErik Verbruggen2016-08-041-4/+3
| | | | | | | | This helps in making it clear when an index is a plain old number and when it consists of an encoded value type index. Change-Id: Ic50d95caf244ed0ee2d62bdba53910a371cfee04 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Split out creation of alias properties in the property cachesSimon Hausmann2016-07-151-0/+234
| | | | | | | | | | | | Similar to the regular property cache creation code, this also has to become a template function so that it can be run on the compilation units loaded from disk in the future. What is shared between the code path of a fresh compilation vs. re-use of a unit from disk is the code to propagate the CompiledData::Alias entries into entries in the property cache. The code for iterating through the component spaces and resolving the alias references is not shared. Change-Id: I04c2a5575310400156b457ae7b709cffecb7455e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Convert QQmlPropertyCacheCreator to a templateSimon Hausmann2016-06-161-23/+29
| | | | | | | | This will allow the use of it also against a QV4::CompilationUnit and assorted data structures loaded from the disk. Change-Id: I4f337d1fcf319e80e422448671476db907de6d9e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move QQmlPropertyCacheCreator implementation into the header fileSimon Hausmann2016-06-161-1/+411
| | | | | | | | | When the class becomes a template, it will have to live there anyway. By moving it separately now the diff of the template conversion becomes much easier to read. Change-Id: I0fbda26d908c928d96262bc55da20a36391a8092 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Separate non-generic code out of QQmlPropertyCacheCreatorSimon Hausmann2016-06-161-12/+18
| | | | | | | | | | Some code is not suitable for a future conversion of the class to a template, which is now moved out. This includes the tr() handling as well as the instantiation context, which does not require any parameterization. Change-Id: Ib40e24ebb7166c8649ca218f02558a737d39fe53 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove base-class dependency of QQmlPropertyCacheCreatorSimon Hausmann2016-06-161-5/+6
| | | | | | | | By not depending on QQmlCompilePass the code will be re-usable also outside of the type compiler in the future. Change-Id: I55c637886cf557d6d130c4f9325d6b0790cb2806 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor QQmlPropertyCacheCreator API cleanupSimon Hausmann2016-06-161-4/+4
| | | | | | | | | | | | As part of removing the QQmlTypeCompiler dependency, the property cache vector output of the creator is now passed explicitly as an out parameter to the constructor. Similarly the error handling is made explicit in the API instead of implicitly passing any generated errors to the QQmlTypeCompiler. Change-Id: Ia3013011518f59f57f2eecb526f64dec7d82cb91 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Small data structure cleanupSimon Hausmann2016-06-161-1/+1
| | | | | | | | | Changed the QList<QmlIR::Object*> for IR object storage to use a QVector instead, to secure the guarantee of contiguous storage in memory. This will later be useful for direct indexing. Change-Id: I3c0a5f2c346627c8436971ec1d69160865eeb22e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up property cache creation codeSimon Hausmann2016-06-161-3/+13
| | | | | | | | | | | | | | | | | | * Reduce the complexity of the recursive tree traversal by moving the base type property cache creation into a helper function and using a context to encapsulate the origin of the current traversal * ensureVMEMetaObject() had only one call site and it's easiest to inline that for now. * Transition to a new state-less error handling, so that in the future this code can be used without the QQmlTypeCompiler dependency, which will be needed for loading of compilation units from disk. * A few missing consts. Change-Id: Ibe7209c357a3c7e101fac6960ece40a033e55f72 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* File naming cleanupSimon Hausmann2016-06-151-0/+79
Separate out the property cache creation code into a standalone file. Change-Id: Ib67bb1ef72c3de70ebd1ca8cae41947cbad7bfe3 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>