aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4unop.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Jit: fix unary minus for integersErik Verbruggen2017-06-071-0/+9
| | | | | Change-Id: Ib2cdfe6f09528d169e9ea6f8b872de875317c9c9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prepare run-time method calling mechanism for cross-compilationSimon Hausmann2017-03-171-1/+1
| | | | | | | | | | | | | | | | | | | The current way of encoding the offsetof() of the method_ members in QV4::Runtime is not portable when cross-compiling from a 64-bit host (where the offsetof would be calculated on) to a 32-bit target (where the offset would be different), or vice versa. In preparation for making this work, this patch first replaces the direct use of the run-time members with use through a void * and an enum for indexing. This gives us some type-safety in some places and will also allow for a translation of the pointer offset from host pointer indexing to target pointer indexes. As a bonus we can avoid going through the engine->runtime indirection in the interpreter altogether and call the static methods right away. Task-number: QTBUG-58666 Change-Id: I3cd6459523923a9719408317fa729bca19c2bf3c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prospective fix for native ARMv7 and ARM64 buildsSimon Hausmann2017-02-101-0/+4
| | | | | | | | | | | Don't try to instantiate the presumed "cross-assembler" twice, and also exclude the Yarr JIT from the devtools build. It requires a loadPtr enabled assembler (disabled in V4_BOOTSTRAP builds) and we don't need the regexp engine. Change-Id: I3f36b32decdbf51133b8fef641f5630c5f5102b1 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix ARM64 buildSimon Hausmann2017-02-081-0/+1
| | | | | | | | | Add the ARM64 assembler to cross-compilation. Task-number: QTBUG-58568 Change-Id: I91461ebf79fb83e31e8ae2962ab0e155d308281a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix assembler cross-compilation on 32-bit hostsSimon Hausmann2017-02-071-1/+1
| | | | | | | | | The GOT register restoring logic needs to be done via TargetPLatform members instead of plain #ifdefs. Task-number: QTBUG-58569 Change-Id: If00d3f92558361ad5dcb20c3ff7eff78d31d75d3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Include the ARMv7 assembler in the qmldevtools bootstrap buildSimon Hausmann2017-02-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Even when the C++ target is not ARMv7 we want to include it in order to be able to generate QML cache files with code ahead of time. This requires a few changes: * The Jump classes need to move from the AbstractMacroAssembler super-class into the concrete assembler sub-class, in order to use it in specializations. * Some of the template specializations in LinkBuffer for example or for platform dependent operations need to be pre-processor enabled when bootstrapping * The generic loadPtr/addPtr etc. functions need to move to the concrete assemblers to be able to call the correct 32-bit or 64-bit variations. * We need to force what looks like a loss of precision to the compiler in the 32-bit ARMv7 linking code when linking jumps. Finally then we can explicitly instantiate at least QV4::JIT::Assembler for ARMv7 when bootstrapping. Currently only on x86-64 hosts, but that is a temporary limitation. Change-Id: I501db2360e1fded48f17f17d9e87252d47f8537e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Correctly specialize TargetPlatform as templateSimon Hausmann2017-01-311-1/+1
| | | | | Change-Id: I37d2a2d74e150b92f5a338d799def337dcb8abd9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move generateRuntimeCall macroSimon Hausmann2017-01-311-3/+3
| | | | | | | | Move it into JITAssembler for future use there. All it requires is making the assembler to use a macro parameter. Change-Id: I204e91d1b24eb02e476d8f4a43f3cd1665df0560 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QV4::JIT::Assembler a templateSimon Hausmann2017-01-281-1/+1
| | | | | | | We are going to need multiple variants of it in the future. Change-Id: Ieeec833f911b4cdeb2de4e9afb982b90424cd157 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make binop and unop a templateSimon Hausmann2017-01-281-23/+29
| | | | | Change-Id: I220505e6dc7f1401875b13a280a1b96ab8997783 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor cleanup: Move LookupCall and RuntimeCall into AssemblerSimon Hausmann2017-01-281-2/+2
| | | | | Change-Id: I31d440d6dc3f42ba33ae42af7ba42a6d045a02fb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Fix JavaScript finally-block executionErik Verbruggen2016-08-101-2/+6
| | | | | | | | | | | | | | | | | | | After moving all runtime functions into the Runtime class and doing indirect function calls, the code generation would always emit code to check for an exception after a call. This is problematic for methods that do not throw, but might be called when an exception is thrown. I.e. in a finally block. This is especially problematic for methods like popScope, the very first runtime method that is called in a finally block. The result was that after popScope, execution was passed over to the exception handler block for that finally block (meaning: the body of the finally block was never executed). The fix is to declare an enumerator in an anonymous enum for each runtime method that indicates if an exception check is needed. The existing ExceptionCheck templates are used to set the value. Change-Id: I5bd8bcf2a92acabf2a33b3764447de6cc364bba9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Convert comparison methods to the new runtime syntaxLars Knoll2016-04-111-2/+2
| | | | | Change-Id: Iad4dadddefca2d6322d4f778272b75d64e1a746f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Convert unary operations to new calling conventionLars Knoll2016-04-111-22/+21
| | | | | Change-Id: I629e336ec41f46390b7ed9f9365a832e1722b61a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* 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>
* 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>
* 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>
* V4: Split arguments/locals from temps.Erik Verbruggen2014-05-231-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a couple of reasons to split the temporaries off from the arguments and locals: Temporaries are invisible, and changes to them cannot be observed. On the other hand, arguments and locals are visible, and writes to them can be seen from other places (nested functions), or by using the arguments array. So, in practice these correspond to memory locations. (One could argue that if neither nested functions, nor eval(), nor arguments[] is used, the loads/stores are invisible too. But that's an optimization, and changing locals/arguments to temporaries can be done in a separate pass.) Because of the "volatile" nature of arguments and locals, their usage cannot be optimized. All optimizations (SSA construction, register allocation, copy elimination, etc.) work on temporaries. Being able to easily ignore all non-temporaries has the benefit that optimizations can be faster. Previously, Temps were not uniquely numbered: argument 1, local 1, and temporary 1 all had the same number and were distinguishable by their type. So, for any mapping from Temp to something else, a QHash was used. Now that Temps only hold proper temporaries, the indexes do uniquely identify them. Add to that the fact that after transforming to SSA form all temporaries are renumbered starting from 0 and without any holes in the numbering, many of those datastructures can be changed to simple vectors. That change gives a noticeable performance improvement. One implication of this change is that a number of functions that took a Temp as their argument, now need to take Temp-or-ArgLocal, so Expr. However, it turns out that there are very few places where that applies, as many of those places also need to take constants or names. However, explicitly separating memory loads/stores for arguments/locals from temporaries adds the benefit that it's now easier to do a peep-hole optimizer for those load/store operations in the future: when a load is directly preceded by a store, it can be eliminated if the value is still available in a temporary. Change-Id: I4114006b076795d9ea9fe3649cdb3b9d7b7508f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup our runtime methodsLars Knoll2014-03-111-7/+7
| | | | | | | | | 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>
* Clean up our internal namespacesLars Knoll2014-02-231-26/+23
| | | | | | | | QQmlJS::MASM -> QV4::JIT QQmlJS::V4IR -> QV4::IR Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move unops into it's own fileLars Knoll2014-02-221-0/+142
Change-Id: I17aaff4d044608462e1edabc5612685591b3a433 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>