aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge 5.12 into 5.12.3Kari Oikarinen2019-04-021-1/+1
|\ | | | | | | Change-Id: I2df05ba0066b9529d3b332ede8ade765aefbcea1
| * Doc: Add missing quote in example codePaul Wicking2019-04-011-1/+1
| | | | | | | | | | | | Fixes: QTBUG-74851 Change-Id: Ib4c4b7fd3a01a360ae923f718e7ce74b3ae7f3eb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge 5.12 into 5.12.3Kari Oikarinen2019-04-0116-135/+208
|\| | | | | | | Change-Id: Ic25bb7ba2e9f404622157ef023e64c3d4d47263f
| * Doc: Use the \nullptr macro instead of 0Venugopal Shivashankar2019-03-291-1/+1
| | | | | | | | | | | | | | | | This enables overriding the macro so that it translates to 'None' in the Qt for Python context. Change-Id: Ied1ddcb0f9e6e2299d9042e4cc4c2bb6d11a491b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Avoid redundant slashes when creating qmldir URLsUlf Hermann2019-03-281-1/+1
| | | | | | | | | | | | | | | | | | If the path starts with ":" and we assume it's an absolute qrc path, the only thing we need to do to make it a URL is prepend "qrc". Fixes: QTBUG-74677 Change-Id: Iee0239296b6f48ce909db02ae16e24dfc745b637 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Allow enums in QQmlType to be set up in two separate passesUlf Hermann2019-03-281-8/+15
| | | | | | | | | | | | | | | | | | | | | | The baseMetaObject and the property cache can become available at different points in time. If we have initialized the enums before either of them is available we want to add the additional enums when the other one appears. Fixes: QTBUG-74677 Change-Id: I57276681a50b6c04181c6a29e736f2dc20632a0c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Check for numeric limits when growing SharedInternalClassDataPrivateUlf Hermann2019-03-273-16/+41
| | | | | | | | | | | | | | | | We can effectively only deal with values of < 2GB for m_alloc * sizeof(Data). This is not much more than the values seen in the wild. Change-Id: Ia6972df33d34a320b5b087d38db81aae24ce5bbe Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Re-use existing IC when freezing propertiesUlf Hermann2019-03-272-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | There is no reason to start from the empty class in that case. Furthermore, if the properties are already frozen, starting from the empty class will walk the IC hierarchy to the current IC. However, if the garbage collector has removed the intermediate classes in the mean time, we end up at a new IC which is equivalent but not the same. Therefore, the freezing never terminates. Task-number: QTBUG-74190 Change-Id: Id544bd00d3b4b563fb06dfce0edd0385e1d32a6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Scope intermediate values when allocating objectsUlf Hermann2019-03-273-7/+17
| | | | | | | | | | | | | | | | | | Otherwise the garbage collector might interfere and we might end up with dangling pointers in random places. Task-number: QTBUG-74190 Change-Id: I253c526ef930b8f0be14e96a42af8b66fda3b22d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix incorrect PathView.currentIndex assignment with StrictlyEnforceRangeShawn Rutledge2019-03-271-4/+0
| | | | | | | | | | | | | | | | | | If currentIndex is quickly assigned a different index and then the previous current index again, it should not move. Fixes: QTBUG-74508 Change-Id: I8d610e3fe452c8631e082c648e77d2cb70ae57c5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Trigger the garbage collector when allocating InternalClass objectsUlf Hermann2019-03-264-94/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we check the icAllocator's slots on shouldRunGC() we should also check shouldRunGC() when adding slots. Otherwise we might never run the GC when only allocating InternalClasses. In addition, account for the "unmanaged" size of the PropertyAttributes that are part of the InternalClass objects. Those can be large. In cases where an excessive number of large InternalClass objects is created the garbage collector is now invoked frequently, which costs a significant number of CPU cycles, but prevents the memory usage from growing indefinitely. Task-number: QTBUG-58559 Change-Id: Icf102cb6100f6dba212b8bffe1c178897880eda0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Restore rich Text creation speedShawn Rutledge2019-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 634b59f187c8697f03a606cbacb5f0a69650ea7c caused a significant performance regression during layout of any Text item with RichText, by calling QQuickTextDocumentWithImageResources::setPageSize() with an accurate width in ensureDoc(); but ensureDoc() is called multiple times, and doesn't need to calculate actual layout. The accurate width is needed (at least) when doing layout of HTML tables that contain percentage-based column widths. For that purpose it's enough to set the correct "page" size in updateSize(). Fixes: QTBUG-74638 Task-number: QTBUG-72457 Change-Id: I34ab085316018576eba64a67200c527bb64b9533 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Enable lookups for imported scripts and worker scriptsSimon Hausmann2019-03-253-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | This is straight-forward to enable, with the minor adjustment that we need to handle the case where a global lookup is done without a calling qml context (worker script). We don't know at compile time whether a script will be imported directly or used as a worker script, so we have to generate the global qml lookup instruction regardless and handle it at run-time. Change-Id: Ia033afa214d919d906c676498dd3eceb1c5639d8 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Doc: Fix typo in code snippetPaul Wicking2019-03-271-1/+1
|/ | | | | | Fixes: QTBUG-74444 Change-Id: If504fe2a6b4a0d88d69e777d433a6773db5f4df3 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix preview zoom problems on windowsTim Jenssen2019-03-224-68/+183
| | | | | | | | | | Apparently the window is moved to random places on multi-monitor setups on windows. Fixes: QDS-263 Change-Id: I21082c7031fefff3057074c147e82df7a88f4f78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Fix memory "leaks" in qmlcachegenSimon Hausmann2019-03-222-5/+9
| | | | | | | | | | | | | The CompilationUnit class owns the unit data. An exception was made in bootstrap builds, where it was up to the caller to free the memory. This lead to cases in qmlcachegen where we didn't free the memory. This is best fixed by unifying the behavior. This fixes the build when using an ASAN enabled build, as the runtime aborts after calling qmlcachegen due to "leaks". Change-Id: I8b55b4e302a9569a1d4e09eeb488c479368b50f0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Initialize TranslationData padding before writing cache filesUlf Hermann2019-03-211-0/+2
| | | | | | | | Otherwise the resulting files differ subtly. Fixes: QTBUG-74532 Change-Id: I12b4f1ba6dda781d63ad50cce87861ba24582bf7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Accelerate lookups of properties in outer QML contextsSimon Hausmann2019-03-212-52/+114
| | | | | | | | | | If we can determine with certainty that a property cannot be found in the innermost QML context, then we can avoid one entire iteration for all future lookups. Task-number: QTBUG-69898 Change-Id: I2a579aa9f60811a818e45235a60a93fc2ede3206 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: improve QUICK_TEST_MAIN_WITH_SETUP function descriptionsMitch Curtis2019-03-211-2/+7
| | | | | Change-Id: I83c8a3cb8d125df83deaefdbb08b4271eda8a5b4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Document since versions for QUICK_TEST_MAIN_WITH_SETUP functionsMitch Curtis2019-03-211-0/+4
| | | | | | | | | - qmlEngineAvailable() 5.11 c260d3062de83d7f051e531007771455915285e5 - applicationAvailable() 5.12 ef06a6ba7bfb5e38b1bef2e21a764ec74479b158 - cleanupTestCase() 5.12 7bf8d4d3772959f06d4dd0168af7774adde29d76 Change-Id: I7b6b699121248c5ad35a7ee2c99eb3f3c77fd01f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Don't warn if invokable test setup function doesn't existMitch Curtis2019-03-211-9/+20
| | | | | | | | | | | | | | This was never the intention (as the code comments imply), but it was never tested. This is a cherry-pick of 50f234df500829a0023ed5d396c486f995ad71ef because it went to dev (5.13) when it should have originally went to 5.12. Change-Id: I8df0b3702129b1f1d086df73117d3ddb721317cb Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit 50f234df500829a0023ed5d396c486f995ad71ef) Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QUICK_TEST_MAIN_WITH_SETUP: fix qmlEngineAvailable() being called too lateMitch Curtis2019-03-211-8/+7
| | | | | | | | | | | | | | | | | | When I added the macro, I wasn't aware that TestCaseCollector was a thing. TestCaseCollector loads each QML file without running the tests (i.e. creates a QQmlComponent from the file without creating an object from that component). Since it still executes imports, the test can fail if types are registered or import paths added in qmlEngineAvailable(), since it's called too late. So, call it earlier. This should have no adverse effect on user code, as nothing of importance to the user will be skipped, and the documentation already details what can be expected by the time qmlEngineAvailable() is called. Change-Id: Ibd3a4b728bc87b90f89cc310fddf668c5879ad83 Fixes: QTBUG-74160 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: Do not invert non-reflexive comparison binopsErik Verbruggen2019-03-211-49/+36
| | | | | | | | | This is only useful for the few (4) comparisons where we have specialized instructions, and it's very error-prone. Change-Id: I37efe94f54ba0adf393d9236df2d13aa6685eb46 Fixes: QTBUG-74476 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Accelerate access to initial context object properties in lookupsMichael Brasser2019-03-202-1/+57
| | | | | | Task-number: QTBUG-69898 Change-Id: If92a0931bd4d64f6c176e93effb04df85ce27284 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Accelerate access to scope object properties in lookupsMichael Brasser2019-03-205-21/+99
| | | | | | Task-number: QTBUG-69898 Change-Id: I94bf1aa85c9b2302894f3224e41de81a456211f9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Accelerate lookup of singleton propertiesMichael Brasser2019-03-204-2/+69
| | | | | | Task-number: QTBUG-69898 Change-Id: Id03ba543fa293da2690099c3e6f94b2725de562f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix lookup fallback into the global object in QML bindingsSimon Hausmann2019-03-203-2/+39
| | | | | | | | | | This change addresses in particular qmlbench's fib10.qml, where usage of properties of the global object needs to go be accelerated in order to avoid regressing in performance. Task-number: QTBUG-69898 Change-Id: Ic43c64f4dd5459c4e92f87f03235ea836f971515 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Accelerate access to id objects in lookupsSimon Hausmann2019-03-203-2/+39
| | | | | | Task-number: QTBUG-69898 Change-Id: Ifbd9b3bf8d4b0c82b4c3933912e61eea8e0bb987 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Accelerate access to singletons and imported scriptsSimon Hausmann2019-03-203-3/+65
| | | | | | | | | Use a dedicated lookup type to provide super fast access to engine wide singleton objects as well as scripts Task-number: QTBUG-69898 Change-Id: Ie430f48f6576a9171018ef18742dcf6b2adb4310 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: Don't mark InternalClass::parent when garbage collectingUlf Hermann2019-03-201-5/+7
| | | | | | | | | | The parent pointer is only kept so that we can update the parent's transitions when removing a child. There is no need to keep the parents alive for the children. Fixes: QTBUG-58559 Change-Id: Ia28183966bde6d478ca030fe11195489925dfc13 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove dead compile time QML context/scope property and id object codeSimon Hausmann2019-03-2024-1159/+41
| | | | | | | | | | | After enabling lookups in QML files, we can remove all the code that tries to deal with (type) compile time detection of access to id objects and properties of the scope/context object. This also allows removing quite a bit of run-time code paths and even byte code instructions. Task-number: QTBUG-69898 Change-Id: I7b26d7983393594a3ef56466d3e633f1822b76f4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Implement dummy QML lookups for "global" variablesSimon Hausmann2019-03-2024-49/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When resolving names in the context of QML bindings, we now direct runtime access to QQmlContextWrapper::resolveQmlPropertyLookupGetter. At the moment this does basically the same as Runtime::method_loadName, which we called earlier. However this now provides the opportunity to optimize lookups in the QML context in a central place. When performing a call on a scope or context object property, we also did not use a CallName() instruction - which would have gotten the thisObject wrong - but instead we use a dedicated CallScopeObjectProperty and CallContextObjectProperty instruction. These rely on identifying these properties at compile time, which goes away with lookups (and also doesn't work when using ahead-of-time compilation). Therefore the qml context property lookup is using a getPropertyAndBase style signature and Runtime::method_callQmlContextPropertyLookup uses that. For the tests to pass, some error expectations need adjusting. In particular the compile-time detection of write attempts to id objects is now delayed to the run-time. The old code path is still there and will be removed separately in the next commit (as it is massive). Task-number: QTBUG-69898 Change-Id: Iad1ff93d3758c4db984a7c2d003beee21ed2275c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Clarify section about qmlRegisterInterface()Ulf Hermann2019-03-201-3/+4
| | | | | | | | There is very little you can do with things registered as interfaces. Change-Id: I5e4dcf8529c2d7c8012db3fa1dcfc23563cc2cba Fixes: QTBUG-74318 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Create import directory from intercepted URL, not orignial oneUlf Hermann2019-03-201-1/+1
| | | | | | | | | If the qmldir URL got intercepted, we should use the intercepted URL to get to the contents to be loaded. Fixes: QTBUG-73843 Change-Id: I51715575e767ed429a8237517f47196677409fe0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Enable lookups in QMLSimon Hausmann2019-03-1910-76/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | The main feature that needs to be implemented in order to enable lookups in QML files is to respect that the QObject wrapper has its own storage layer (meta-object properties). Lookups need to be able to index those when the base is a QObject. This is done by caching the property data and guarding the validity by comparing property cache pointers. The same lookup logic is also implemented for value type wrappers. OVerall there's more that can be done with lookups in meta-objects, for constant properties for example. For "global" lookups we have a safeguard in place that generates a LoadName instruction for property access that should end up in the qml context wrapper. So no changes are needed here at first, but the lookup in the QML context can be optimized in the future. The way of storing the property cache in the lookup itself trades ugliness on destruction against the creation of less internal classes. Another option would be to store the property cache in the internal class and let QObjectWrapper always transition via the property cache. Task-number: QTBUG-69898 Change-Id: I9c378c071acc6d7d4a34a2a76616f9594119d515 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Baseline JIT: Save accumulator in toInt32LhsAcc()Ulf Hermann2019-03-191-16/+16
| | | | | | | | | | toInt32LhsAcc convertes both the lhs and the accumulator to int32. If the accumulator is not saved, a GC run during the conversion of the lhs might trash its value. Fixes: QTBUG-74058 Change-Id: Ic42693061c7d483bb430d77bcc095de6ff9a6843 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Update JavaScript documentationUlf Hermann2019-03-192-3/+63
| | | | | | | | | Update function list and refer to the 7th edition of the ECMAScript standard. Fixes: QTBUG-73837 Change-Id: I4332de3ded0373393107b6d5bab95363a0b9ebb9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix leaking propertyCache inside QQmlAdaptorModel::AccessorsKirill Burtsev2019-03-151-3/+3
| | | | | | | | | | QQmlRefPointer works in AddRef mode for assignment of a raw pointer. This creates additional reference to original object and it will never be garbage collected in this case. Amends change 99e2356a73. Task-number: QTBUG-74148 Change-Id: Ic0f03e842965c5c82b357d10ab8b0d6a62411fc8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.12.2' into 5.12" into ↵Liang Qi2019-03-151-6/+3
|\ | | | | | | refs/staging/5.12
| * Merge remote-tracking branch 'origin/5.12.2' into 5.12Qt Forward Merge Bot2019-03-151-6/+3
| |\ | | | | | | | | | Change-Id: Ic631da33e81868ef62ca70c1aba243b3b0e6c5a8
| | * Update plugins.qmltypes for Qt.labs.settingsKai Koehne2019-02-221-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update got necessary after b7b384658b21e741f9a1fde60b1c1ee69a83e278 went in. Task-number: QTBUG-73239 Change-Id: Ic93bbcf5be7f0f33d36b254b3ca30526b86c858c Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Fix lookups the transition between primitive strings and string objectsSimon Hausmann2019-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose we have function foo(x) { return x.constructor; } and we call it first with foo("hello") then the lookup will be initialized with a primitive getter from the prototype. When we subsequently call foo(new String("world")) then the primitiveGetterProto() will check that the provided object is of the same type as last time, which erroneously succeeds. Indeed, both are of Managed type. However now we're passing a full-fledged object, which is not a primitive anymore - hence the additional check to ensure that we fall back to the generic getter. Task-number: QTBUG-69898 Change-Id: I3c7a8384bfdf0e31b7c6247cce80fe7448b627b3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Fix up global name determination when compiling ahead of timeSimon Hausmann2019-03-152-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | The list of names is still suboptimal, but at least it's shared now. Task-number: QTBUG-69898 Change-Id: I16c9839c4a1f097053b28caea894b67757972826 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Fix type error exception messages when using member lookupsSimon Hausmann2019-03-151-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Our tests expect those exceptions to have the same message as when not using lookups. Task-number: QTBUG-69898 Change-Id: Iab36519844a3a49ef9e34346e9afeb2eee9f9ced Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Make object property lookup resolution virtualSimon Hausmann2019-03-154-74/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows sub-classes of Object to have their own lookup resolution and verification logic, instead of squeezing it all into qv4lookup.cpp. The typical fallbacks are still in qv4lookup.cpp though. Task-number: QTBUG-69898 Change-Id: I32a8884982b37e2065090666a7bf05b198f5b7fd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Unify the JavaScript parsing recursion checksUlf Hermann2019-03-1510-75/+95
|/ / | | | | | | | | | | | | | | | | | | | | | | | | We only need to check in one central location and we can allow for more recursion. 4k recursions seem tolerable. A common default for stack sizes is 8MB. Each recursion step takes up to 1k stack space in debug mode. So, exhausting this would burn about half of the available stack size. We don't report the exact source location in this case as finding the source location may itself trigger a deep recursion. Fixes: QTBUG-74087 Change-Id: I43e6e20b322f6035c7136a6f381230ec285c30ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Doc: Link to the correct example in Qt Quick States topicTopi Reinio2019-03-141-1/+1
| | | | | | | | | | | | | | | | | | While there is no dedicated example for states and transitions for Qt Quick, the Animation example covers these concepts. Fixes: QTBUG-74428 Change-Id: I00f6ca54123011599ebbb6b7bc53d3104b1586ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Don't keep raw pointers to SparseArrayNodeUlf Hermann2019-03-143-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | The nodes are owned by the SparseArrayData and will be freed whenever an item is deleted from the array. Therefore, we have to look up the node for each iteration. This is slightly slower, but at least it doesn't crash. Fixes: QTBUG-74188 Change-Id: Id24324a8c83b00b3ad1212cdaabccabd6c8a999f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Save some stack space during code generationUlf Hermann2019-03-145-153/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Result objects are rather large, 96 bytes here. In a recursive algorithm such as our parser, we should not keep too many of them on the stack. Also, the size of Reference can be reduced by employing a bit field rather than a number of booleans. Also, try to convince the compiler to inline the accept() functions. The extra stack frames those create are unnecessary. Task-number: QTBUG-74087 Change-Id: I5c064491172366bb0abef99ffe9314080401a7d1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Doc: link to C++ and QML integration flowchartMitch Curtis2019-03-121-0/+2
| | | | | | | | | | | | | | | | | | | | The chart makes it easier to find the correct way to register a C++ type with the QML type system, so it makes sense to link to it from these docs. Task-number: QTBUG-74318 Change-Id: Iba74ce02d200d6609dbb0a508d618226a6fe1e54 Reviewed-by: Paul Wicking <paul.wicking@qt.io>