aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jscall_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Engine: Cleanup method argument passingFabian Kosmale2021-03-041-2/+2
| | | | | | | | | | | | Instead of arguments around as a pointer to [argc, metaTypeId1, metaTypeId12, ...] pass argc and a pointer to [QMetaType1, QMetaType2] around. Moreover, make use of the fact that we now carry the metatype instead of only the id in a few places, to avoid id -> metatype lookups. Task-number: QTBUG-82931 Change-Id: Ib00e4d793727f85f3358a8162d1aac972daab3d3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4::populateJSCallArguments: Use v4->metaTypeToJSFabian Kosmale2021-02-191-1/+1
| | | | | | | | | | It appears that nowadays v4->metaTypeToJS handles QVariant and QObject derived classes just fine, and in exactly the same way as the custom code in populateJSCallArguments did. Task-number: QTBUG-82931 Change-Id: Ic5f97dfc3296a409fdd6a1fcb78d3b9bdba5f3a1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Transform JSCallData args setting into a functionAndrei Golubev2021-02-121-0/+2
| | | | | | Change-Id: I4154a0b5c7115375292794e0564d2f3657e6b4dd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix crash when running with aggressive gcSimon Hausmann2018-08-281-0/+1
| | | | | | | | | | The CallData is allocated on the JS stack explicitly uninitialized. So it's important to initialize all fields (including the new newTarget) to avoid dangling pointers. Task-number: QTBUG-70205 Change-Id: Id3511fa5e32a75b3cb16f39cc0805dc2ebf42f71 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement IsConstructor for Function objectsLars Knoll2018-08-231-4/+2
| | | | | | | | Use the jsConstruct member in the function object for this and set it to a nullptr for methods that are not a constructor. Change-Id: I63d2971b23b2596a8e3b6d2781f0d9ed3208693b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move the C++ and JS stack frame definitions into it's own fileLars Knoll2018-07-031-0/+1
| | | | | Change-Id: I86e89e07197aec6071809c2d32bd5c98cb7ac6f6 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>
* Move the Vtable for Managed objects into it's own fileLars Knoll2018-07-031-0/+2
| | | | | | | | Move both the code from qv4object and qv4managed into a new qv4vtable_p.h file. Change-Id: Ib1d58120b6c3b9b779b2692526c7e40a5265c4db Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Cleanup JS stack allocationsLars Knoll2018-05-261-3/+2
| | | | | | | | Avoid double writes to the stack, and use scope.alloc() for most allocations on the stack. Change-Id: I8b89273c1b6796d955fc8eeb72c67cff208ef786 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-2/+2
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Further cleanup JSCallDataLars Knoll2017-11-071-15/+26
| | | | | | | Avoid allocations on the JS stack if possible Change-Id: I344cd6dceb6264314f9d22c94db22b22d1d24d14 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Simplify JSCallData constructionLars Knoll2017-11-071-27/+3
| | | | | Change-Id: Ic53532edae9a209aa7125af6f00a9d993d74f1a3 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Get rid of the implicit cast operator to a CallDataLars Knoll2017-11-071-1/+3
| | | | | Change-Id: I1c35fbf8f7355bc2393ae931f99e591b800f2f45 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Get rid of JSCallData::call()Lars Knoll2017-11-071-11/+0
| | | | | Change-Id: I6b99e9a7102b3dcb6a7699f54b6456eba6248699 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Get rid of JSCallData::callAsConstructor()Lars Knoll2017-11-071-4/+0
| | | | | Change-Id: I7c7a69791e98ba0ce82b4d23785fc12a510c449e Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add a FunctionObject::call(AsConstructor) overloadLars Knoll2017-11-071-3/+16
| | | | | | | add an overload taking a JSCallData for convenience. Change-Id: I8ebc190354943e6ceed676c3c0e1803586426769 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Rename JSCall to JSCallDataLars Knoll2017-11-071-7/+7
| | | | | | | | As, this is going to change in a simple stack based structure to keep pointers to the data to pass to calls. Change-Id: Ia9aa3f81ee3eeba36affd16aac7b2fe97d59aea9 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Change signature of call/constructLars Knoll2017-11-071-3/+3
| | | | | Change-Id: I139a7a31651d9a2ea46ced88978ac4633294bc60 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Move the construction of the JSCall frame into the runtimeLars Knoll2017-11-071-0/+12
| | | | | | | The VME shouldn't have to care about this part Change-Id: I9e49353dce29912f5a222b7ed1b42ace2aa8cebd Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Refactor Call/Construct instructionsLars Knoll2017-11-071-3/+15
| | | | | | | | | | | | | | | | Give them a pointer to argc and argv instead of a pointer to a full callData. Like this we can construct the callData at the end of the JS stack and avoid the need to create an additional copy in VME::exec(). This also opens up the option of completely avoiding all copies for calls into runtime methods. Also make sure that the calldata we pass into other functions is always at the top of the JS stack. Change-Id: I3d0eb49f7bfd7adb9ddabb213422087c66e5a520 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Change CallData::argc to be a QV4::ValueErik Verbruggen2017-09-191-6/+3
| | | | | | | | | | | Instead of mimicking a Value. This makes sure that argc now stays correct even when anything on Value changes. Most of the change is mechanical: replace callData->argc by callData->argc(). Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix namespaced buildErik Verbruggen2017-09-071-1/+3
| | | | | Change-Id: Ic40619f6ef8f05ebaebc1da0f69649547eec3d75 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Always set the correct FunctionObject when calling JS functionsLars Knoll2017-09-021-4/+15
| | | | | | | | | Renamed ScopedCallData to JSCall, enforced passing a JS FunctionObject to it, and added call() and callAsConstructor() methods to it. Change-Id: I30db65c9765c2896b5909fe2105c0934c6dad861 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move ScopedCallData and ScopedStackFrame into a separate fileLars Knoll2017-09-011-0/+118
Change-Id: I9ae42aa7a811aa93fe0950725e9d253a0c5e8dba Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>