aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation with ICC on WindowsThiago Macieira2015-09-021-0/+3
| | | | | | | | | | | | | | | | | | QV4::Managed is not copyable and its default constructor is deleted. However, it and classes derived from it are exported, which on Windows means the compiler will instantiate all possible functions and add to the DLL. ICC on Windows, unlike MSVC, attempts to instantiate the default constructor of the derived classes (like CallContext) and then the build fails due to the deleted Managed() constructor. Instead, use V4_MANAGED to mark each and every managed class as non- default-constructible and non-copyable. Only one note: the V4_MANAGED macro in QV4::Managed itself takes different parameters, so it needs to be slightly different. Task-number: QTBUG-48063 Change-Id: I42e7ef1a481840699a8dffff140007c65a7a35db Reviewed-by: Lars Knoll <lars.knoll@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>
* Store a double in NumberObjectLars Knoll2015-01-231-7/+7
| | | | | | | Makes more sense than storing a Value in there. Change-Id: I2e6ca71477100c1e1639bb89cced4f4049b5e5c2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* CleanupsLars Knoll2015-01-231-8/+8
| | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the definition of Object vtables into qv4object_p.hLars Knoll2015-01-231-0/+60
| | | | | Change-Id: I8dc15999e268d2d78691bf030b36cd09de1c4057 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-25/+25
| | | | | | | | | | | | 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>
* Move the internalClass pointer into Heap::ObjectLars Knoll2015-01-211-1/+5
| | | | | | | | The other classes that derive from Heap::Base don't need it at all. So get rid of it there and save a pointer. Change-Id: I9c5df2e43cd6eeac2e6e41f3d3b8077d3afbc8f2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the remaining bit of code that use the vtable in the internalClassLars Knoll2015-01-211-3/+3
| | | | | Change-Id: Ia52f0e6db325aab37477d455f163487b319dce29 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move vtable out of internalClassLars Knoll2015-01-201-1/+1
| | | | | | | | | | | | | | | | We can move the internalClass to Object later on, and such save having the internalClass on lots of Heap objects. This commit basically adds and starts making use of a new vtable pointer in Heap::Base. In addition, the construction methods in the memory manager now automatically setup the correct vtable. Removing the vtable code from InternalClass and moving it into Object will come in a separate commit Change-Id: If49e8d73c769bf65bf47fe4dbf8b9546c8019dbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move extensible into the internal classLars Knoll2015-01-121-2/+1
| | | | | | | | With this, we can now save one pointer per Heap object. Change-Id: I7f69193ff51c9fd9c5dbfba90aa1ebb3f93da2e6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of hasAccessorProperty in Heap::BaseLars Knoll2015-01-121-7/+1
| | | | | | | | | 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-1/+1
| | | | | Change-Id: I0b68c534ea513a7c230b12114f6b42b069f9864b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make Property uses GC safeLars Knoll2014-12-201-11/+13
| | | | | Change-Id: I5aa41a07a2d25e5c8a2d64bfa58a55fcd7aaf77e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix the way we set the property name during iterationLars Knoll2014-12-201-2/+2
| | | | | | | This was broken due to the new inheritance scheme for Managed Change-Id: Ia9df50e7e655c3a812a01a2c78945e648aa444dc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Return a Heap::Object in Object::prototype()Lars Knoll2014-12-171-4/+6
| | | | | Change-Id: Ice0265ae558ba14497421a5bbf25ee9db76adab5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move prototype back from the vtable into ObjectLars Knoll2014-12-111-48/+56
| | | | | | | | 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>
* Fix Object::arrayData() accessor to return a heap objectLars Knoll2014-12-111-2/+1
| | | | | Change-Id: Iffc82c2f415251d73bb7446848399b54b16589c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove arrayData() calls from qv4object.cppLars Knoll2014-12-101-7/+7
| | | | | Change-Id: I92c74e87918a5f958ff17f4cbbc1888b58833fc6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove two reinterpret_casts in ObjectLars Knoll2014-11-221-5/+5
| | | | | Change-Id: I921cd8129acb47cffd58be9551a6925c4f296d41 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change signature of defineOwnProperty to take an engine instead of a contextLars Knoll2014-11-151-6/+6
| | | | | Change-Id: Ib0d558d17162a205974c6f2f0daf8af5b0b9547b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert methods in RuntimeHelpers to take an engine pointerLars Knoll2014-11-121-1/+1
| | | | | | | This is safer and cleaner than to use a context pointer. Change-Id: Id5ef4e6667571897cd029125a0bdc18ce299da6d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Data for Number/Boolean/ArrayObject into the HeapLars Knoll2014-11-081-42/+49
| | | | | Change-Id: Ifc1c38b00f1b6b11e69caeb195429e2dd4c05d4f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Object::Data into the Heap namespaceLars Knoll2014-11-081-20/+25
| | | | | Change-Id: I9d30081f71b83bc86f5e5714e23396b18c4d54c5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Begin moving the data out of Managed objectsLars Knoll2014-11-081-11/+11
| | | | | | | | | | | 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>
* Get rid of Members and directly store MemberData::Data pointersLars Knoll2014-11-071-9/+15
| | | | | | | And do the same change for ArrayData. Change-Id: Ia1ae56bd0ff586c9b987e15af7a53f395a37054a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Let markObjects() operate directly on HeapObjectsLars Knoll2014-11-041-1/+1
| | | | | | | | | This decouples things a bit better and helps moving over to directly store heapobject pointers in other objects. Change-Id: I798f922e018b0a3ca6f8768e4a810187f34d82f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup header file dependenciesLars Knoll2014-11-041-57/+4
| | | | | Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Reduce size of ArrayData by one pointerLars Knoll2014-10-271-2/+1
| | | | | | | | | | The pointer to the real data is not required anymore, as it always follows the class itself. Like this we save one pointer of overhead, and one indirection when doing reads and writes of array data. Change-Id: If6afdac8e97b57420b50e7b7eb8979f77e8dbbcf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rework our simple array implementationLars Knoll2014-10-271-2/+2
| | | | | | | | | | | 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>
* Cleanup: Get rid of __data membersSimon Hausmann2014-07-221-10/+0
| | | | | | | These are not needed anymore Change-Id: Ib834aa294e84ca9fbdd5b6850d5bc172e8b54ba1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix Managed::as<>() methodLars Knoll2014-07-221-4/+4
| | | | | | | | | | | | | | | The as<> casting method was not doing the right thing in 100% of the cases. It only checked if the object in question was exactly of the type being asked for. It however didn't check if the object was derived from the type. This commit fixes this by adding a parent chain to the vtables, that is then being used to check this safely at runtime. Change-Id: I9e0b13adbda668aee8c7451e2bb71cd6d4e316d9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert the last Managed types to the new constructor syntaxLars Knoll2014-07-221-3/+0
| | | | | Change-Id: I11701c586d4715c08feba4650e12904c3fa7ca27 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert most simple objects to the new constructor schemeLars Knoll2014-07-221-26/+28
| | | | | Change-Id: I90042037bc0555771bd98233977c7d2b735bb718 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert regexpsLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I5b62a265a7ce363a16b1e14ae93cadbb1ab0cb5b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Start implement new Object creation patternLars Knoll2014-07-221-0/+6
| | | | | | | | | Create objects through a static create() method that returns a pointer to the objects Data. This will later on simplify breaking the direct connection between Object and Object::Data. Change-Id: Id8daa3c766429bc36f432868e1957846147c96b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of all uses of ObjectRefLars Knoll2014-07-221-15/+0
| | | | | Change-Id: I705e2362dcda542f56826dadec6b0a6f15848788 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the less often used Ref classesLars Knoll2014-07-221-2/+0
| | | | | Change-Id: I9ee531c903317a0f324671d98af1f967b684915c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of StringRefLars Knoll2014-07-221-25/+25
| | | | | | | | 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>
* Rename Managed::managedData() to d() to be consistentLars Knoll2014-07-221-4/+4
| | | | | | | | No need to differentiate in the name anymore, as the data structures all inherit from each other now. Change-Id: Ia41f50ce4e521f9626d874311ceb57e0e194888b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename V4_OBJECT_NEW back to V4_OBJECTLars Knoll2014-07-221-4/+4
| | | | | | | | The _NEW variant was there only temporarily to aid converting to the new data layout. Change-Id: I1d126ee0999c8f0a49f5a08c2e8c090497dd6dd5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ArrayObject over to the new storage schemeLars Knoll2014-07-221-1/+1
| | | | | Change-Id: Ib453d682902ccc751fc8fadf2ef9e21c0c234f69 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert Boolean and NumberObject to the new Data schemeLars Knoll2014-07-221-16/+18
| | | | | Change-Id: I418103fdca625692d4aa33a1466df0083b063bcb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* First step unifying data structuresLars Knoll2014-07-221-15/+15
| | | | | | | | | Make Object::Data inherit from Managed::Data. To keep this working in the current allocation scheme, we need a dummy ObjectData in Object for now. Change-Id: I39036c0bf0431f1c2cf32dadc17a3742ff8d6831 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move ArrayData over to new data layoutLars Knoll2014-07-221-7/+8
| | | | | Change-Id: Ic51f37bea030b196f0fa35ab21e618447edaa25d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert Boolean, Number and DateObjectLars Knoll2014-07-221-8/+24
| | | | | Change-Id: I8815578422fe1af87eb5f02899f35131fea70b76 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move object data into internal structureLars Knoll2014-07-221-18/+29
| | | | | Change-Id: I1fcccd535ed356e736468337bd450270cd290044 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Managed data into it's own subclassLars Knoll2014-07-221-6/+12
| | | | | | | | | 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>
* Avoid calling destroy() on most objectsLars Knoll2014-07-221-2/+0
| | | | | | | | | 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 compiler warningLars Knoll2014-06-181-1/+2
| | | | | Change-Id: I26df4f1b8417c6b075d81eaf118669a4103503e2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>