aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
Commit message (Collapse)AuthorAgeFilesLines
* Work around ICC 16 beta compiler bug in SFINAE expansionThiago Macieira2015-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling std::vector<int>'s constructor (or assign()) with two ints can select one of two different overloads: the (size_t, value_type) overload which fills with n copies of the value or (iterator, iterator) overload, which would copy a range. libstdc++ had some workarounds for this scenario, by using an indirect dispatch to determine whether it was a pair of integrals or not. But ever since the resolution of DR1234 (https://gcc.gnu.org/bugzilla/ show_bug.cgi?id=43813) with C++11's more expressive SFINAE, the dispatching is done actually by the outer template by adding an extra template parameter that requires std::iterator_traite<T> to expand. That's where ICC fails: it expands std::iterator_traits<int> and that fails. It should have ignored the expansion and discarded that overload. The workaround is simple: pass different types as the parameters, which means the compiler cannot select the overload containing a pair of iterators. /usr/include/c++/5/bits/stl_iterator_base_types.h(154): error: name followed by "::" must be a class or namespace name typedef typename _Iterator::iterator_category iterator_category; ^ detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163 instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 876 of "compiler/qv4ssa.cpp" Change-Id: I52dd43c12685407bb9a6ffff13f5f783820213a5 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* fix readonly metaproperties (revealed by compiler warning)Shawn Rutledge2015-07-211-2/+2
| | | | | | | Found thanks to -Wparentheses + gcc 5.1 Change-Id: Iad784a26d268b85f7c67623fd63f0b097a9f29f9 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-261-74/+166
|\ | | | | | | Change-Id: I4020a1b3c59dea18faf7cbcbb78b90fcfc3680f0
| * Add a version of BitVector that uses QBitArray.Erik Verbruggen2015-06-081-0/+54
| | | | | | | | | | | | | | | | | | | | Some C++ STL libraries are unable to ship a bug-free std::vector<bool>, and/or a bug-free specialization of std::find for std::vector<bool>. So, for those platforms there now is a slow version of BitVector, which relies on QBitArray, which we can fix if we find bugs. Change-Id: I5ddfb18cabe82049a7ede6083fe6ba142bca068b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Wrap std::vector<bool> in our own class.Erik Verbruggen2015-06-081-74/+112
| | | | | | | | | | | | | | | | So we can replace the implementation when we encounter a broken version of std::vector<bool> or a broken specialization of std::find for it. Change-Id: I7d7c0af585388ddedf5167cd9863c52ab638442d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Improve qml error message "invalid alias location"Aleix Pol2015-06-101-3/+3
|/ | | | | | | | | | | | | | Specify we're talking about the target itself rather than talking location, which I always doubt about whether it's the location within the file. Also specify the offending property, so we get a clue about what to look into. [ChangeLog][QtQml] Improve "invalid alias location" error message by specifying what's the offending property and by calling it "invalid alias target location" Change-Id: I7a9390089ee8986872c119df44d8036bf267ab99 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Avoid uninitialized bytes in QV4::CompiledDataSimon Hausmann2015-05-081-0/+1
| | | | | | | | | | | When populating the QV4::CompiledData for a JS unit, we memset the malloc'ed data to zero. We should do the same when creating a unit for QML files. We do write all the fields that we use, but due to padding we may end up with bytes that are neither used nor written but still uninitialized. Consequently they should be zero'ed, otherwise serialization will write garbage. Change-Id: I0b093e4dde6789d7236247507221f4f3476ba89d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Simon Hausmann2015-05-041-1/+1
|\ | | | | | | Change-Id: Ie8ea118ed0a1a9a1c3d81e1e34d85c03c695c9a4
| * Fix passing of locals as function arguments with side-effectsSimon Hausmann2015-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 75c22465cf8fe262edfe6178bb9ca19661fb710e regressed in allowing locals and arguments to be passed directly as further arguments to function calls, but that's incorrect when considering var i = 2; testFunction(i, i += 2) where it is instrumental to place the first argument into a temp (making a copy) instead of passing it directly. Change-Id: Iffcf6c6eda92a8fb665982cda1db0b96359cd092 Task-number: QTBUG-45879 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix uninitialized variables/dataSimon Hausmann2015-04-293-2/+3
| | | | | | | | | | | | | | | | | | | | * Initialize the indexOfRootObject member * When creating the QV4::CompiledData::String objects, don't include the one ushort _beyond_ the QString, which is random data. Change-Id: I8fe8a465e2713a385504f217b367a62b70ee5fdf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix regression with nested objects served by custom parsersSimon Hausmann2015-04-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following piece of code used to work and broke with Qt 5.3: ListModel { property var conn: Connection { ... } } When validating the properties of the ListModel we would not validate the Connection sub-object here, which meant the custom parser for the connection object was never called. We need to extend the logic for sub-object validation to recursive into sub-objects when this is either an attached property (Component.onComplete on a list model for example) or the object is assigned to an _existing_ property, i.e. a property not deal with by the custom parser. In this case that's a custom declared property. Change-Id: Ic99f746f08771460cc6424a9e8a839c78a7eafd9 Task-number: QTBUG-45735 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Eliminate remaining property cache string lookups upon object instantiationSimon Hausmann2015-04-211-0/+5
| | | | | | | | | | | | | | | | Even for the id property binding we can use the property data cache and therefore avoid string hashing. Change-Id: Id9a4ca3159cdfe5ba93060f1bc8626e70140daa1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Speed up property binding initialization on object creationSimon Hausmann2015-04-214-25/+55
| | | | | | | | | | | | | | | | | | | | Avoid repeated string hashing and lookups in the property cache in order to retrieve the property details when initializing literal and script bindings. Instead we now cache the property data at type validation time, similar to how the property data was encoded in the VME instructions in the old engine. Change-Id: I3957c7c4c3e26dfa97c4880b23940a3755ee90e4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Cleanup: Fix const'ness of the property binding validator codeSimon Hausmann2015-04-142-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | The property validator is supposed to validate the proposed property bindings and abort type compilation if necessary. As such it is a read-only pass through the data structures and therefore we make it const. However it does have a side-effect of collecting some state, which however is "write-only" and therefore marked as mutable. Those variables are written to, but not read during this pass. Change-Id: I6a3655fedbd6691b7498cf82ca1c8e21dd635bd3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix usage of QtQmlDevTools private headers on OSX with framework buildsSimon Hausmann2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this module borrowed its private headers from QtQml, so that when writing QT += qmldevtools-private, you'd get the private headers from QtQml. This doesn't work when QtQml is built as a framework. A cleaner solution is to give this module its headers proper by letting syncqt create the forwarding headers correctly (and consequently also include them in make install). In order for this to work, the included headers themselves cannot include any headers from QtQml, which this patch also takes care of, through a centralized inclusion of qv4global_p.h. Change-Id: I9bb8337956a2774cfaca6b338369face6c6ee785 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* | Don't evaluate the expression in switch() multiple timesLars Knoll2015-03-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | The old code would evaluate the expression in the switch statement once for every case label. This is not only slower than it should be, but can also lead to unexpected results in case the expression doesn't always evaluate to the same value or has side effects. Task-number: QTBUG-41630 Change-Id: Id93baca7e3aa09ce884967ef6524d4c4f055bcd6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | V4: fix phi node use position calculation.Erik Verbruggen2015-03-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As phi-nodes get transformed into moves, and the moves end up right before the terminator of the basic block of the incoming edge, the use by that phi-node is the position of that terminator minus one. However, when checking if uses need a register, this was not taken into account, resulting in an invalid life-time interval split position calculation. Task-number: QTBUG-44687 Change-Id: I0edd416f7ee5c8ea16bf7133870be45d0e6efea9 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
* | QtQml: Micro-optimize iterator loops.Friedemann Kleint2015-02-261-2/+2
| | | | | | | | | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I3bb1c6918cfd16a5dcefbcc03c442e99fe9bf76b Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * Fix failing assertion in debug builds for JS that calls constantsSimon Hausmann2015-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For true() we generate IR that looks like this: temp = true result = call temp() and therefore the move at isel time has IR::Call as source and a temp as base for the call. However constant propagation in the optimizer transforms this to result = call true() and that's a case we didn't handle in the IR visitor. Since we have Runtime::callValue we can however handle this case as well and the run-time will consequently produce the expected run-time error. Change-Id: Ia94a8116388e66f9f339913307f68e33a5c18a19 Task-number: QTBUG-43819 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Jan Kundrát <jkt@kde.org> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-1221-147/+147
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* | Move Stmt::d to Phi::dRobin Burchell2015-01-233-20/+34
| | | | | | | | | | | | | | Phi is the only thing using it. Change-Id: I2b6706884d9e41cc26632a6ad72281b391960f4f Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Get rid of most uses of ValueRefLars Knoll2015-01-231-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QML: Fix MSVC 2013/64bit warnings.Friedemann Kleint2015-01-221-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compiler\qv4ssa.cpp(687) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(950) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(1117) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1120) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1148) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1266) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1622) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(2246) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(4289) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(4351) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data jit\qv4regalloc.cpp(1383) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data jit\qv4regalloc.cpp(1769) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jit\qv4regalloc.cpp(1814) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4mm.cpp(496) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4mm.cpp(503) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4mm.cpp(506) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4regexp.cpp(60) : warning C4267: 'return' : conversion from 'size_t' to 'uint', possible loss of data jsruntime\qv4typedarray.cpp(85) : warning C4309: '=' : truncation of constant value Change-Id: I0b04e1a9d379c068fb3efe90a9db8b592061e448 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove the remaining bit of code that use the vtable in the internalClassLars Knoll2015-01-211-1/+1
| | | | | | | | | | Change-Id: Ia52f0e6db325aab37477d455f163487b319dce29 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove not required std::vector::reserve() callsLars Knoll2015-01-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | These actually force more reallocations of the vector than required, and slow things down in practice. callgrind shows that this saves around 7% of the total instruction count for crypto.js Change-Id: Ibd6114d84ade2b484a5261b53c3299f48f79e633 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Implement DefUses::Temps with a QVarLengthArray.Robin Burchell2015-01-171-5/+2
| | | | | | | | | | | | | | | | Avoiding heap allocations here shaves 100ms or so off the optimizer runtime. Change-Id: If00c757532ffe90f2fa9c62dc999bb69e25bb71c Task-number: QTBUG-43719 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2015-01-162-11/+17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4debugging.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4functionobject_p.h src/qml/jsruntime/qv4qobjectwrapper.cpp src/quick/scenegraph/shaders/visualization.frag tests/auto/qml/qjsengine/tst_qjsengine.cpp Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30
| * Fix invalid assertionNobuaki Sukegawa2014-12-201-1/+1
| | | | | | | | | | Change-Id: Ifd26d6863ad396e15d0097ed560eee8d281caccd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * V4: fix reverse type propagationErik Verbruggen2014-12-181-8/+15
| | | | | | | | | | | | | | | | | | Only do integer add/sub/mul when all operands are known to be integers. [ChangeLog][QtQml] Fixed invalidly opportunistic truncating of non-integer values for additions/subtractions/multiplications in JavaScript and binding expressions. Change-Id: I21b3bede2fb3e8033305591110b98cc9e6bf52f8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * V4: only optimize out to-int32 conversions when the operands are int32.Erik Verbruggen2014-12-181-2/+1
| | | | | | | | | | | | | | | | | | The operands of bit-ops are not typed as int32 when no type-inference is done, like for the interpreter. Task-number: QTBUG-43309 Change-Id: I67af18e14ddbc0649530ac23601332ee7d7a1f34 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 IR: move the MemberResolver out of IR::Temp.Erik Verbruggen2015-01-123-28/+42
| | | | | | | | | | | | | | | | | | Temps are copied around a lot. This patch reduces the size by storing a single pointer to the resolver. Change-Id: I074b8b729fce310542cf4697ef42107085b304b3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | QV4: Use QVarLengthArray in cleanupBasicBlocks.Robin Burchell2015-01-101-2/+1
| | | | | | | | | | | | | | | | | | Avoids heap allocations, drops around ~60ms off my morbid testcase in doing so. QBitArray is still allocating, meaning this function isn't "free", but it's now at 0.9% of runtime vs the 1.3% it was before, so something for another day. Change-Id: Ie0db8e0312bde5f67b37250d04b4d65e1f0b034d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QV4: Don't heap allocate blockNumbers.Robin Burchell2015-01-091-40/+32
| | | | | | | | | | | | | | | | | | | | | | | | Analysis of the allocations in BasicBlockSet show a huge amount of time spent in allocating and freeing BasicBlockSet, which involves heap allocations. Most of the time, blockNumbers is tiny (at least in my testing) - 0 to 1 in size at deletion time. By inlining the (small) array, we save a nasty penalty. This shaves around 400ms off the optimizer phase of my morbid QML testcase. Change-Id: I46319173b5408a0d7a1b9663fdc516c9e5ca410e Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | QML: Remove unused field from struct.Erik Verbruggen2015-01-092-4/+2
| | | | | | | | | | Change-Id: I574dd5de67038ecb2e4d81ed69ed535e3be9ea05 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Clean up JS .import/.pragma directive scanningSimon Hausmann2015-01-082-247/+54
| | | | | | | | | | | | | | | | | | | | | | There's a scanner in QQmlJS::Lexer::scanDirectives that can parse those, so let's get rid of extra parser that operates on a string. Instead this way we can do the scanning all in one shot, avoid detaching a copy of the source code string and (most importantly) bring the parser closer to the copy in Qt Creator, which uses the directives approach to extract imports and pragma. Change-Id: Iff6eb8d91a45d8a70f383f953115692be48259de Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
* | QV4: Lower time spent in indirections and allocations.Robin Burchell2015-01-071-3/+4
| | | | | | | | | | | | | | | | | | Change data type for defsUntyped from QList -> QVector & reserve space when creating the list. Drops ~250ms off a pretty morbid QML testcase, most, but not all of which was spent in allocations. Change-Id: I2ed8c62e7d41ab353a0194da268a2b430f079474 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 IR: Change data type used in RemoveSharedExpressions pass.Robin Burchell2015-01-071-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Profiling the loading of a pretty morbidly large QML file consistently showed that this was quite slow, around 1300ms in removeSharedExpressions, of which a good >600-700ms (I didn't count exactly, but it was a very large amount) was down to allocating and freeing QHash nodes. As we don't require removals, leaving insertion and lookup as the only two remaining options, a sorted vector becomes a viable alternative (credit to João Abecasis for the idea). An additional benefit of this change is that the two hash lookups are now compressed into a single 'hash' lookup (via the lower_bound call) instead of separately using contains() / insert(). Measuring the exact saving is difficult, but it looks like this saves between 700-1000ms off the runtime RemoveSharedExpressions. After this patch, malloc and free are dominating the optimizer run, instead of any particular method. Change-Id: I6c0bb8495eac4dd3613ba0274e8802d7bd609460 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add propertyName to errorAlbert Astals Cid2015-01-051-1/+1
| | | | | | | | | | | | | | | | | | May help a bit to the reader, even if the line is already there sometimes it can be confusing if it is a default property like data Change-Id: I5cb8e8833c78a784ad4f5541d094840477e8f350 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Prepare for QQmlPropertyCache to become available in QJSEngineSimon Hausmann2014-12-291-2/+1
| | | | | | | | | | | | | | | | | | The cache is seemingly tied to QQmlEngine, but it isn't. A lot of times a QQmlEngine parameter is unnecessarily dragged around and the engine member is option as well as it turns out. Change-Id: Iffd2a5046e9785249689ebfcbc8a0ad509f76aea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Initial work on gadget supportSimon Hausmann2014-12-222-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed built-in QtQml value types to use gadgets. This is in preparation for supporting external gadgets. This replaces the mostly direct inheritance of the concrete value types with gadgets and "dynamic" inheritance through QQmlValueType being generic. Over time as some of the value types may become gadgets, we can remove the ones here. It's important that these "separate" gadgets have the same memory layout as the actual types (QPointF, etc.). Also while QQmlValueType remains practically a singleton, it's not required anymore to be one. Consequently the JS wrappers for value types keep their own instance of QQmlValueType. This allows eliminating the qobject_cast in various places that dealt with the singleton nature. This comes at a cost, making the JS wrappers slightly heavier. However that is meant to be a temporary situation and finally the value type wrapper should merely store the meta-object in addition to the data and the type. Change-Id: I15071ded0a1e54203f29ec1ecf7a9ab646d1168e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QQmlJS::Codegen: Short circuit in qmlErrors to avoid QUrl allocation costs.Robin Burchell2014-12-201-0/+5
| | | | | | | | | | | | | | | | This takes the time taken in qmlErrors for my (admittedly terribly morbid) testcase from ~104ms to ~1ms. Change-Id: I288086caa6e6b58f67e9feb6f1761c3310f01ead Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Replace usage of stdout for debug output by qDebugErik Verbruggen2014-12-194-164/+144
| | | | | | | | | | | | | | | | This way even paranoid Androids can be show interesting stuff. Task-number: QTBUG-43109 Change-Id: Ib0ef9e8f6c6fc66e9ea9bfcaf2cd9e33d7469070 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Simple cache of url for QQmlCompiledDataRobin Burchell2014-12-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | Removes URL parsing and allocation/deallocation overhead as a bottleneck from cached instantiation. Takes total runtime percentage of beginCreate from 6208ms to 4987ms out of a 15 second trace of the instantiation_cached librarymetrics benchmark with the empty Item data. Task-number: QTBUG-43096 Change-Id: Ie4ec8e83461b4926e502dd78a7178cc8e8131e70 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Changed value type property index encodingSimon Hausmann2014-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to encode property index and value type property index in one int with 16 bits each, for example font.pixelSize with index of "font" in the lower 16 bits and "pixelSize" in the upper 16 bits. Detecting if a given encoded index was using value types or not was based on whether the value type index (upper 16 bits) were non-zero. That assumption holds given that all valid property indicies of value types are > 0 because they are all sub-classes of QObject, which provides the first property (objectName). With the introduction of gadgets property index zero will become popular again, and value types are a core use-case for gadgets. Therefore we need to change the encoding to allow for zero to be a valid value type property index. This is implemented by centralizing all decoding call sites to call one function that indicates -1 as non-present value type core index return value. That way we can encode the index with an offset of 1. Change-Id: I266abf140211a4f7204b47b94d07c364f0a8f408 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-092-2/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Fix QtQuick2 module unload supportChris Adams2014-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit ensures that the value type providers installed by the QtQuick2 QML module during initialization are uninstalled when the plugin is unloaded. It also fixes a bug in the type compiler so that it now works with types from plugins which get unloaded and then reloaded. Task-number: QTBUG-43004 Change-Id: I4b3fb75aae65dfbc5de9c88701ed82514087ab7d Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
| * qv4: assign split of edges to loop header to the correct groupFawzi Mohamed2014-11-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (i.e assign split edges to the correct loop group, now for real) The fix of 25b6fae1eb26645a30b3e7e254ce0b585757351c did try fix QTBUG-41766 and simplify the logic to assign the inserted statement to a loop group. Unfortunately that was incorrect if the target basic block starts a group. In that case if the source was already inside the group we should add it to the target basic block, otherwise to the one containing the target block (as before). There was no visible regression caused by this. Change-Id: Id50c42305fc5ac6aedaffa89d8f8dc3b5e976aa4 Task-number: QTBUG-41766 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Changed InternalClass to store Identifier* instead of String*Simon Hausmann2014-11-211-4/+1
| | | | | | | | | | | | | | | | | | All members are identifiers anyway, so this gets rid of a ### and also simplifies some of the call sites by removing the need for a scoped string. Change-Id: Ic6b550cdb97afa5a4b0fa7e9b13e7768ed3f6bd8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix run-time string handling with regards to the new heapSimon Hausmann2014-11-212-15/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed runtimeStrings to be an array of Heap::String pointers instead of indirect String pointers. Later that member along with other GC related members will go into a managed subclass. Meanwhile the generated code no more loads String pointers directly but just passes the index into the run-time strings to the run-time functions, which in turn will load the heap string into a scoped string. Also replaced the template<T> Value::operator=(T *m) with a non-template overload that takes a Managed *, in order to help the compiler choose the non-template operator=(Heap::Base *) overload. This allows removing a bunch of Value::fromHeapObject calls. Change-Id: I20415c0549d33cca6813441a2495976b66d4c00e Reviewed-by: Lars Knoll <lars.knoll@digia.com>