aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arrayobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Unify mark handling for MemberData and ArrayDataLars Knoll2017-03-091-2/+2
| | | | | | | | Introduce a ValueArray class, that defines an array of Values at the end of a Heap Object. Change-Id: I00efbf6f5839a6687dd5bc5fc037ec8f06e0936e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Speed up invocation of builtin functionsLars Knoll2017-01-251-347/+328
| | | | | | | | Completely avoid creation of a CallContext for those methods, as we don't need it. Change-Id: Iff1a38fd3c7e846df6ec0374cb7b3fb8f1b4de3a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add ECMAScript 6 Array find and findIndex methodsKai Uwe Broulik2016-11-101-0/+76
| | | | | Change-Id: I318fa243ab68b8a714923ab816d62e8c544fca8c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-101-5/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/quickwidgets/quickwidget/main.cpp src/qml/jsruntime/qv4jsonobject.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/jsruntime/qv4qobjectwrapper_p.h src/qml/qml/qqmlengine.cpp src/qml/qml/qqmlpropertycache.cpp src/qml/qml/qqmlpropertycache_p.h src/quick/items/qquickanimatedsprite.cpp src/quick/items/qquickitem.cpp src/quick/items/qquickitem.h src/quick/items/qquickitem_p.h src/quick/items/qquickview_p.h src/quick/scenegraph/qsgcontext.cpp src/quick/scenegraph/qsgdefaultrendercontext.cpp Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-301-5/+8
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I241cd418bb7e7b95e0a0a2ee4c465d48be2a5582
| | * Fix crash on Array.prototype.join.call(0)Robin Burchell2016-09-291-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | We (incorrectly) didn't check the return value to make sure we had a valid self. At the same time, rename the self variable to match up with other methods. Task-number: QTBUG-53672 Change-Id: Ia0ae5a553e49c4c3b2834c7fdf649fe6373951a2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QML: Make Heap::Object and all subclasses trivialErik Verbruggen2016-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC6 might dead-store-eliminate out our secret write to Base::mmdata, because it expects all memory content to be "undefined" before constructor calls. Clang might take the same approach if the constructor of Heap::Object is removed. By making these structs trivial, it also makes them memcpy-able. Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | V4: Pass scope around as parameters inside the runtime.Erik Verbruggen2016-06-221-34/+30
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of many (or all) runtime functions consist of first creating a QV4::Scope, which saves and restores the JS stack pointer. It also prevents tail-calls because of that restoring behavior. In many cases it suffices to do that at the entry-point of the runtime. The return value of a JS function call is now also stored in the scope. Previously, all return values were stored in a ScopedValue, got loaded on return, and immediately stored in another ScopedValue in the caller. This resulted in a lot of stores, where now there is only one store needed, and no extra ScopedValue for every function. Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* / Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Move the StringValue members of ExecutionEngine onto the JS stackLars Knoll2015-06-101-12/+12
| | | | | Change-Id: Ib55c05f1730b7659e2f6fee7e1fa79c10c759167 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-0/+1
| | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Rename Heap::Base::as() to cast()Lars Knoll2015-04-211-1/+1
| | | | | | | | The as() methods in other places to dynamic type checking, whereas cast() methods are basically the same as a static_cast. Change-Id: Iacd0174824b41b8fad05d6b55b1e62e3b44a31db Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* More cleanupsLars Knoll2015-04-211-3/+3
| | | | | | | | Get rid of Value::asObject(), and pass const Managed pointers into some more vtable methods. Change-Id: Ia4f427d5fd8868f77b4015d1ce5424d32bfc2115 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Further cleanupsLars Knoll2015-04-161-2/+2
| | | | | | | | | The get and getIndexed vtable methods should take a const Managed pointer. Start cleaning up the asFoo() methods in Value and Managed by removing asArrayObject() and asErrorObject(). Change-Id: Ibd49bf20773ef84c15785b7ac37a7bc9fd4745d5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Wrap members in Object in a Heap::PointerLars Knoll2015-03-201-1/+1
| | | | | Change-Id: I0d132592487255027c215da21fbec15b23b00624 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | 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>
* CleanupsLars Knoll2015-01-231-55/+55
| | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* CleanupsLars Knoll2015-01-231-4/+4
| | | | | | | | Remove duplicated methods. Remove some mostly unused methods, and simplify some others. Change-Id: I605b249e54417bb32c3dfc8e22f2c8b6b684a1e1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove all remaining usages of ValueRefLars Knoll2015-01-231-1/+1
| | | | | Change-Id: Icd76d3d03fac2e57530e55f8ec15b97109dcdcbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-3/+2
| | | | | | | | | | | | 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>
* Get rid of all uses of Managed::engine()Lars Knoll2015-01-211-1/+1
| | | | | Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove all the setVTable() calls that aren't required anymoreLars Knoll2015-01-211-1/+0
| | | | | | | | The memory manager's allocation methods now set this up correctly for us :) Change-Id: I8492bf732df601f95a1a851fb3804127ffc83935 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of hasAccessorProperty in Heap::BaseLars Knoll2015-01-121-1/+3
| | | | | | | | | This shouldn't affect performance as we can just as well check for cases where we need to take the slow path differently. Change-Id: I4b9f69c39e9e64b437820ca3a6ea43e8877f2cf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedObject typedef instead of actual typeOleg Shparber2015-01-031-8/+8
| | | | | Change-Id: I0b68c534ea513a7c230b12114f6b42b069f9864b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedArrayObject typedef instead of actual typeOleg Shparber2015-01-031-5/+5
| | | | | Change-Id: I975536745ac6c264aca074f84d223fbec7682d3d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedFunctionObject typedef instead of actual typeOleg Shparber2015-01-021-7/+7
| | | | | Change-Id: I6b4effaa5bef992b4ae9402eea7fe655bc7b18f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove most of the places where getPointer() is usedLars Knoll2014-12-201-9/+9
| | | | | | | This is no longer required, and simply uglifies the code Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add default parameter value for ExecutionEngine::newString()Oleg Shparber2014-12-121-1/+1
| | | | | Change-Id: I8efbfb07ea61e2c6d03eeb79671006d209e4d48e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Object::arrayData() accessor to return a heap objectLars Knoll2014-12-111-4/+4
| | | | | Change-Id: Iffc82c2f415251d73bb7446848399b54b16589c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove non required arrayData() accesses from qv4arrayobject.cppLars Knoll2014-12-101-7/+7
| | | | | Change-Id: Iaa012b85cad20fa3887c1308dd38d35da8c423b4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove ExecutionContext from the array sorting codeLars Knoll2014-11-151-1/+1
| | | | | Change-Id: I3c59fdb2413664f1c541264a89613a325ecefd2a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup: remove Value::toString/Object overloads taking a contextLars Knoll2014-11-151-20/+20
| | | | | Change-Id: I4cb63c3cc4eb9bb81f10f9826f80e581b4e1990c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Ported ExecutionEngine::newString and newIdentifier to Heap::StringSimon Hausmann2014-11-121-3/+3
| | | | | | | | | | Avoid the use of Returned<String> for newString and changed the identifier table to use Heap::String. This required moving some code back into Heap::String, but that's code that doesn't call back into the GC, so allocations and therefore future object moves aren't possible. Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move Data of Variant and ArgumentsObject into Heap namespaceLars Knoll2014-11-081-2/+2
| | | | | Change-Id: Id2092a15c9fb5341d9b5cf4a9ac7a978308e4174 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Data of FunctionObject and related classes into HeapLars Knoll2014-11-081-1/+1
| | | | | Change-Id: Iadf74f953798c1884e0ec704ccb7c70d971e3273 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Begin moving the data out of Managed objectsLars Knoll2014-11-081-5/+6
| | | | | | | | | | | We need to move the Data objects out of the Managed objects, to avoid lots of trouble because inner classes can't be forward declared in C++. Instead move them all into a Heap namespace. Change-Id: I736af60702b68a1759f4643aa16d64108693dea2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the throw methods from ExecutionContext to ExecutionEngineLars Knoll2014-11-041-12/+12
| | | | | | | | The methods don't require a context, and thus shouldn't be implemented there. Change-Id: If058e0c5067093a4161f2275ac4288aa2bc500f3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup header file dependenciesLars Knoll2014-11-041-0/+1
| | | | | Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't check the this pointer for 0 in member functionsLars Knoll2014-10-271-0/+3
| | | | | | | | | | | | This actually violates the C++ standard that defines that you aren't allowed to call member functions on an invalid object. Instead insert the 0 pointer checks on the caller side where required. Change-Id: I8be3c3831594bb6482e9ef6de6e590ec437ac0f8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rework our simple array implementationLars Knoll2014-10-271-14/+11
| | | | | | | | | | | Implement the simple array as a circular buffer instead of an array with head room. This fixes a couple of severe issues with performance and memory management if the array is being used as a queue. Task-number: QTBUG-41421 Change-Id: I146ad8a874407c108aa8fe1eae68e9957e154847 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Merge remote-tracking branch 'origin/5.3' into devSimon Hausmann2014-07-261-2/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4engine.cpp Change-Id: Ie3ef6202b6a3a8521971e1be10c40c6a2db6989c
| * shift and unshift fail for QQmlSequence typesMartin Jones2014-07-221-2/+2
| | | | | | | | | | | | | | | | | | QQmlSequence is a Custom array type, so must use the generic shift/unshift implementation. Task-number: QTBUG-40244 Change-Id: I491d9dc87a3a204daad4cf7460ffac81165056a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Convert most simple objects to the new constructor schemeLars Knoll2014-07-221-5/+0
| | | | | | | | | | Change-Id: I90042037bc0555771bd98233977c7d2b735bb718 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert remaining FunctionObject's to new constructor schemeLars Knoll2014-07-221-2/+2
| | | | | | | | | | Change-Id: I440d5b128d0ee28566ebfa82c2505a4bd97bba6b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of all uses of ObjectRefLars Knoll2014-07-221-1/+1
| | | | | | | | | | Change-Id: I705e2362dcda542f56826dadec6b0a6f15848788 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of StringRefLars Knoll2014-07-221-4/+4
| | | | | | | | | | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert ExecutionContext to new storage schemeLars Knoll2014-07-221-76/+76
| | | | | | | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move ArrayData over to new data layoutLars Knoll2014-07-221-2/+2
| | | | | | | | | | Change-Id: Ic51f37bea030b196f0fa35ab21e618447edaa25d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move object data into internal structureLars Knoll2014-07-221-12/+12
| | | | | | | | | | Change-Id: I1fcccd535ed356e736468337bd450270cd290044 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>