aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arraydata.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Move Managed data into it's own subclassLars Knoll2014-07-221-1/+1
| | | | | | | | | | | | | | | | | | This prepares for moving over to a d pointer scheme, where Managed subclasses don't hold any data directly. This is required to be able to move over to a modern GC. Change-Id: I3f59633ac07a7da461bd2d4f0f9f3a8e3b0baf02 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of different macros for vtable specializationsLars Knoll2014-07-221-1/+1
| | | | | | | | | | | | | | Detect existence of a a vtable entry at compile time. Change-Id: Ieed5d34b063184bc4435b22c6685ac0e3fabf493 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Avoid calling destroy() on most objectsLars Knoll2014-07-221-5/+1
|/ | | | | | | | | The method is now optional, and we can simply avoid calling it if all members an object has are themselves garbage collected. Change-Id: If560fce051908bcc10409ead1a7d8a5bd5fa71d2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* 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 <lars.knoll@digia.com>
* 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 <lars.knoll@digia.com>
* Cleanup our runtime methodsLars Knoll2014-03-111-1/+1
| | | | | | | | | Move all our runtime methods into the QV4::Runtime struct and give them nicer names without underscores. Sort them logically and remove a few unused methods. Change-Id: Ib69b71764ff194d0ba211aac581f9a99734d8180 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix copying of Property'sLars Knoll2014-03-101-1/+1
| | | | | | | | | | Data properties don't contain valid data in the set field if they are being stored in Objects. Thus we should never access that field unless we are dealing with accessor properties. Change-Id: I19dcbaee7ebd042ae24387f92a93571d75ca578a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* CleanupsLars Knoll2014-01-311-14/+14
| | | | | | | | | | Remove SafeValue, it was used to port over to an exact GC. Since we now have that, we can now safely merge it with QV4::Value again. Also rename SafeString to StringValue for better naming consistency. Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move ArrayElementLessThen to qv4arraydata.cppLars Knoll2014-01-311-0/+41
| | | | | | | This is the only place the class gets used. Change-Id: Iebb0cba7af30c1b2da68f67596c349d5e20c5053 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allocate the ArrayData object and it's data togetherSimon Hausmann2014-01-241-99/+148
| | | | | | | | Reduce the amount of allocations required for Arrays, and allows freeing the array data more easily in the GC. Change-Id: I3e3213f089c45c83a227038ce444aa60b2735b7f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change virtual methods in ArrayData to take Object pointerLars Knoll2014-01-241-50/+52
| | | | | | | | | Pass a pointer to the underlying object instead of the ArrayData to virtual methods that modify the arrayData. This prepares for allocating the ArrayData together with the array itself. Change-Id: I66fe187f8b1e4d382ab243a518dbde5f18a1d16d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Turn ArrayData into a Managed objectLars Knoll2014-01-231-22/+20
| | | | | | | | | Memory manage ArrayData. Once the ArrayData is moved to be inline inside the object, this will save quite some time for allocating and freeing arrays. Change-Id: I19a520161d41bfe3d83f377af0b41db4ac5b99e4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Adjust method naming to be closer to ManagedLars Knoll2014-01-211-13/+22
| | | | | | | | Also make markObjects() virtual, to be in line with Managed. Change-Id: I3e7682216660e2027c02c9181e541b12310902f3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a SimpleArrayData classLars Knoll2014-01-201-181/+195
| | | | | | | | | | | | | | | | This makes the ArrayData class 'pure virtual'. SimpleArrayData now contains the implementation of simple arrays. This makes the separation between simple and sparse arrays a lot cleaner. It also allows us to move len and offset from the base class into the SimpleArrayClass. This fixes some bugs where we accessed len for sparse arrays leading to some buggy behavior. Added a virtual length() method to ArrayData to query the highes used index in the Array. Change-Id: Iab2ba2a48ebe5b7031759eeb4ebe02b4d86233f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Save memory on array dataLars Knoll2014-01-201-113/+208
| | | | | | | | | | | | | | | | | | | | | Store a simple vector of Values in the array data, instead of a Vector of Property's. This halfes the memory consumption on 64bit and simplifies our code. If an indexed property gets converted to an accessor property, we simply convert the ArrayData into a SparseArrayData. Add support in SparseArrayData to allocate double slots (two Value's) to hold a full Property in case someone sets an accessor on an indexed property. Some methods still return a Property*, but this is safe, as only the first Value in the Property pointer will ever get accessed if the Property doesn't contain an accessor. Change-Id: Ic9b0f309b09a2772a328d947a10faaf3be9fe56f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rework array handling for JS objectsLars Knoll2014-01-091-0/+563
Split up ArrayData into two classes, one for regular arrays, one for sparse arrays and cleanly separate the two cases. Only create array data on demand. Change-Id: I9ca8d0b53592174f213ba0f20caf93e77dba690a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>