aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4argumentsobject.cpp src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4errorobject.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4managed.cpp src/qml/jsruntime/qv4managed_p.h src/qml/jsruntime/qv4object.cpp src/qml/jsruntime/qv4object_p.h src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4heap_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/memory/qv4mmdefs_p.h src/quick/scenegraph/util/qsgdistancefieldutil.cpp src/quick/scenegraph/util/qsgdistancefieldutil_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
* | Separate the stack used for GC from the regular JS stackLars Knoll2017-04-071-4/+4
| | | | | | | | | | | | | | | | This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Go through proper set() functions when writing to MemberDataLars Knoll2017-03-091-26/+28
| | | | | | | | | | | | | | | | This is required, so we only have to add the write barrier in one place. Change-Id: I4e8bde823b30ad18f043312ac3f1ed46597b91a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Unify mark handling for MemberData and ArrayDataLars Knoll2017-03-091-1/+1
|/ | | | | | | | Introduce a ValueArray class, that defines an array of Values at the end of a Heap Object. Change-Id: I00efbf6f5839a6687dd5bc5fc037ec8f06e0936e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Ensure that we never create empty MemberData objectsLars Knoll2017-01-251-3/+6
| | | | | | | | | | They don't make sense. Also fixes a crash in test262, where we would pass n == 0 to MemberData::allocate(). Change-Id: Ia95ab6632bd1998afe84a38c38c3c6603230362d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Clean up Value::isString()/stringValue() combinationsLars Knoll2016-11-291-3/+3
| | | | | | | | | | | | | | | | It's enough to just call stringValue(), as that already does the isString() check. Change-Id: I7be0e643a7975c0704b4c9c43b337deb8db9fce0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-21/+21
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * QML: Move the ScarceResourceData from VariantObject onto the heapErik Verbruggen2016-10-051-21/+21
| | | | | | | | | | | | | | So now VariantObject is nearly a trivial struct. Change-Id: Ifc54c04d9686c03e12066c5287823dd3b1315d2a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlVMEMetaObject: mark some methods as constAnton Kudryavtsev2016-10-171-17/+17
|/ | | | | | | These methods do not modify the object. Change-Id: Ide75590ee78cdc27652d9d88120197da5b40b0c8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* winrt: Fix crash on ARM in release modeMaurice Kalinowski2016-09-281-0/+6
| | | | | | | | | | The compiler seems to mis-optimize the switch/case statements causing a QString construction to end up in handling a QUrl and behaving unpredictable from there (crashes for some example). Change-Id: Idd2b6b64f1f41d0aa9204dd73dfdf7f5d0541798 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Make all fields in QQmlPropertyRawData privateErik Verbruggen2016-08-101-4/+4
| | | | | | | | 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>
* Qml: optimize string usageAnton Kudryavtsev2016-08-091-4/+4
| | | | | | | | | | Use QStringBuilder more. Use QString::asprintf instead of arg()'s chain. Use += operator to reserve extra capacity for possible free following append/prepend/+= call. Change-Id: Ib65398b91566994339d2c4bbfaf94e49806b7471 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QML: Introduce QQmlPropertyIndexErik Verbruggen2016-08-041-12/+14
| | | | | | | | 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>
* QML: Unify property reads/writes and use accessorsErik Verbruggen2016-07-251-3/+3
| | | | | | | | | Pass property reads/writes through utility functions in QQmlProperty, which in turn will try to use accessors when available (and no interceptors have to be called). Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix alias resolution algorithmSimon Hausmann2016-07-151-0/+3
| | | | | | | | | | | The resolution of aliases needs to to be solved in iterations as an alias can refer to another alias, which may not be created yet in the property cache by the time we try to perform the resolution. Therefore the alias resolution code works off a list of pending aliases after the initial pass of resolution. This also requires the ability to detect circular references. Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix endian support in compiled data structuresSimon Hausmann2016-07-141-1/+1
| | | | | | | | | | | | The goal is to make the compiled data structures persistent on disk. In order to make it possible to create these data structures on a "host" system that may have a different endianness than the target system, we now make all the word sized fields little-endian. The template wrappers from QJson provide zero-overhead access for little-endian machines (the vast majority) while maintaining a large degree of source compatibility. Change-Id: I3d30da1fcf3bffb98dbe9337d3a35482fb7b57c8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Pass scope around as parameters inside the runtime.Erik Verbruggen2016-06-221-3/+2
| | | | | | | | | | | | | | | | The implementation of many (or all) runtime functions consist of first creating a QV4::Scope, which saves and restores the JS stack pointer. It also prevents tail-calls because of that restoring behavior. In many cases it suffices to do that at the entry-point of the runtime. The return value of a JS function call is now also stored in the scope. Previously, all return values were stored in a ScopedValue, got loaded on return, and immediately stored in another ScopedValue in the caller. This resulted in a lot of stores, where now there is only one store needed, and no extra ScopedValue for every function. Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Clean up property cache reference counting in QQmlVMEMetaObjectSimon Hausmann2016-06-031-4/+0
| | | | | | | | | | | | | | | | When the intercepting functionality of the VME meta-object was split into the QQmlInterceptorMetaObject the property cache was moved as a member but the manual refcounting remained in the QQmlVMEMetaObject constructor and destructor. That's fragile and potential future sub-classes of the interceptor would have to do the same refcounting. Instead let's just store a QQmlRefPointer in the right place. Similar logic applies to the QQmlDesignerMetaObject, which had a copy of the property cache for now aparent reason. Change-Id: I7f6d3917fc5ef1c4beb065525be10bb9c0fadcf3 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QQmlVMEMetaDataSimon Hausmann2016-05-241-3/+2
| | | | | | | | | | | It is unused now and we can remove it as well as its QByteArray based storage. The non-emptyness of the meta-data QByteArray was also used to indicate whether it is necessary to create a VME meta-object when instantiating an object. This bit is now folded into the flag of the QFlagPointer storing the property caches. Change-Id: I3c3604c61ff16a4e76912e68b1c19afdb0f2bd9d Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Get rid of QQmlVMEMetaData::AliasDataSimon Hausmann2016-05-241-3/+11
| | | | | | | | | The remaining signal index for the changed signal of the alias target is something that we need only once (when doing the initial alias endpoint connection) and then we can retrieve it from the property cache. Change-Id: Ifbd4625f9af3ca00c9b916eee5c82f58450d54ef Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devSimon Hausmann2016-05-241-3/+5
|\
| * Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-241-3/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine_p.h src/qml/jsruntime/qv4runtime_p.h src/qml/qml/qqmldelayedcallqueue.cpp src/qml/qml/qqmlvaluetypewrapper.cpp src/qml/qml/qqmlvmemetaobject.cpp src/qml/qml/v8/qv8engine_p.h tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I3f0608c7beb88088cbbef4d0db59920f56deaea9
| | * V4: allow inlining of ExecutionEngine::{qml,js}Engine()Erik Verbruggen2016-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | All other changes are just to be able to include qv8engine_p.h in qv4engine_p.h Change-Id: I71ba2ec42cdc20d5c7d97a74b99b4d1ada1a5ed8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-3/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4engine_p.h Change-Id: I89ffccd699bee675732758d039e22224b275d60d
| | | * Fix warning about mixing basic font type's pointSize and pixelSizeMitch Curtis2016-05-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We didn't properly read the font property of TextFieldStyle (which is declared in QML) before writing the pointSize property (see bug report), so it was using the value of a previous assignment. Change-Id: I7746c258d1f3a6e031583da7f007bd0dc4087082 Task-number: QTBUG-52920 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | | Fold QQmlVMEMetaData::Alias::flags into QV4::CompiledData::Alias::flagsSimon Hausmann2016-05-241-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need one bit, so this is easy to merge. Change-Id: I98bf882b8c1bf10f2172a9e22331d621985d3ed4 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | | Shrink QQmlVMEMetaData::AliasDataSimon Hausmann2016-05-241-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can retrieve the alias property index from the QV4::CompiledData::Alias and the property type from the property cache (only needed for aliases to value types). Change-Id: Ibf0cb909a4cd1ce1c2d67b57e1be1de491d4d598 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | | Remove QQmlVMEMetaData::AliasData::contextIdxSimon Hausmann2016-05-231-6/+10
|/ / / | | | | | | | | | | | | | | | | | | We can store the id (in QQmlContextData::idValues) for the alias target in the QV4::CompiledData::Alias. Change-Id: I3f32648aef28d96ddedff6b3d2cde75969a46fa1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Shrink QQmlVMEMetaDataSimon Hausmann2016-05-231-30/+42
| | | | | | | | | | | | | | | | | | | | | | | | The count of properties, aliases, signals and methods is also accessible through CompiledData::Object. Change-Id: I4693ea672b643cdaabf752c3f0d71abdcc032395 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Simplify VME meta object meta-dataSimon Hausmann2016-05-231-59/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For each type of VME meta object we store an array of integers holding the meta-type ids of the QML declared properties. We can replace that array with access to the QV4::CompiledData::Property entry for each property, where the type is also accessible. This is a fairly straight-forward change, except for the bit in QV4::CompilationUnit where we delay the release of the CompiledData::Unit and friends until the destructor instead of releasing it at unlink time. That should be a safe change and is necessary as there are a few tests around where the VME meta object still needs access to this meta-data at a very late stage in the life-cycle right before the deferred deletion is run. Change-Id: I431de15d12766df837c0e0251192df16a5a76868 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Minor optimization for VME meta objectsSimon Hausmann2016-05-201-73/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing the methods of a qml object in an array of persistents, let's just store them in the same member data array we also use for properties. That reduces the amount of persistents and saves one pointer per instance. Change-Id: I1ad1d9ec76b78fce01bc6ded7eaf536cb99dd245 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | VME Method object data cleanupSimon Hausmann2016-05-191-20/+3
| | | | | | | | | | | | | | | | | | | | | Get rid of the redundant MethodData meta-data that is stored per-type. Change-Id: I9faa284bdd0c9f0c9ebb3c66905ab5e34a9ee3a4 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Minor VME meta object context handling cleanupSimon Hausmann2016-05-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | There is no need to go through the public QQmlContext in order to retrieve the QQmlContextData the QQmlVMEMetaObject is associated with. Change-Id: I648454c217fa594d4017c3af67848eacab55edfc Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Remove helpers from the public interfaceFrank Meerkoetter2016-03-151-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | There is no good reason to have them in the public interface. Reducing the visibility to the translation unit. Change-Id: I79eb8450e17c199625b6c057df6976c26daa5a39 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Remove dead codeFrank Meerkoetter2016-03-151-5/+0
| | | | | | | | | | | | | | | Change-Id: I1d7c1571d63653d259f1c5aba53412f9a157083c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Replace loop with std::fillFrank Meerkoetter2016-03-151-2/+1
|/ / | | | | | | | | Change-Id: Ia44de744b5cebb774befa462029deed9cab5239d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-15/+21
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-101-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h tests/auto/quick/qquicklistview/tst_qquicklistview.cpp tests/auto/quick/qquicktextedit/qquicktextedit.pro tests/auto/quick/qquicktextinput/qquicktextinput.pro Change-Id: I95d2c20a8619e5b8fa361c941a16dd8dce3e04e7
| * Fix value changed logic for ValueTypeProvider typesFrank Meerkoetter2016-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix broken value changed logic for types implemented through the ValueTypeProvider interface (QtQuick and Qt3d). It affects vector2d, vector3d, ... The signal was not emitted for the cases where the new value was equal to the default value of a given type. Also add a unit test to cover this area. Change-Id: I9491b0462c78fecc4c704ea36921611c1bd6b2ee Task-number: QTBUG-50204 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-071-95/+131
|\| | | | | | | Change-Id: Ica75a71062d0613e415f2433c5c22c2e251b37cd
| * Make property interceptors work on alias properties againLars Knoll2015-11-261-95/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a regression introduced by change 01c0c0963794f4dd8c3601e8340cc3dc4dec41bd, where interceptors wouldn't work correctly on alias properties. This required some refactoring and splitting out the interceptor handling from the VMEMO into it's own class, as we are now installing bindings directly on the target property of an alias and not on the alias anymore. We now resolve the target property inside the QML object creator and install a interceptor metaobject on the target if required where we can then register the interceptor. Change-Id: I3ebc8f492ce5dcab7acf901711b47336d5182ffa Task-number: QTBUG-49072 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-85/+84
|\| | | | | | | Change-Id: I11ea57222ba5aa683b7bfd7735fbc1d2cf86e875
| * qqmlvmemetaobject.cpp: Fix conversion warning by MSVC2015/64.Friedemann Kleint2015-10-051-1/+1
| | | | | | | | | | | | | | qml\qqmlvmemetaobject.cpp(620): warning C4312: 'reinterpret_cast': conversion from 'int' to 'quintptr *' of greater size Change-Id: Ic24caf32b82b06bce04f4d4917efdf303be68444 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * CleanupsLars Knoll2015-09-251-18/+3
| | | | | | | | | | | | | | Remove some unused code Change-Id: I1d6612649cf279834f9ce92da60a85495389555e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Get rid of the special handling of list properties in the vmemoLars Knoll2015-09-251-15/+31
| | | | | | | | | | | | | | | | | | There's no need to store the list properties separate from other property data in the vmemo, simply wrap the list in a QVariant as we do with the other more complex types. Change-Id: I7c7946503cb603c401e11a367986c6923dffe68f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * CleanupLars Knoll2015-09-251-13/+14
| | | | | | | | | | | | | | | | | | Restructure code to make the flow more obvious and avoid executing code that is afterwards being ignored for list properties. Change-Id: I1b21562d48cec34ecb722f9012166926d55e4724 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Get rid of the aConnected bit array in the vmemoLars Knoll2015-09-251-14/+12
| | | | | | | | | | | | | | | | We can track the state just as easily by simply checking if the endpoints metaobject is already set. Change-Id: I5cea909b2525bf37d404f6d54ead2bdf9538cff4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Properly refcount the property cacheLars Knoll2015-09-251-0/+4
| | | | | | | | | | Change-Id: Ia37d4a5e64b653c9af614ed633c3c443190d015a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Cleanups to property allocation in the VMEMOLars Knoll2015-09-251-29/+24
| | | | | | | | | | | | | | | | There's no need for a separate propertiesAllocated bool, we can keep that state in the WeakValue itself. Change-Id: Ife0f517bee9bc5830680eec68983767379a3c2cf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>