aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Simplify ObjectIterator::nextLars Knoll2018-08-045-71/+38
| | | | | | | Use PropertyKey instead of two out pointers Change-Id: I4f57bcb36fd412f19f0ed116042f7b094b5785dc Reviewed-by: Simon Hausmann <[email protected]>
* Adapt to QMetaObject::d internal changesThiago Macieira2018-08-041-1/+1
| | | | | | | | qtbase is changing the type of the QMetaObject pointers to use a wrapper class. Change-Id: Id2be776c7ae0467c9d9ffffd15431f7b1b005c09 Reviewed-by: Simon Hausmann <[email protected]>
* Fix crash in ↵Simon Hausmann2018-08-031-1/+2
| | | | | | | | | | | | | language/statements/class/syntax/class-body-method-definition-super-property.js with JIT CallValue was changed to pass undefined as the this object, instead of a null pointer. This also needs to be done from the other call site used by the JIT, Runtime::method_callValue. Amends commit d31541fd9d7d52ef3eae29e7e5d36733d7f55375 Change-Id: I0e2c2542ae96a88bb7e6e24d012f7f7fe72aeb80 Reviewed-by: Lars Knoll <[email protected]>
* Fix crash of language/expressions/object/setter-super-prop.js with JITSimon Hausmann2018-08-031-1/+1
| | | | | | | | | | | Generally super.foo = bar calls the storeSuperProperty run-time method, which expects the engine as the first parameter, not the function pointer. Amends commit d31541fd9d7d52ef3eae29e7e5d36733d7f55375 Change-Id: Ic0c933e855066273a635fe62ad88316c75cb8f45 Reviewed-by: Lars Knoll <[email protected]>
* Fix language/expressions/class/scope-name-lex-close.js crashing with the JITSimon Hausmann2018-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | With a reduced test case like this: var C = 'outside'; var cls = class C { method() { return C; } }; cls.prototype the class expression is expected to return the reference to the class in the accumulator, so that the cls = assignment can store it. Between that we have to deal with the {} block, a ControlFlowBlock instances in the code generator. That one will - among other things - issue a PopContext instruction after the class creation instruction. With the JIT that clobbers the accumulator unfortunately, causing a bogus value being stored in the global object under "cls". Consequently the lookup for "cls" crashes. Change-Id: I6056b352f9d8f42fa65afe4aefcd233c3ccf31ab Reviewed-by: Lars Knoll <[email protected]>
* Minor cleanup in CompilationUnit::linkToEngineSimon Hausmann2018-08-032-27/+20
| | | | | | | | | This is the only call-site for linkBackendToEngine, which used to be a virtual function. There's no need anymore for an indirection, so we can inline the code. Change-Id: I79fe3d5a9c65cc8c05f108065017465270999de1 Reviewed-by: Lars Knoll <[email protected]>
* Preview: Use QTranslator::install(QLocale, ...)Kai Koehne2018-08-034-6/+6
| | | | | | | | | | | | See commit e6f6c4aee6951a for the matching change in QQmlApplicationEngine. Also needed to adapt the autotests, since qt_QT is not (yet) a valid locale. Task-number: QTBUG-69196 Change-Id: If92156abbb3e20042a934b8150a8f456d8f770b6 Reviewed-by: Simon Hausmann <[email protected]>
* Implement ObjectIterator using the new iteration mechanismLars Knoll2018-08-0218-346/+23
| | | | | | | And with that get rid of the old advanceIterator methods. Change-Id: I969fa89d25df8992a4b08c8c081b91c92ffdfddd Reviewed-by: Simon Hausmann <[email protected]>
* Remove support for iterating over the proto chain from ObjectIteratorLars Knoll2018-08-026-11/+7
| | | | | | | | | This will simplify moving over to the new iteration model. It implies a very small behavioral change in a few places where we used to iterate over the proto chain before. Change-Id: Ia62c9c51712d6b45e69ca63becdbefab6fa4bf3f Reviewed-by: Simon Hausmann <[email protected]>
* Introduce a new mechanism to iterate over object propertiesLars Knoll2018-08-0225-117/+547
| | | | | | | | | | | | | | | | | The old advanceIterator schema was extremely ugly and in addition not flexible enough to support the requirements for Proxy.ownKeys and some of the methods in Object Implemented a new scheme through a OwnPropertyKeys method in the Object VTable that creates and returns an iterator object. Ported QJSValueIterator and for-in to use the new mechanism. There's still many places where we use the old ObjectIterator (that relies on advanceIterator). Those will be ported in subsequent commits. Change-Id: I091a9bea9ff6b2b63630cc336814700757a718be Reviewed-by: Simon Hausmann <[email protected]>
* Fix a memory leak when GC'ing Symbol objectsLars Knoll2018-08-021-1/+1
| | | | | Change-Id: I8c4e5433be8a6306ace36393131245e846efa6ba Reviewed-by: Simon Hausmann <[email protected]>
* Fix some spec incompatibilities in Object.prototypeLars Knoll2018-08-021-8/+8
| | | | | Change-Id: I5f0533a443404276ebc79fc8a1fbb33bda38556f Reviewed-by: Simon Hausmann <[email protected]>
* Fix writing to properties of primitive dataLars Knoll2018-08-023-4/+20
| | | | | | | | In strict mode, this should throw a type error and not do an implicit toObject conversion. Change-Id: I7b8cdf1125978b9d9a047d9da84f23b547cb4a75 Reviewed-by: Simon Hausmann <[email protected]>
* Fix a couple of test failures related to error objectsLars Knoll2018-08-023-21/+27
| | | | | | | | Set up the prototype chain for error objects correctly, and make them inherit from the right classes. Change-Id: I7bb12b3bb285950a1bff25e5c62954287a95970a Reviewed-by: Simon Hausmann <[email protected]>
* Let axis bounds restrict the target position instead of the centroidJan Arve Sæther2018-08-021-7/+6
| | | | | Change-Id: I09442cfd5ea1e3bee06dd448118f2f42bedb2760 Reviewed-by: Shawn Rutledge <[email protected]>
* MultiPointHandler::wantsPointerEvent: reset if different cand countShawn Rutledge2018-08-022-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always intended to "start over" with event delivery when the number of touchpoints changes. Change 48011c2dfeb83b4fe717034d4b3c353714fead48 began this process, but in addition to QQuickWindow delivering the event to all items and their handlers in reverse paint order, ignoring existing grabs, the handlers themselves have responsibility to act as if it was an initial press whenever the number of relevant touchpoints changes; and because QQuickWindow starts over, handlers do not need to rely on passive grabs to retain interest in one point at the time when a transition to a different number of points occurs. For example, DragHandler by default handles just one point, so if you press one point such that it takes a passive grab and adds that point to m_currentPoints, then you press a second finger within the bounds of the same parentItem, the DragHandler should not go on "wanting" the first point anymore, because a two-finger gesture is different, and not suitable for the DragHandler unless its maximumPointCount >= 2. Even if the second point is released, QQuickWindow will "start over" with delivery, so a multi-point handler does not need to rely on retaining a passive grab to handle the transition from two points back to one again. This also helps enable smoother transitions between different gestures: e.g. in the map.qml manual test, you can drag one finger and transition from dragging to pinching and back while the second finger is pressed, dragged and released. Change-Id: Id9b8f30029ed1ff9fd2d64a5e413a47055622083 Reviewed-by: Jan Arve Sæther <[email protected]>
* Make pinch handler not activate on draggingJan Arve Sæther2018-08-022-5/+108
| | | | | | | | | | | | | | ..when dragging (translation) is disabled In order to do this, we had to integrate QQuickAxis to the PinchHandler which allows enabling/disabling x and y axis individually. This allows us to have one item with PinchHandler with translation disabled (but to only handle rotate and scale) together with a two-finger drag handler. Change-Id: I1581c575ffba2e5d007163bec36e5699bdd86cbc Reviewed-by: Shawn Rutledge <[email protected]>
* QQmlTableInstanceModel: handle model data changes more gracefullyRichard Moe Gustavsen2018-08-024-11/+21
| | | | | | | | | | | | | Equal to QQmlDelegateModel, we need to listen for changes done to existing model items, and notify existing delegate items about it. Otherwise, they will not stay in sync with the model. By accident, this sort of worked in QQuickTableView already, since it would rebuild the whole table for every model update. This is really slow, and completely unnecessary. Change-Id: I10750ff387f8b455d0f27c50a17926d9beb6dd03 Reviewed-by: Mitch Curtis <[email protected]>
* TableView: don't try to grab the window when it's nullMitch Curtis2018-08-021-1/+1
| | | | | | | Task-number: QTBUG-69554 Change-Id: If094f213bf4daa383f8a5fd0ed22ad8100ab0675 Reviewed-by: Paul Wicking <[email protected]> Reviewed-by: Frederik Gladhorn <[email protected]>
* QQmlTableInstanceModel: implement support for reusing delegate itemsRichard Moe Gustavsen2018-08-024-47/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will make it possible for TableView to reuse delegate items. The API lets TableView (or any kind of view in theory) specify if an item is reusable at the time the item is released. Reusing delegate items is specified per item, meaning that the view can choose to release some items as reusable, but others not. If the view never releases any items as reusable, no items will be added to the pool, and hence, no items will be reused. If the view releases an item as reusable, the model will move it to the reuse pool rather than destroying it (if the items ref-count is zero, and not persisted). The next time the view asks the model for a new item, the model will first check if the pool already contains an item, and if so, use it. Otherwise it will create a new item, like before. Items in the pool are supposed to rest there for a short while. Ideally only from the time items are flicked out on one side of the view, until we reuse them when new items are flicked in on the oppsite side. One big reason for this is that we have no way of hibernating items in QML, so they will effectively stay alive while inside the pool. This is not ideal, but still a huge performance improvement over what we had before, where all items are always created from scratch. If hibernating objects will ever be possible, it should be easy to extends the current logic to take advantage of this. Already existing tests for QQuickTableView should verify that no regressions are introduced with this patch. Since recycling of items is driven from the view, auto tests for this functionality is included with the patch for implementing reuse support in TableView (coming in a subsequent patch). Change-Id: I28aa687251ce3e7e1de0b1c799fdbf44d8867d45 Reviewed-by: Mitch Curtis <[email protected]>
* QQuickTableView: implement support for reusing delegate itemsRichard Moe Gustavsen2018-08-023-9/+88
| | | | | | | | | | | | | | | | | | | | | | | | This patch will make use of the recent changes in QQmlTableInstanceModel to support reusing delegate items. The API in TableView to enable this will mainly be a new property "reuseItems". This property is true by default. By setting it to false, reusing items will never happen. When an item is reused, the signal "TableView.reused" is emitted after the fact, in case the delegate item needs to execute some extra code during the process. Likewise, a signal "TableView.pooled" is emitted when the item is pooled. From an implementation point of view, TableView only need to do two things to enable reusing of items. First, whenever it releases items, it provides a second argument to release(), informing QQmlTableInstanceModel if the item can be reused. Second, it needs to call drainReusePool() at appropriate times to ensure that no item will be kept alive in the pool for too long. Change-Id: I830e2eace776302ac58946733566208aa8954159 Reviewed-by: Mitch Curtis <[email protected]>
* Fix grammar for ES modulesLars Knoll2018-08-023-5/+7
| | | | | | | | | | | | * Always parse 'import' as a keyword, as it is now one in Qml and ES. * Always parse 'as' as keyword but allow it as identifier using the same trick as for the other keywords. This fixes basic import statements such as import "foo.mjs" as bar but still allows funny variations such as import "foo.mjs" as as. Change-Id: I76a600aab90c1b5c07d079bf11b0a78742d44c53 Reviewed-by: Lars Knoll <[email protected]>
* Fix typoLars Knoll2018-08-011-4/+4
| | | | | Change-Id: Iad064b97010548304e37ad6592712d585d2885a3 Reviewed-by: Simon Hausmann <[email protected]>
* Smaller grammar cleanupLars Knoll2018-08-011-16/+2
| | | | | Change-Id: Ic0b70e9b2c6f656a8abdf408013201625045ac65 Reviewed-by: Simon Hausmann <[email protected]>
* Simplify parsing of pragma directivesLars Knoll2018-08-018-105/+14
| | | | | | | | We only support 'pragma Singleton' currently, so there is no need to parse the right hand side of pragma as a member expression. Change-Id: Ic0dcbedb52cb58db2fd1cc099f14fd399b7162e3 Reviewed-by: Simon Hausmann <[email protected]>
* Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Simon Hausmann2018-08-014-11/+66
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-014-11/+66
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I654a2a4b34dadc7cb7d85625b86f54691ad5904a
| | * Doc: Use [] instead of new Array() in snippetPaul Wicking2018-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes warning about using new Array() as constructor with the snippet in Qt Creator. Task-number: QTBUG-65891 Change-Id: I858601c21d703e4226db4f4c4d9ef52ec6418ed8 Reviewed-by: Nico Vertriest <[email protected]> Reviewed-by: Mitch Curtis <[email protected]>
| | * Fix build without GUI moduleSamuli Piippo2018-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick has a dependency to gui, but there is no way to disable an entire configure module from the configure system. Add module checks to configure.json so that it passes even without the gui module present. Fixes "Unknown feature object movie in expression 'features.movie'." Task-number: QTBUG-56656 Change-Id: I16355b7e218c32cab33e8ef9a6012da3e55656bb Reviewed-by: Oswald Buddenhagen <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
| | * Doc: Extend ItemSelectionModel QML documentationPaul Wicking2018-07-301-4/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change provides a bare minimum documentation for the ItemSelectionModel QML type. Task-number: QTBUG-58090 Change-Id: I0e232f8e05e7629d6f573f8dce21154d0ec307e5 Reviewed-by: Topi Reiniö <[email protected]>
| | * Doc: Add precision to scene graph descriptionPaul Wicking2018-07-301-4/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-60913 Change-Id: I3a9d8925337a12a849e39a70f168dbfc7f007e5f Reviewed-by: Mitch Curtis <[email protected]>
* | | Fix naming of methods defined in object or class literalsLars Knoll2018-08-017-20/+65
| | | | | | | | | | | | | | | Change-Id: I01b7774097a447520c85ae6766e6ca1162e921ba Reviewed-by: Simon Hausmann <[email protected]>
* | | Fix a cornercase for instanceofLars Knoll2018-08-013-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's possible to define a getter function for the prototype property of Function objects. Ensure this doesn't mess up things by not taking shortcuts. Change-Id: Id981f3080f5c5c0714a1b7b6de27b4af04e794c8 Reviewed-by: Simon Hausmann <[email protected]>
* | | Fix Function.prototype[Symbol.hasInstance]Lars Knoll2018-08-011-3/+3
| | | | | | | | | | | | | | | Change-Id: Idf4b77fe6f99e02345920908b9242cee911c0c7b Reviewed-by: Simon Hausmann <[email protected]>
* | | Minor cleanupLars Knoll2018-08-012-8/+6
| | | | | | | | | | | | | | | Change-Id: I70d59b20761403a3f05ec31f91adda2ff7e5ff5f Reviewed-by: Simon Hausmann <[email protected]>
* | | Fix a bunch of test failures for Function.prototype.toString()Lars Knoll2018-08-013-3/+3
| | | | | | | | | | | | | | | Change-Id: I36f642e8db7f88698b25eed9e8a64ac2c5896b10 Reviewed-by: Simon Hausmann <[email protected]>
* | | Reduce memory consumption when loading AOT generated cache filesSimon Hausmann2018-08-015-125/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate the qml data (objects/imports) from the general compilation unit data. It's only the former that needs to be re-generated as part of the type re-compilation and by separating it we can allocate memory just for that and keep using the mmap'ed general unit data for everything else (including byte code). Another upside of this change is that it allows eliminating the recently introduced concept of a backing unit again. Saves ~149K RAM with the QQC1 gallery. Task-number: QTBUG-69588 Change-Id: Ie88a4286feb7e2f472f58a28fa5dd6ff0a91c4b6 Reviewed-by: Lars Knoll <[email protected]>
* | | QQmlTableInstanceModel: check if adaptormodel adapts AIM before using itRichard Moe Gustavsen2018-07-311-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | The aim() function doesn't check if the model inside QQmlAdaptorModel is a actually a QAbstractItemModel (it just does a static cast). So we need to guard it. This is essentially the same fix as was done for QQmlDelegateModel (sha1: 9757d5f9c90988). Change-Id: I9f14e1639b5e7df4190333c679e805e7f9f7481a Reviewed-by: Mitch Curtis <[email protected]>
* | Add QQmlEngine getter to QQmlComponentFrederik Gladhorn2018-07-312-2/+14
| | | | | | | | | | Change-Id: I1c9979fbd5ca81700ec7ad60e6d991e70c6d5fb5 Reviewed-by: Simon Hausmann <[email protected]>
* | Build AST nodes when parsing ES6 modulesSimon Hausmann2018-07-315-1/+891
| | | | | | | | | | | | | | | | | | | | | | | | | | This introduces the structures in the AST that allow for the extraction of imports, exports as well as location of tokens. The ModuleItemList as entry point is special with regards to the statements (so not import/export declarations) in the sense that the statement list contained in ModuleItemList::item is not linked yet between different ModuleItemList instances. Change-Id: If553a6ebaf53d5f3cf755c8327d3fe0ea7db68c2 Reviewed-by: Lars Knoll <[email protected]>
* | Encapsulate access to CompiledData::Object and CompiledData::ImportSimon Hausmann2018-07-3113-47/+47
| | | | | | | | | | | | | | | | This will make it easier to move the data out of CompiledData::Unit and into a separate data structure. Change-Id: I32e6233a66f2279b44cc06ef7c3505db4a565f98 Reviewed-by: Lars Knoll <[email protected]>
* | Remove unused flagSimon Hausmann2018-07-313-7/+4
| | | | | | | | | | Change-Id: Ib9028ffa8c7d014598da60bfe44e004031bf6017 Reviewed-by: Lars Knoll <[email protected]>
* | Reduce memory usage caused by strings with AOT cache filesSimon Hausmann2018-07-313-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For AOT loaded cache files, the CompiledData::Unit we produce is ephemeral by design. That same applies to the strings, where we don't really need to write out a new string table but we might as well just keep the QStringList around. That avoids copying all the string data and saves another 21K RAM with the gallery. It might even save a little more if some of the new strings are truly shared via implicit QString sharing. Also their "extraction" via stringAt(index) becomes as fast as for the strings that come from mmap'ed memory - with no copying involved. Task-number: QTBUG-69588 Change-Id: I06cf0f083e3b8d3c5dbabb22beb0711f88fc8692 Reviewed-by: Lars Knoll <[email protected]>
* | Clean up internal QML unit creation APISimon Hausmann2018-07-314-12/+5
| | | | | | | | | | | | | | | | | | Since the callers always end up assigning the returned unit pointer back to the compilation unit's data member, we might as well do that inside the function and return void instead. Change-Id: I7a7f3e7a0c89ffe2f9474149fcf61736609b363d Reviewed-by: Lars Knoll <[email protected]>
* | Simplify loading of ahead-of-time created QML cache filesSimon Hausmann2018-07-315-39/+34
| | | | | | | | | | | | | | | | | | | | | | Consolidate the old "createUnitData" code that used to be a virtual function into the one call site and avoid a malloc that way. By the way of that, the string table gets a guard to prevent accidental registerString() calls at a later point. Change-Id: Ia3f8d3e874b7733822e6942e411c940ec60d95a5 Reviewed-by: Lars Knoll <[email protected]>
* | Simplify signal handler parameter handlingSimon Hausmann2018-07-313-103/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the two QQmlBoundSignalExpression constructors and always call updateInternalClass on the run-time function to set up the parameter name -> argument mapping. This streamlines the code, shares the error handling for unnamed parameter clashes and allows getting rid of the code to extend the formals of functions that become signal handlers in AOT generated cache files. Either onThatSignal: function(param1, param2) { ... } syntax is used and the mapping is fixed and known at AOT/compile time. Or alternatively the dynamic variant is used where the formals are determined at signal handler installation time. Saves a whopping KB of RAM on the QQC1 gallery. Change-Id: I33a9afc06474143d7893f42366cb6553a07ce937 Reviewed-by: Lars Knoll <[email protected]>
* | Minor cleanupSimon Hausmann2018-07-311-17/+7
| | | | | | | | | | | | | | | | | | Replace the conditional unit copying when working with AOT cache files with an unconditional copy, as it always reduces the size and needs to be done anyway due to the file name. Change-Id: Id00c1361c4f31081c54dbbc29a96284cc09d06e0 Reviewed-by: Lars Knoll <[email protected]>
* | Optimize memory consumption of ahead-of-time compile cache filesSimon Hausmann2018-07-316-15/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading a pre-compiled cache file, the strings contained therein will remain available in memory since commit 7dcada48d2435e8ceb0cc8a6771f79b76979e11f. While for aot built cache files we may have to add new strings (for example for signal handler parameters), we can re-use the existing strings by omitting them from the intermediately created string table. This saves ~283K RAM with qtquickcontrols1 gallery. Task-number: QTBUG-69588 Change-Id: I8ea807f6dea4cc35d8b7e5f7329809ed1cd12880 Reviewed-by: Lars Knoll <[email protected]>
* | Clean up compilation unit string resolutionSimon Hausmann2018-07-319-16/+15
| | | | | | | | | | | | | | | | | | Replace use of CompiledData::Unit::stringAt with CompilationUnit::stringAt as central place, in preparation for allowing derived compilation units to retrieve strings from base units. Change-Id: Ifafe6c18a9fd8d1e2259a60c17200124869b4c2d Reviewed-by: Lars Knoll <[email protected]>
* | Add missing "We mean it." warningFrederik Gladhorn2018-07-311-0/+11
| | | | | | | | | | Change-Id: I3de691385a7884c4b38454e7a9f6f27b3b839286 Reviewed-by: Simon Hausmann <[email protected]>