aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4objectproto_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Move workerscript to its own moduleUlf Hermann2019-05-061-1/+1
| | | | | Change-Id: I778cfe842ddf1c600a837d8f2061a338887eed95 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement support for Object.valuesLars Knoll2018-08-041-0/+1
| | | | | Change-Id: I1f2507afb1c6f148d129325088a7db9d9b6fc98e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for Object.getOwnPropertyDescriptorsLars Knoll2018-08-041-0/+1
| | | | | Change-Id: I9f80c583a5c238997b7141e11f4302a9e19c5499 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add Object.entries()Lars Knoll2018-08-041-0/+1
| | | | | Change-Id: Ia06813a7cac5bd8be99e9f6ab3cd30eac26e499f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement support for new.targetLars Knoll2018-07-031-1/+1
| | | | | | | | | Support the new.target meta property in the codegen, and add support for passing the newtarget into the constructor vtable methods and the execution context. Change-Id: I62ea58e5e92d894035a76e35776203e9837c383b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prefix vtable methods with virtualLars Knoll2018-07-031-2/+2
| | | | | | | | | Turns out that the overloading of vtable methods and regular ones is problematic in some cases. So let's rather make it explicit which methods are part of the vtable, and which aren't. Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement Object.is and Object.getOwnPropertySymbolsLars Knoll2018-05-241-8/+10
| | | | | Change-Id: Id64f91f6bf1abbcfa28590a43fb4f8673db6730b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement Object.setPrototypeOf()Lars Knoll2018-05-231-0/+1
| | | | | Change-Id: I4488ea4855a52bc7fd386d2eec8c35def83f2785 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Convert runtime methods of Object to new calling conventionLars Knoll2017-11-131-27/+27
| | | | | Change-Id: Ic34164af0ad86347a791a56a438a71d458f198a4 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Change signature for call/callAsConstructorLars Knoll2017-11-071-2/+2
| | | | | Change-Id: I159b57acc7a2133ef1ad545aa84e792c63449a57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename the construct 'virtual' method to callAsConstructorLars Knoll2017-11-071-1/+1
| | | | | | | To make it consistent with the rest of the engine. Change-Id: I57b98fa26134f9864c663f47371ef3e9ca16ac9c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Remove Scope::result and convert calling convention for builtinsLars Knoll2017-08-081-27/+27
| | | | | | | | Allow for faster calling of builtins, and completely avoid scope creation in many cases. Change-Id: I0f1681e19e9908db10def85a74e134a87fc2e44c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Change function signatures for call/construct backLars Knoll2017-08-041-2/+2
| | | | | | | | Change those back again to return a value. This will be required to avoid creation of Scope objects between JS function calls. Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* ObjectPrototype: Implement Object.assign from ES6Robin Burchell2017-02-091-0/+1
| | | | | | | | | | | [ChangeLog][QtQml] Object.assign from the ES6 specification is now implemented. This fixes another bunch of failures on test/built-ins/Object/, from 375 to 348 failures. Change-Id: I815b0f3b43efcd6af8f24b26c5215ce9943b3efa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Speed up invocation of builtin functionsLars Knoll2017-01-251-26/+26
| | | | | | | | 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>
* QML: Make Heap::Object and all subclasses trivialErik Verbruggen2016-10-061-1/+1
| | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | 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>
* 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>
* More cleanupsLars Knoll2015-04-211-2/+2
| | | | | | | | 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>
* 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>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-2/+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>
* Use the engine instead of the context where it makes senseLars Knoll2014-11-151-2/+2
| | | | | Change-Id: I17a3b6f4b3c076107dc9a8de667ac526566ea6e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Replaced more usages of Returned<T> with Heap::T*Simon Hausmann2014-11-141-1/+1
| | | | | Change-Id: I451128ee71610bfeb71139c28da89a00a8209ec6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move more Data members over to the Heap namespaceLars Knoll2014-11-081-4/+9
| | | | | Change-Id: I74347da3f0f47220bb1f8cf13b872b547fd18a4d 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>
* 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>
* Fix Managed::as<>() methodLars Knoll2014-07-221-1/+1
| | | | | | | | | | | | | | | 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 most simple objects to the new constructor schemeLars Knoll2014-07-221-2/+0
| | | | | Change-Id: I90042037bc0555771bd98233977c7d2b735bb718 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert remaining FunctionObject's to new constructor schemeLars Knoll2014-07-221-1/+3
| | | | | 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>
* Rename V4_OBJECT_NEW back to V4_OBJECTLars Knoll2014-07-221-1/+1
| | | | | | | | 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 objects without own dataLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I790ec9e42e680842a6b9722e67981314fdfa3a2c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Split ManagedVTable into two classesLars Knoll2014-01-211-1/+1
| | | | | | | | Keep the basic methods in ManagedVTable, but have the Object related stuff in an ObjectVTable class. Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Simplify & speed up function callingLars Knoll2013-11-091-26/+26
| | | | | | | | | Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more occurrences of QV4::ValueLars Knoll2013-09-301-1/+1
| | | | | Change-Id: I66c370680d7e6bee2e73a7a940aa96ab4009ec57 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix API for Object::define*PropertyLars Knoll2013-09-281-1/+1
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make qv4objectproto GC cleanLars Knoll2013-09-221-1/+1
| | | | | | | Fix the remaining usages of raw pointers into the GC heap. Change-Id: I3654a6f74fe6b59e25ed65a79ff02c29cc2cdecc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup Object::define*Property APILars Knoll2013-09-221-1/+1
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Extend the ReturnedValue mechanism to pointers to Managed objectsLars Knoll2013-09-181-3/+1
| | | | | | | | | | | | | Add a Returned<T> that we can return instead of raw pointers to Managed objects. Start using the Returned<T> for a few methods. Also clean up all our classes to use the Q_MANAGED macro instead of manually defining their vtable. Change-Id: I0a2962e47f3de955cd2cd8474f8f3fcc9e36d084 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert builtin methods to return a ReturnedValueLars Knoll2013-09-181-27/+27
| | | | | Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use ReturnedValue for Managed::construct()Lars Knoll2013-09-181-1/+1
| | | | | Change-Id: I9e702d60c4e1b7ba19a699ff7a8d53876d6cd5f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a ReturnedValue for Managed::call()Lars Knoll2013-09-181-1/+1
| | | | | Change-Id: Ief2d75e9789dd367c603d90dc0fe5316a0d055e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change signature of call/construct() to take a pointer to a CallDataLars Knoll2013-09-111-2/+2
| | | | | Change-Id: I5467aadba083e4b01fb0a7170946695207033680 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move prototype pointer into QV4::InternalClassLars Knoll2013-09-021-1/+1
| | | | | | | | | | | | | The prototype is actually the same for most objects. By moving it into the internal class, we can save 8 bytes per object, as well as allowing for some future optimizations. Also fix a bug in the implementation of the Error prototype objects. Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* change calling convention for JS function callsLars Knoll2013-09-021-2/+2
| | | | | | | | | | | | This allows faster pass through of the data if we have nested calls. Also make sure we always reserve at least QV4::Global::ReservedArgumentCount Values on the stack to avoid stack corruption. Change-Id: I42976460f1ef11a333d4adda70fba8daac66acf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Restructure source codeLars Knoll2013-08-081-0/+107
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>