aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
...
* | [new compiler] Move component determination and alias resolvingSimon Hausmann2014-01-093-44/+54
| | | | | | | | | | | | | | | | | | Move the code before the JS code generation, as we are going to need the component boundaries for the correct scoping. This requires the component and alias resolver to operate on the pre-compiled-data data structures. Change-Id: I8d2e697d8a05e5a4914db93e785704f6b2434a2e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Classify as Q_PRIMITIVE_TYPE a few private types.Sérgio Martins2014-01-092-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by clang plugin matching the criteria: - is pod / movable - sizeof(T) <= sizeof(void*) - used by QList The only case that can't be fixed is: QList<TypeCache::Iterator> in qqmltypeloader.cpp:1924 because Iterator is declared in qhash.h:349 Maybe use a QVector ... Change-Id: I9007cf43b0cf29ff39f3d2c95fb60d766c976ce7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Classify struct Use with Q_MOVABLE_TYPE.Sérgio Martins2014-01-091-0/+3
| | | | | | | | | | | | | | It's movable, private, !isLarge and used by QLists in this code. Change-Id: I08c6e7e65625aba1bc798a3911a20d6d2ddc73fb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup: change signature of Object::insertMember()Lars Knoll2014-01-0910-70/+70
| | | | | | | | | | | | | | | | | | | | | | | | Methods returning a Property pointer have to be removed, so that we can move over to store member data requiring only one value for the common case of data properties. This will in the long term reduce memory consumption on 64 bit systems quite a bit. Change-Id: I78de3794ec7b3bc5db13aa57275d3f08fa9d470a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Smaller code cleanupLars Knoll2014-01-092-24/+13
| | | | | | | | | | | | | | Move the check for isEmpty() into ArrayData::getProperty. Change-Id: I1791ced706afadbb2f45883cb1b3915f40500b71 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rework array handling for JS objectsLars Knoll2014-01-0932-799/+1295
| | | | | | | | | | | | | | | | | | Split up ArrayData into two classes, one for regular arrays, one for sparse arrays and cleanly separate the two cases. Only create array data on demand. Change-Id: I9ca8d0b53592174f213ba0f20caf93e77dba690a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fixes for argument objectsLars Knoll2014-01-094-4/+14
| | | | | | | | | | | | | | | | | | Fix a possible infinite recursion, and a corner case where we wouldn't set the correct data when writing to the argument object Change-Id: Ia64b9f62e9b881e24d74e23d96d5eb27805a126f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add Object::hasOwnProperty()Lars Knoll2014-01-095-10/+16
| | | | | | | | | | | | | | | | This allows us to remove more getOwnProperty calls. This will be required later on to extend our array handling. Change-Id: I7b7f5887990cd443accf51891644fdfbb849cf35 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-083-10/+168
|\| | | | | | | Change-Id: Ied8d65aaf57e897a3dbc4df100744a594e8ee2cf
| * V4: optimize dominator frontier storage.Erik Verbruggen2014-01-081-7/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the dominator frontier storage from a set of basic-blocks for every basic-block to a BasicBlockSet for every basic-block. This new class stores a maximum of 8 nodes in a vector, and switches to a bit vector when going beyond 8 nodes. This is important in two cases: most basic-blocks have 2-3 nodes in the frontier, and an array is faster than a set in these cases. The few cases where the frontier goes beyond 8 nodes, is when a switch statement is used with lots of cases that all fall-through. On regress-74474-003.js this reduces peak memory usage from 1.68G to 60M. The switch statement in this test results in 27000 basic-blocks. Change-Id: I42646522ba9f8642d42a5d70fc6b760bb47ae69f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Ameliorate DocumentationAlan Alpert2014-01-071-2/+3
| | | | | | | | | | | | Task-number: QTBUG-33438 Change-Id: I9187513d3b4c68d99c90726288653aae5c553a67 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * [ChangeLog][QtQml] Fix JavaScript Array.pop() not updating the internal ↵Simon Hausmann2014-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | array length correctly While the length property was reporting the correct value, the internal array length was out-of-sync. Task-number: QTBUG-35979 Change-Id: I68820a349cf1ce88c6aabc6a2301a8a861018a10 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] CleanupsSimon Hausmann2014-01-085-173/+308
| | | | | | | | | | | | | | | | Move the code that calls the main compilation passes into a separate QQmlTypeCompiler class, away from the QQmlTypeLoader. Change-Id: Ia2f33a074d7fe7d9a092ff94d1e6cfc961ad5bdb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Fix signal handlers for properties declared in the same objectSimon Hausmann2014-01-085-82/+103
| | | | | | | | | | | | | | | | | | | | | | | | We need to generate the property caches before we can try converting the signal handler expressions in the AST to function declarations, as that conversion requires looking up the signal signature / meta-data from the property cache. This in turn requires rewriting the property cache generator code to operate on the data structure we have before creating the QV4::CompiledData. Change-Id: I0d1c59d947f36171b4eb89f47a2e1ff1bc493c6f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Fix assigning signal handlersSimon Hausmann2014-01-081-1/+4
| | | | | | | | | | | | | | | | When assigning a signal handler to the fooChanged property, we need to look up fooChanged as signal function, not as data property. Change-Id: I4c0e4374cea8ce9596428975e45e78a0b743a6fc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Initial support for custom parsersSimon Hausmann2014-01-089-10/+117
| | | | | | | | | | | | | | | | Enough to support the Connections {} element. What's missing are pre-compiled bindings signal handlers. Change-Id: I3ad1413fa636434d899ae8fb380249aaf40363dc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Preliminary support for QQmlIncubatorSimon Hausmann2014-01-086-10/+44
| | | | | | | | | | | | | | | | Just enough to run some unit tests that use QQuickLoader, components are created instantly. Change-Id: I1c827aa946d3e2a60ccc220bb79572aca2ed8c96 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Fix determination of id objects within component boundariesSimon Hausmann2014-01-062-28/+22
| | | | | | | | | | | | | | | | | | | | | | Don't draw the boundaries at Component {} level but at the level of the element inside the Component, so that we can still get the id of the Component element itself within the surrounding scope. Also removed unused data structure. Change-Id: I29e086e92f0310a38ba0a71224329f7399b397b2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Add support for parser status callbacksSimon Hausmann2014-01-063-0/+41
| | | | | | | | | | Change-Id: I62ce1fab2537d533d1d2052a7f5edc5061adf75e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Clean up handling of illegal names and enable in new compilerSimon Hausmann2014-01-066-31/+24
| | | | | | | | | | | | | | | | | | | | Access to the identifier hash may not be thread-safe from the loader thread, so use a QSet copy instead (which is cheap because we don't detach). This also enables the checking for illegal types again. Change-Id: I8c3ec1fd0fc01cce3269e206f479a90bdbbc89dd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-0619-210/+241
|\| | | | | | | Change-Id: If9a205bea219b9aca95d78b1e556ca9bbff58dd0
| * Remove unused static functions from QtQml found by Clang 3.4Thiago Macieira2014-01-041-28/+0
| | | | | | | | | | | | | | qqmlcomponent.cpp:112:23: error: unused function 'buildTypeNameForDebug' [-Werror,-Wunused-function] Change-Id: I5cc82b20fee8e3f0b61ad59b831723359c8dcda4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Also fix the unused variable warning that ICC found with ClangThiago Macieira2014-01-041-0/+2
| | | | | | | | | | | | | | | | | | | | The ICC fix happened on e02cb2b31ab0b171f11d278305d9f532f005bc80. This now fixes for Clang 3.4: cached-powers.cc:134:18: warning: unused variable 'kCachedPowersLength' [-Wunused-const-variable] Change-Id: I876d9d5cf43fb7eb76117d6fdc37265295c360df Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Fix property access to QQmlPropertyMap objects when addressed via idSimon Hausmann2014-01-022-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Property access to id objects is optimized at compile time, but we cannot do that for QQmlPropertyMap instances (or generally fully dynamic types). This issue was a regression against Qt 5.1 Task-number: QTBUG-35906 Change-Id: I759a1a899f6a3a1f6466282f455b289ad7451086 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix lookups of enums in singletonsSimon Hausmann2014-01-021-35/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression against 5.2.0 (which didn't have this bug), due to optimizations introduced in the stable branch after the release. The code path for optimizing access to the members of C++ based singletons through the regular meta-object properties would end up excluding access to enums when the lookup happens at run-time. The run-time getter for the singleton itself would return a wrapped QObject instead of a QQmlTypeWrapper, and only the latter includes enums. As QML based singletons (composite singletons) cannot declare enums, we can continue to do fast lookups on these, but otherwise have to fall back to the slower code path. Task-number: QTBUG-35721 Change-Id: Icc66bdaf3572622cdb718f82b706e3204afa0167 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * V4: remove class field in DominatorTree that was used only once.Erik Verbruggen2014-01-021-21/+18
| | | | | | | | | | | | | | | | | | Calculation of all the children of nodes in the dominator tree is now calculated as a local variable right before computing the dominator frontier. The effect is that they are not retained after their only use. Change-Id: I83c962c691b78cb767708eb04cf30d3b7a760deb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * V4 IR: do not add unconditional jumps to work listsErik Verbruggen2014-01-021-1/+4
| | | | | | | | | | | | | | | | | | | | Both type inference and the optimization pass do not do anything with unconditional jumps. So, instead of adding them to the worklist and later on removing them again, it’s faster to never add them in the first place. Change-Id: Ib81d43e9ea6df2b1a70e9dd1e9b9c29cb6d345d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * V4 IR: change datastructures for dominator calculations.Erik Verbruggen2014-01-021-112/+172
| | | | | | | | | | | | | | | | Replace hashes from basic-block to basic-block with vectors that associate basic-block index to basic-block index. Change-Id: I834ea3d825e4d2b02c075b1b0f080f5a65f41317 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
| * Doc: Fix broken linksSze Howe Koh2013-12-3014-24/+25
| | | | | | | | | | Change-Id: I4c4577edde96978a986606bf30fbb925f871bd42 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Move array data into it's own structLars Knoll2014-01-0315-333/+336
| | | | | | | | | | | | | | First step of separating the array data from Object. Change-Id: I5c857397f0ef53cff0807debdb1e405424e1046a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of the nonStrictArgumentsObject flag in ManagedLars Knoll2014-01-036-9/+10
| | | | | | | | | | Change-Id: I4ac58e9d87506ae930c2e44e6089f4af3cd9ccb2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Use the flags to check whether a Managed is of a certain typeLars Knoll2014-01-032-6/+5
| | | | | | | | | | Change-Id: I740c4b7e26bdb9d9f40c1c46615cc68f679e036f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix compiler warning about wrong reinterpret_castLars Knoll2014-01-031-4/+4
| | | | | | | | | | | | | | | | | | No need to use reinterpret_cast's in the type checking for the Managed casting. A static cast works just as well (as it's actually used two lines further down). Change-Id: Ie531098eddddda7e9f151eaedc136cbeab14f473 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move Managed::type and some flags into the vtableLars Knoll2014-01-0332-82/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | Move the type flag into the vtable to free up these bits in the Managed class, and not have to set them at object construction time. As we often need to know whether a Managed object is a Object, FunctionObject or String, add some bitflags to test for these to the vtable. Change-Id: I7d08ca044544debb307b55f124f34cb086ad9e84 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Clear out memory in the GC, not when constructing objectsLars Knoll2014-01-032-4/+2
| | | | | | | | | | | | | | | | Object construction shouldn't need to zero initialize itself, let's rather do this in the GC, where we can use fast memset's. Change-Id: I2f9efa1729183b0d737de5a84f92af319b2c5631 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Do not call InternalClass::changeVTable directlyLars Knoll2014-01-032-4/+6
| | | | | | | | | | | | | | | | vtable changes need to happen when the internal class is being constructed, not later on. Change-Id: Ibb9515745c9fc3507a5a90b4cc50a33e2e0d3f99 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Simon Hausmann2013-12-245-22/+53
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-245-22/+53
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickrectangle.cpp Change-Id: Ia40bc0f2f08b5be68e32eb1e1f118445d20e44fc
| | * Doc: Fixed a few broken links and snippetsVenu2013-12-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Couple of \snippet references in the ListModel docs were pointing to files outside the exampledirs boundary. Update those references to use the relative path. Change-Id: Ibf9d0fda9e5280345b08cb66a4fe0db9142a42a6 Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| | * use private linkage where possibleOswald Buddenhagen2013-12-191-1/+1
| | | | | | | | | | | | | | | Change-Id: I1f51b7d043f49f2f2849eb370ac71366cbaa6da5 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| | * V4 SSA: add some more literature references.Erik Verbruggen2013-12-191-5/+13
| | | | | | | | | | | | | | | | | | | | | Also fixed some comments. Change-Id: I4aedff84bdbf8de248025bc48805a859704bdd8a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| | * Fix deadlock when QQmlEngine is destroyed during compilation.Andrew den Exter2013-12-191-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before blocking to wait for the thread to finish ensure the thread itself is not waiting for the main thread to complete some action otherwise both threads will be waiting on the same wait condition that neither is able to wake. Likewise ensure the shutdown action is processed if the last scheduled event is currently being processed. Task-number: QTBUG-35581 Change-Id: I483fc56d0d398493f9fa907f3ab203439bfb9221 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| | * Fixes: qml memory corruption on Androidaavit2013-12-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Bionic pthreads reports too small stack size for main thread. Change-Id: I3d33229e76101a847309c723d534844ffb2d2042 Reviewed-by: Andy Nichols <andy.nichols@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Change C++ parameter type used for var parameters in QML declared signalsSimon Hausmann2013-12-242-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | "signal someSignal(var foo)" mapped to foo being of type QVariant. Unfortunately that is a "lossy" type and it cannot represent all JavaScript values, including for example function closures (as reported in the JIRA bug). Instead we should use QJSValue. It is an important behavioural change because it affects the presumably rare case of somebody declaring a signal in QML with such a parameter and connect to it from C++ (or trying to emit it) - in that situation the code needs to be changed. Task-number: QTBUG-35171 Change-Id: I4fb4a18b407e4ea6c28a3a297fc6f76edb76d734 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-16106-1193/+2129
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp src/quick/items/qquicktext.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I0bc5786098193c2c40b6fd8905de75d90f6ed0cf
| * Doc: Made copy of the QML files in the snippets directoryVenu2013-12-133-3/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Delegate.qml and view.qml files were not in the scope of Qt QML exampledirs. These files were in the example directory under quick, so had to make of copy of them in the snippets directory and update the snippet path to get the snippets in the html output. Task-number: QTBUG-35445 Change-Id: Ic3fa19dbd36b91d76fbc497ab524f5c0ff91325f Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| * V4 IR: change block scheduling algorithm from recursive to iterative.Erik Verbruggen2013-12-121-102/+189
| | | | | | | | | | | | | | | | This makes time- and memory-complexity a lot better when compiling big JavaScript functions. Change-Id: I2a7cb9b5979844254747fa5cf7355cca0b113904 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-1211-15/+17
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlcompiler.cpp Change-Id: I802731139d47c5b733dd805f7bf432d67d7331e1
| | * Fix a crash in JSON.parseLars Knoll2013-12-041-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properly set members that are actually array indices and don't crash when trying to set those. Task-number: QTBUG-35383 Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| | * QQmlImport: Don't try use a dangling pointer.Robin Burchell2013-12-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | toUtf8 would return a temporary, and constData would hold a pointer inside that temporary. This isn't even remotely safe. Move the pointer use down to the initializeEngine call so it is kept around long enough for us to do our stuff. This is a backport of cf51cdb8fb002ae3602a4c886e7c67913d77373a. Task-number: QTBUG-35355 Task-number: QTBUG-35343 Change-Id: I338ad7f4d4137445ed9a311a293ea82bf023aafd Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@digia.com>