aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4internalclass_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-061-0/+11
| | | | | | Task-number: QTBUG-48594 Change-Id: Ifc207938de7f0c8995fc712df92665f222612647 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Speed up QQmlEngine constructorLars Knoll2015-09-251-0/+1
| | | | | | | | | | | | | | | | Freezing the global object using a script is pretty slow, esp. given that the script needs to be compiled as well. Rather do it programmatically. The old code actually had a bug that would only cause the global object to be frozen, not it's children. The new code fixes this, but doesn't completely freeze the objects. Instead it makes all the existing properties of the global object and it's children readonly, but still allows extending existing objects with new properties. Change-Id: I0d7331cdc89a0ac717b8ed3b1a490b2a3742de02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Cleanup some of the casting codeLars Knoll2015-03-201-1/+1
| | | | | | | | Get rid of value_cast, and move the Managed::as() method into Value. Change-Id: I440ac44ae77f4fda1a8a837383fe631f432f6532 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>
* Remove the remaining bit of code that use the vtable in the internalClassLars Knoll2015-01-211-9/+2
| | | | | Change-Id: Ia52f0e6db325aab37477d455f163487b319dce29 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move extensible into the internal classLars Knoll2015-01-121-1/+4
| | | | | | | | With this, we can now save one pointer per Heap object. Change-Id: I7f69193ff51c9fd9c5dbfba90aa1ebb3f93da2e6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Replace InternalClass transitions hash with a sorted vector.Robin Burchell2015-01-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | In a reasonable test application, there were some 1697 transition entries. Out of these, 1663 of them had only a single item. The remainder, with the exception of three, had <10 items. Only one of these had a count of >50 items (86). As can be seen, most of the time, transitions is usually quite sparsely populated, so using a hash is a large amount of overhead considering there's just a few elements. For the times when it isn't, the vector being sorted should help take care of that. Since transitions are never removed, we can use a similar trick to ba690fb73864915b4a35bbec5b7dc134ff1dafd0 and use a sorted vector to store them. Compared to the hash approach, this saved ~412kb according to malloc_stats on a reasonably comprehensive test application. Coincidentally, this also improved v8bench for me by ~10%. Note that this undoes 132cdfa69cae45d0c02ea715ce58722bbcd57e73, but the expectation is that the fewer allocations done by using a vector will outweigh the need to reserve any specific allocation initially. Change-Id: Iec57a7db7e9a60347c9683b1cb1598f6d9c866f7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move prototype back from the vtable into ObjectLars Knoll2014-12-111-6/+2
| | | | | | | | This is the only way we can support a GC that moves objects around in memory. Change-Id: I1d168fae4aa9f575b730e469e762bc5b5549b886 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Changed InternalClass to store Identifier* instead of String*Simon Hausmann2014-11-211-3/+5
| | | | | | | | | 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>
* Cleanup header file dependenciesLars Knoll2014-11-041-2/+2
| | | | | Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae 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>
* Get rid of StringRefLars Knoll2014-07-221-3/+0
| | | | | | | | 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>
* Fix marking of prototype objects in internal class poolSimon Hausmann2014-04-281-2/+7
| | | | | | | | | | As per reported bug, we have to protect ourselves against potential loops and can mark the internal classes much simpler by just walking through the memory pool they were allocated in. Task-number: QTBUG-38299 Change-Id: I3ae96e8082e76d06f4321c5aa6d2e9645d2830a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Reserve a double slot for accessor propertiesLars Knoll2014-03-071-1/+5
| | | | | | | | | | Reserve two slots in the internal class for accessor properties. This opens up reducing the default storage required per data property to one Value. In practice this implies cutting the required memory in half. Change-Id: Ifed897852bbdfd810018f0d6b049fca6690ead2c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove setVTable calls in performance critical areasLars Knoll2013-12-041-0/+1
| | | | | | | | | | Remove all the calls to setVTable that were in performance critical parts of the code. This now brings performance back to the level we had with the vtable inlined in the Managed objects. Change-Id: I76317cc5c53b5b700d1d3883b954407142a4c424 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the vtable pointer from the object to the internal classLars Knoll2013-12-041-2/+11
| | | | | | | | This saves one pointer per object, and willmake other optimizations easier in the future. Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Greatly reduce memory consumed by QQmlEngine instancesLars Knoll2013-11-191-6/+92
| | | | | | | | | | | | | | | | Due to a inefficiency in our InternalClass implementation, we were not sharing the string and attribute table between internal class instances. This was extremely inefficient with the Qt object, as it created around 1000 internal classes with large string and property tables. With the patch these tables are now shared. Reduces memory consumption of a QQmlEngine instance from around 6.5M to a couple of 100k. Change-Id: Ib763f31deca0808c000ac2c30aa0b05e806bda40 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Cleanup API of Safe<T>Lars Knoll2013-10-021-0/+2
| | | | | | | | Don't have an implicit cast operator to Returned<T> anymore, and return a T* from the operator->() Change-Id: If4165071b986bfc84a157560d94d39c2dcfbc9e1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use StringRef for most methods in ObjectLars Knoll2013-09-221-1/+1
| | | | | Change-Id: I8e2dad0e9e34c5a549952bc0765cd57f6aa8aadf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add the object's prototype to the InternalClass structureLars Knoll2013-09-021-2/+9
| | | | | Change-Id: Ifa97d3354a7a7afadf70f9ba540716bd5b1eef44 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Restructure source codeLars Knoll2013-08-081-0/+154
Move the v4 engine classes from a subdir of qml/qml into two subdirs (compiler and jsruntime) of the qml module Remove an unsued qv4syntaxchecker class, and move the moth code directly into compiler. Change-Id: I6929bede1f25098e6cb2e68087e779fac16b0c68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>