aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash in sparse array handlingSimon Hausmann2014-03-281-12/+13
| | | | | | | | | | | | When re-allocating the sparse array data, make sure to initialize the free list correctly. Previously this was only done for the first allocation. Test cases uses an object literal, as that's a reliable way to ensure a sparse array is created. Task-number: QTBUG-37892 Change-Id: Ib38cfce50104904af0c980f022c9dbb7461ae5f8 Reviewed-by: Lars Knoll <[email protected]>
* Fix interpreter math routines.Erik Verbruggen2014-03-281-6/+9
| | | | | | | | | | | | | | | | This: qint64 result = a + b; is not equal to: qint64 result = static_cast<qint64>(a) + b; So checking if the former will overflow, and then doing the "double case", will get thrown out by an optimizing compiler. While we're in the area, optimize the X86 case a bit too. Change-Id: Idfb69b16dbaaa0ae9f013a430ff060ca789526ba Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Fix double deletionSimon Hausmann2014-03-281-1/+1
| | | | | | | | | | | | | | Small regression from commit 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510. Processing the deletables might result in the onDestruction emission, which in turn may end up in GC allocation and thus GC runs. That in turn may result in m_deletables processing, which at this point is nested then. For that to work we need to set m_deletables back to zero _before_ beginning with the iteration. Fixes tst_qqmlecmascript with aggressive gc. Change-Id: Ibb310b30cd496644557f4c1bb23318b18ee8f36c Reviewed-by: Lars Knoll <[email protected]>
* Fix QtSharedPointer::ExternalRefCountData object leak in v4 engineLiang Jian2014-03-281-4/+5
| | | | | | | | | | | | Always call ~QObjectWrapper() to the wrapper object in QObjectWrapper::destroy(), otherwise the m_object member of QObjectWrapper may still hold a QtSharedPointer::ExternalRefCountData object which will never been deleted. I don't know why this will not cause leak in the past, but it seems that the leak was introduced in 7ae796cb141b73a1b215b2b0fd64b7ffbbd1e510 Change-Id: I24b49bb11f95b7e3060c7adba1ab80b615da2942 Reviewed-by: Simon Hausmann <[email protected]>
* Doc: Document signals (not handlers) under \qmlattachedsignalSze Howe Koh2014-03-282-10/+10
| | | | | | | | | | - They're not "attached properties" either. - Append the handler names to the end of the corresponding signal doc. - Update descriptions and links Task-number: QTBUG-35846 Change-Id: I54e93187b3209546ec344a20e0482c98d7f14109 Reviewed-by: Jerome Pasion <[email protected]>
* Be a bit more conservative with allocating memoryLars Knoll2014-03-271-2/+2
| | | | | | | | | | Cap the max chunk size at 2MB. This value still still doesn't affect the v8 benchmark noticably, but should avoid extreme memory usage in some corner cases Task-number: QTBUG-37134 Change-Id: If2050374c4a7df7ff74194d64880e2d660ea26fd Reviewed-by: Simon Hausmann <[email protected]>
* Fix instantiation of QML list models with custom object propertiesSimon Hausmann2014-03-271-6/+1
| | | | | | | | | | | | | | | | | | When doing something like property Item blah: Item { ... } in a list model, we would erroneously pass "blah" to the custom parser of the list model, which is wrong as the binding to blah is on an existing property (not custom). For regular properties there's a code path in place to avoid passing this to the custom parser, but for sub-object bindings we'd unconditionally register it with the custom parser. This patch corrects that and also adds a unit test to verify that we don't pass any bindings to existing properties to the custom parser. Task-number: QTBUG-37795 Change-Id: I1a3091fb5fad4be08b577cf74a85f24c3ab62ef4 Reviewed-by: Lars Knoll <[email protected]>
* Remove the scribble option from the memory managerLars Knoll2014-03-271-7/+0
| | | | | | | | This option doesn't make sense anymore, as we memset the object to 0 on destruction anyway. Change-Id: Ie40563394f9cacda1b35fde114c9a6043f53d460 Reviewed-by: Simon Hausmann <[email protected]>
* Get rid of collectDeletablesLars Knoll2014-03-276-45/+24
| | | | | | | | | The method is only required for the QObjectWrapper, but there we can instead simply register the deletable in the destroy method. Change-Id: I944319d327859cce33ac31a174e8d56fc4babfc1 Reviewed-by: Simon Hausmann <[email protected]>
* Optimize ExecutionContext::setPropertyLars Knoll2014-03-271-1/+7
| | | | | | | | | Optimize the code in case the setProperty call tries to set something in the activation. Avoid resolving the property index twice. Change-Id: I60a4535adc014f7118bc3ab6773e10ed688ca0d6 Reviewed-by: Simon Hausmann <[email protected]>
* Don't use scopes in the instanceOf operatorLars Knoll2014-03-271-9/+9
| | | | | | | | | There's no need to use scopes here, as instanceof can't trigger any calls into the memorymanager. This slightly speeds up the code. Change-Id: Ie7f5c8f3982df1e24d21cfc4e0841d479a75c664 Reviewed-by: Simon Hausmann <[email protected]>
* Optimize construct callsLars Knoll2014-03-273-1/+3
| | | | | | | | Optimize construction of the internalClass for the object being constructed. Change-Id: Id5fc02c291664ec01c3595ae0acbb6895cc5b147 Reviewed-by: Simon Hausmann <[email protected]>
* Save another 4/8 bytes per QQmlBoundSignalExpressionSimon Hausmann2014-03-272-2/+2
| | | | | | | | We can move the persistent to hold the scope for a string compiled binding into the extra data. Change-Id: I033aa6d080402a1eb19cdae540f9af2c5c3a3fc7 Reviewed-by: Michael Brasser <[email protected]>
* Call tzset() from getLocalTZA() so we learn about tz changesIain Lane2014-03-271-0/+1
| | | | | | | | | | | | | | Per POSIX, localtime_r isn't required to call tzset(). This means that we don't notice that the timezone has changed when calling Date.timeZoneUpdated() from JS. Call this in getLocalTZA() so that it always returns results pertaining to the selected timezone. Task-number: QTBUG-37683 Change-Id: Ia9098ef0100b7c909a82b125a5ea4f39fba1f306 Reviewed-by: Simon Hausmann <[email protected]>
* Fix build on older MinGWKonstantin Ritt2014-03-271-1/+14
| | | | | | | | | | | The correct declaration of the SHGetPathFromIDList symbol is being used in mingw-w64 as of r6215, which is a v3 snapshot; until then, SHGetPathFromIDList was declared to use LPITEMIDLIST. Change-Id: Icc2f7814bad475c9b825f7d70c0ae4da72f471d9 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Kai Koehne <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* Don't create prototype objects for bindingsLars Knoll2014-03-251-2/+2
| | | | | | | They are neither used not accessible from QML. Change-Id: I14fa6059b8e64cb2c3b9d025061548009a473f96 Reviewed-by: Simon Hausmann <[email protected]>
* Optional reporting of GC statistics to stdoutLars Knoll2014-03-252-13/+46
| | | | | | | | Use QV4_MM_STATS to get some statistics about each GC run written to stderr. Change-Id: Idc30c06e1c3ca8353a2f16615cb26df13a8f23ed Reviewed-by: Simon Hausmann <[email protected]>
* Remove unused methodLars Knoll2014-03-252-13/+4
| | | | | Change-Id: Ia7df68e78ac105fe5519cb4f80a64561310d3324 Reviewed-by: Simon Hausmann <[email protected]>
* Remove code for conservative GCLars Knoll2014-03-252-187/+0
| | | | | | | | | | This was meant as a debugging help after we took the exact GC into use. Turns out it doesn't help debug any issues, aggressive garbage collection is much more helpful in finding GC issues. Change-Id: Idfff26d3a4a15e570615009c1e57921bca6297ca Reviewed-by: Simon Hausmann <[email protected]>
* Correctly parse unicode escape sequences between 0 and u001fLars Knoll2014-03-251-2/+0
| | | | | | | | | The old code rejected these escape sequences because of a slight misreading of the spec. Task-number: QTBUG-36968 Change-Id: I56a0e76295d1903b4798719de028bd21ad5be719 Reviewed-by: Simon Hausmann <[email protected]>
* Small fixesLars Knoll2014-03-251-4/+5
| | | | | | | | | Don't cast from ushort to uchar and back, and remove a condition that's always true. Allocate some more memory for matching. Change-Id: I8167b6e4b4989365ca0ea8e17f4bdb15c0d8e27d Reviewed-by: Simon Hausmann <[email protected]>
* Fix some documentation errors.Friedemann Kleint2014-03-248-22/+22
| | | | | Change-Id: I5d4b3e26742202c4b634d0001fd3658c7263c50a Reviewed-by: Alan Alpert <[email protected]>
* Fix infinite loop in method overload resolutionSimon Hausmann2014-03-241-0/+5
| | | | | | | | | | When resolving overloaded slots in a situation without property cache, then we need to detect that we've reached the end of the overload lists and exit from RelatedMethod with zero. Task-number: QTBUG-37157 Change-Id: Ifaab8cc1b377725c99c1bb89bb9bb74d5a0af1b8 Reviewed-by: Michael Brasser <[email protected]>
* Don't crash on Runtime::getQmlImportedScriptsAlbert Astals Cid2014-03-241-0/+4
| | | | | | | Task-number: QTBUG-37303 Change-Id: I083ca0cc3223fe0dbf1c768ad43a0d4927579867 Reviewed-by: Simon Hausmann <[email protected]>
* Cleanupsv5.3.0-beta1Simon Hausmann2014-03-2115-49/+22
| | | | | | | | | * Get rid of members in QQmlCompiledData that were used by the VME and are now unused * Get rid of QQmlVME friend declarations that are not needed anymore Change-Id: I11b4b6f0b4b0b60edf92a1256be3d0d44d76bbc9 Reviewed-by: Lars Knoll <[email protected]>
* Cleanup: Remove last traces of QQmlScriptSimon Hausmann2014-03-1916-241/+52
| | | | | | | | | | What remains is the code for removing .pragma from script source code (and replacing it with white-space to preserve line/column numbers). The previous code even returned the value of the pragmas, but for the remaining caller sites that value isn't used, so we can just return void. Change-Id: I16db15da236970660b817d6c4493005365a7a1af Reviewed-by: Lars Knoll <[email protected]>
* Compilation fixaavit2014-03-191-8/+7
| | | | | | | | gcc 4.6 chokes on this construct. Replace with a shorter and more readable one :) Change-Id: I02ff7a2c5300de656e61ee5ca8effabdd74991bb Reviewed-by: Simon Hausmann <[email protected]>
* Clear the chain of incubated objects in QQmlIncubatorPrivate::clearAlbert Astals Cid2014-03-191-14/+14
| | | | | Change-Id: I432310c0e6006d567fd59b4b1021a9e1538ef78f Reviewed-by: Alan Alpert <[email protected]>
* Cleanup: Get rid of QQmlScript::TypeReferenceSimon Hausmann2014-03-193-18/+9
| | | | | Change-Id: I5f8b203ac71f0667947087bd2b1e7ce6d91d843d Reviewed-by: Lars Knoll <[email protected]>
* Cleanup: Remove dead codeSimon Hausmann2014-03-193-49/+0
| | | | | Change-Id: I073a8c61d666a08b5e88edcbf4cefa71d7f5b7c3 Reviewed-by: Lars Knoll <[email protected]>
* CleanupSimon Hausmann2014-03-194-135/+88
| | | | | | | | Get rid of QQmlScript::Import in favor of operating on QV4::CompiledData::Import structures throughout the type loader. Change-Id: I29de369373a3dc4fd8e7f30517b804edcce93e7a Reviewed-by: Lars Knoll <[email protected]>
* Clean up script importsSimon Hausmann2014-03-198-335/+318
| | | | | | | | | | Move the .pragma and .import script extraction out of qqmlscript and into qqmlirbuilder, where it can populate a QQmlIR::Document. Changed the script part of the type loader to use that, which also allowed eliminating the m_source member and m_metaData. Change-Id: Icc64d219fff5666679a02e6afda73f7edfca132b Reviewed-by: Lars Knoll <[email protected]>
* Clean, part 3Simon Hausmann2014-03-196-50/+18
| | | | | | | | | | * Get rid of QQmlScript::Pragma * Allow retrieving the QML unit size after generation * Add flag equivalent of .pragma library to QV4::CompiledData * Remove unused method Change-Id: I2f95b83f919004013741bc539c82960cc878f3a4 Reviewed-by: Lars Knoll <[email protected]>
* Use Q_ASSERT instead of assertLars Knoll2014-03-1913-64/+55
| | | | | Change-Id: I6185b59a7dfd6977ce82581ab4385e07d78f13f6 Reviewed-by: Simon Hausmann <[email protected]>
* Enable constant propagation for all typesLars Knoll2014-03-193-13/+28
| | | | | | | | | So far constant propagation was only enabled for numbers and booleans. Enable it for all types now and make sure the propagation does the right thing. Change-Id: I202b0073f463d8a42e34931a736544207284b6dc Reviewed-by: Simon Hausmann <[email protected]>
* Fixes to for...in statementLars Knoll2014-03-198-9/+9
| | | | | | | | | | | Properly convert the argument to an object if it's not null or undefined as mandated by the standard. Add a similar test case for the with statement. Change-Id: Idd8e245e8dae4803eb0e2010e3d43bb912670444 Reviewed-by: Simon Hausmann <[email protected]>
* Optimize construction of SimpleArrayDataLars Knoll2014-03-193-2/+5
| | | | | Change-Id: I7f8a0ac8a368af23534378e8c31d820b3b9f1f4c Reviewed-by: Simon Hausmann <[email protected]>
* Doc: Fix broken \qmlsignal linksSze Howe Koh2014-03-185-11/+11
| | | | | | | | Fix the breaks caused by the re-categorizing of \qmlsignal pages Task-number: QTBUG-35846 Change-Id: I528ae16ec522fc902133e22d8f53c87a7f0d56ad Reviewed-by: Jerome Pasion <[email protected]>
* Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-2/+4
| | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <[email protected]>
* Small optimization to RegExpLars Knoll2014-03-183-1/+14
| | | | | | | | | Also add markObjects() calls to all the identifiers we keep around in the engine. It's probably pure luck this hasn't caused any issues until now. Change-Id: Ie31d19793efa53867e4e240ba548070dcde32ec1 Reviewed-by: Simon Hausmann <[email protected]>
* Add some specialized lookups for two internal classesLars Knoll2014-03-183-28/+187
| | | | | | | | | | | | Some methods are being called with two different types of objects, alternating between them. This adds a specialized lookup for that case. Speeds up the splay test by ~20%. Also create a clean path to a fallback lookup instead of going back to the generic lookup and then alternating. Change-Id: I3082d70d27155ef5f2cf2b680d227c6dd389956d Reviewed-by: Simon Hausmann <[email protected]>
* Minor optimization: Avoid some QString constructorsLars Knoll2014-03-181-1/+1
| | | | | | Change-Id: I51af67e9ba4076216142e05b5de5b2e8f8c526bc Reviewed-by: Michael Brasser <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* Cleanup, part 2Simon Hausmann2014-03-188-137/+133
| | | | | | | | | | | * QQmlCodeGenerator -> QQmlIR::IRBuilder (it doesn't generate code, it generates the Object/Property/Signal/etc. IR of the .qml file, that's going to get transformed to QV4::CompiledData::*) * ParsedQML -> QQmlIR::Document Change-Id: I329e858487b66e1ae528d44316761f5dd34b79f4 Reviewed-by: Lars Knoll <[email protected]>
* Use QUrl::toLocalFile() when decoding a string URLAndrew Knight2014-03-181-8/+3
| | | | | | | | | | | | | | | Some percent-decoded characters may still be present in the string URL, so it is best to use QUrl::toLocalFile() to process the string properly. This also makes some drive handling "magic" obselete as QUrl already handles this. This fixes an issue whereby QML apps residing in local paths requiring percent-encoded characters (or which import local file URLs with percent-encoded characters) would fail to load, as the path was passed to the file system engine without fully decoding the URL. Change-Id: I8ec2b06f0661e0ac7cc9df79d35ec5cee211f672 Reviewed-by: Simon Hausmann <[email protected]>
* Namespace cleanupSimon Hausmann2014-03-179-265/+233
| | | | | | | Move the QML IR types into the QmlIR namespace and clean them up. Change-Id: I2125449e5a519034e23670651efa620f405730b4 Reviewed-by: Lars Knoll <[email protected]>
* Fix crash with lazy binding initialization and compile time calculated ↵Simon Hausmann2014-03-173-5/+9
| | | | | | | | | | | | | dependencies During lazy binding initialization we may execute bindings where we calculated dependencies to the context object at compile time. In order to register those dependencies, the contet object needs to be set in the QQmlContextData. This patch makes sure to set it before setting up the bindings. Change-Id: Iacd360140cd9c389487bda82f6a7e6cc3a44c154 Reviewed-by: Lars Knoll <[email protected]>
* Suppress implicit sign conversion warnings in public APIKurt Pattyn2014-03-171-3/+3
| | | | | | | | | | Suppres implicit sign conversion warnings when compiling with the -wsign-conversion flag. E.g. “qqml.h:235:5: warning: implicit conversion changes signedness: 'const int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]” Change-Id: I7a51c51609c39f2431acb95febed6bb741f3c09c Reviewed-by: Simon Hausmann <[email protected]>
* qv4isel_moth.cpp: Fix MSVC-warnings about operator unary minus applied to ↵Friedemann Kleint2014-03-171-3/+3
| | | | | | | | | | | unsigned. compiler\qv4isel_moth.cpp(1041) : warning C4146: unary minus operator applied to unsigned type, result still unsigned compiler\qv4isel_moth.cpp(1056) : warning C4146: unary minus operator applied to unsigned type, result still unsigned compiler\qv4isel_moth.cpp(1096) : warning C4146: unary minus operator applied to unsigned type, result still unsigned Change-Id: Idb4714a277486ff736f49c50c7e840fd62e2150f Reviewed-by: Lars Knoll <[email protected]>
* Fix crash when calling concat on an empty arraySimon Hausmann2014-03-151-0/+2
| | | | | | | | | Make sure to create the array data. The earlier called copyArrayData() doesn't have to do that. Task-number: QTBUG-37506 Change-Id: I6671769fcd471234c4c2eaa1614aa61266db0e5c Reviewed-by: Lars Knoll <[email protected]>
* Fix crash on shutdown with statesSimon Hausmann2014-03-151-0/+1
| | | | | | | | | | | | When populating deferred properties, we must not set the rootObjectInCreation flags on the root context and (consequently) on any sub-objects objects created when initializing deferred properties. Doing so otherwise will end up us incorrectly linking QQmlContextData together, causing QQmlData::linkedContext to point to iself and crash on exit upon deletion. Task-number: QTBUG-37484 Change-Id: Ia5dc92a04e0f66499f15fbac10f14859d387b021 Reviewed-by: Lars Knoll <[email protected]>