aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4isel_masm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Optimize Runtime::method_get/setElementLars Knoll2017-05-101-2/+2
| | | | | | | | | | | | | This is now actually just as fast as the lookup code, so disable the generation of lookups for indexed accesses for now. This saves some runtime memory, as we don't need the data structures for the lookup. We can reintroduce lookups, once they offer a real performance benefit. Change-Id: Idc3fa7b248e2e25b4b2cd60d5053e2815634c8b7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prospective build fix for architectures where we don't support the JITSimon Hausmann2017-05-071-1/+7
| | | | | | | | | | Always export the isel factory method for qmlcachegen, so that we can link. Task-number: QTBUG-60597 Change-Id: Ia348ee5dfe0892878e8fce6c8afd30bb8eb54a51 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Silence GCC 7 warnings about implicit fallthrough in Qt codeThiago Macieira2017-04-201-0/+1
| | | | | | | | | | | | | | | This only deals with Qt code. MASM has a lot of those left. We should just update from upstream instead to get the fixes. qv4regalloc.cpp:660:52: warning: this statement may fall through [-Wimplicit-fallthrough=] if (leftSource->type == DoubleType || rightSource->type == DoubleType) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qv4regalloc.cpp:666:13: note: here case OpBitAnd: ^~~~ Change-Id: I7814054a102a407d876ffffd14b6b0e2d6b03689 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix architecture selection when cross-compiling cache filesSimon Hausmann2017-04-061-4/+4
| | | | | | | | | | We pass essentially the values of QSysInfo::buildCpuArchitecture() to qmlcachgen as command line parameters, so our factory function must be aligned with the values returned (and documented) there. That means arm instead of armv7, arm64 instead of armv8 and i386 instead of x86. Change-Id: I89c196b6585f9ba9550c0deb17e8b529980aa448 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix encoding of primitive constants when cross-compilingSimon Hausmann2017-03-311-6/+6
| | | | | | | | | | QV4::Primitive is using host value encoding, which can differ from the target. The source of QV4::Primitive in the code generator is usually IR::Const, transformed via convertToValue(). That function becomes a template that converts to a simple target primitive type. Change-Id: If028aea9551d77d81eec306f60fd995c25b76710 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix value type encoding constant usage when cross-compilingSimon Hausmann2017-03-301-11/+12
| | | | | | | | | | | | | | | Our two value encodings use different masks for the upper 4 bytes. Depending on the target architecture we must use different values when generating code that uses these masks. This patch replaces the #ifdef'ed ValueTypeInternal_* enum values with two C++11 scoped enums that allows for the co-existence of both throughout the code base as well as selective use in the code generators. Change-Id: I380c8c28b84df2874cca521b78bfe7f9388ed228 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Protect ExecutionContext member usage against word size differencesSimon Hausmann2017-03-171-2/+2
| | | | | | | | | | | Ensure the offsets we're taking from ExecutionContext members in the JIT code generator can be translated from host architecture sizes to target architecture, using assertions and a memory layout that we already have in the dev branch with commit 4de7e48ab160dacc7a09360e80264eac4945a8f4. Task-number: QTBUG-58666 Change-Id: I26cdbd1ddb995b116624fab16f7caba5d21c13b5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Protect Lookup usage against cross-compilation word size differencesSimon Hausmann2017-03-171-5/+5
| | | | | | | | | The offsets we're taking from Lookup in the code generator are always zero, but with static assertions we can ensure that they stay that way. Task-number: QTBUG-58666 Change-Id: I91e047d2101ba33e36aaada4a5adc75e20fea7d8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Protect CallData usage against cross-compilation word size differencesSimon Hausmann2017-03-171-4/+4
| | | | | | | | | | Ensure via static asserts that the members always have the same offsets. Since the class has standard layout, we can also use the C++11 offsetof macro instead of qOffsetOf. Task-number: QTBUG-58666 Change-Id: I7dcecf517c771c7081334cd9d0b7ae133b23b23a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prepare run-time method calling mechanism for cross-compilationSimon Hausmann2017-03-171-2/+2
| | | | | | | | | | | | | | | | | | | 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>
* Fix running of 32-bit JIT code generated on 64-bit hostsSimon Hausmann2017-03-171-2/+2
| | | | | | | | | | | | | | | The offsets of members encoded in JIT generated code differ between 32-bit and 64-bit architectures. This patch moves some of the ExecutionEngine members into a separate standard-layout EngineBase class (in line with the same class in commit 2a554434a571dcefd26cf10ef8c5ae8b3b7d66db and subject to merging). By ensuring that the members are stored at pointer intervals, we can translate from host pointer size to target when generating the code. Task-number: QTBUG-58666 Change-Id: I1c38a7da059826848b80fd9972ed073214501386 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix ARM64 buildSimon Hausmann2017-02-081-2/+3
| | | | | | | | | 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 register argument passing in cross-compiled code when host == x86Simon Hausmann2017-02-071-5/+4
| | | | | | | | | Replace the use of host-dependent pre-processor macro with variable usage from the target platform template specializations. Task-number: QTBUG-58577 Change-Id: I7e5ca4b79c2238954d6be7ec6b110eadd78a104d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix assembler cross-compilation on 32-bit hostsSimon Hausmann2017-02-071-4/+2
| | | | | | | | | 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>
* Eliminate VALUE_FITS_IN_REGISTER #ifdefSimon Hausmann2017-02-061-32/+2
| | | | | | | | | | These macros do not apply anymore when cross-compiling. This patch replaces the macro use for locals JS stack initialization with register size dependent operations as well as when loading the this object into a stack slot. Change-Id: Ia986f6dbfa37c6d6ce2f1de6253e7008e4aa87dd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow selecting armv7 as target architecture in qmlcachegenSimon Hausmann2017-02-011-3/+26
| | | | | Change-Id: I36e8f95e83ea3de6553145efc762e3bc46f60071 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Added the ARMv7 cross-assembling JIT::ISel to the qmldevtools buildSimon Hausmann2017-02-011-0/+5
| | | | | Change-Id: Ib508ad7a02293b0deead818bb0eb3bdfb474a278 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove platform ifdefs for ISE::convertTypeToDoubleSimon Hausmann2017-01-311-16/+2
| | | | | Change-Id: I75db85fbd601d4790a3cb9af483474a976d00e86 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove platform ifdefs for generateCJumpStrictUndefinedSimon Hausmann2017-01-311-15/+1
| | | | | | | | Use templates to perform the platform encoding dependent way of comparing a given value against undefined. Change-Id: I7e7726455023200bd74e62d2dbc4e2c2908d9e64 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove platform ifdefs in JIT::ISel::visitRetSimon Hausmann2017-01-311-138/+1
| | | | | | | | Use templates to encode the various platform dependent ways of encoding the return values. Change-Id: Icb481a75924da7d78396ff1c95474dc9c29ca494 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Eliminate platform #ifdef for loading stringsSimon Hausmann2017-01-311-7/+1
| | | | | | | | Use templates to abstract the two different ways of making a QV4::Value hold the address of a managed, in this case to a runtime string. Change-Id: Ibe9ae10fdcef68dbfc7c61fbb3ec8b3a1d50f1a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make the JIT ISelFactory a templateSimon Hausmann2017-01-311-1/+9
| | | | | | | | That way qmldevtools can - in the future - instantiate that also for the cross-compilation targets. Change-Id: If15b195f24e54226dc4f2fd9f0ad6874f44cb5af Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove 64-/32-bit platform ifdef in assembler instruction selectionSimon Hausmann2017-01-311-71/+1
| | | | | | | | We can replace that code with a compile-time if statement where the compiler will throw away the unused part. Change-Id: I827633a14b3025bb7acaef6f85a52682d6df3da1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move generateRuntimeCall macroSimon Hausmann2017-01-311-68/+68
| | | | | | | | 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>
* Include the JIT assembler in qmldevtoolsSimon Hausmann2017-01-281-4/+0
| | | | | | Change-Id: I69b74e01dcffe82caafb7aa8495b3036afc2b933 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QV4::JIT::InstructionSelection a templateSimon Hausmann2017-01-281-84/+161
| | | | | | | | | | This completes the foundation of being able to include all assembler backends in one build. The next steps will be template specialization instead of #ifdefs for target architecture dependent instruction selection. Change-Id: I048a5e582d5993dc422577981e32e7cd93b9f0f8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QV4::JIT::Assembler a templateSimon Hausmann2017-01-281-31/+31
| | | | | | | 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-2/+2
| | | | | Change-Id: I220505e6dc7f1401875b13a280a1b96ab8997783 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Changed JSC::MacroAssembler to be a templateSimon Hausmann2017-01-281-4/+4
| | | | | Change-Id: If6edb7ed0fac51e93b218eb45c01274a87b9e904 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor cleanup: Move LookupCall and RuntimeCall into AssemblerSimon Hausmann2017-01-281-4/+4
| | | | | Change-Id: I31d440d6dc3f42ba33ae42af7ba42a6d045a02fb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* JIT Assembler instruction selection cleanupSimon Hausmann2017-01-281-416/+416
| | | | | | | | | | | | | | In preparation for the isel to work with different assemblers, we can bring some of the externally prefixed Assembler:: types into the isel class namespace. That makes the code easier to read (less visual noise) and centralizes the dependency to the external type to one place (the using statements). Similarly the indirect dependency in the QV4::Assembler sub-class TargetPlatform is replaced with an explicit JITTargetPlatform alias, so that when QV4::TargetPlatform becomes a template there is only one place to change in the assembler isel. Change-Id: Ib36e1ba7298e7be3b344ef027151a744220ab197 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow constants in IR as binop operandsErik Verbruggen2017-01-251-0/+7
| | | | | | | | There is no reason not to do this, plus it only takes up memory (for assignment to temporaries) and makes SSA transformation more costly. Change-Id: I09edbabe6ed50ab1a61b29ebd2ab541bccc95fad Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Break circular assembler dependencySimon Hausmann2017-01-111-1/+1
| | | | | | | | | The QV4::Assembler does not need a reference to the ISel that uses the assembler, a reference to the JS unit generator for string registration is sufficient. Change-Id: I9e929e4d0aecbf0144296f85cb8d208296f28003 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor assembler cleanupSimon Hausmann2017-01-111-169/+0
| | | | | | | | Move code from the Assembler helper-class into the .cpp file that has the rest of the Assembler class implementation. Change-Id: I4e9fb264216a078a3ee11119d7610fd108ddf8c7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-16/+33
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * V4: Jit: inline a toBoolean conversion for 'var' typeErik Verbruggen2016-12-061-1/+31
| | | | | | | | | | | | | | | | | | | | When the type of a variable is not known at compile-time, 'var' (meaning 'anything') is used. This can still hold a boolean at run-time, so before calling the Runtime::method_toBoolean, check if this is the case. Do the same for integers. Change-Id: I582c3a46fc992d4f4f44b87e80edafe7edea4221 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * V4: Do not generate runtime calls when comparing ints/doublesErik Verbruggen2016-12-011-13/+0
| | | | | | | | | | | | | | | | | | | | There is no need to restrict genertion of double comparisson instructions or integer comparisson instructions to constants or values that reside in registers. We're prefectly able to load a value into a scratch register in order to generate those instructions. Change-Id: I25e832293817eed6450cb08c98dd95640326a518 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-281-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The renderers added in 5.8 had to be adapted to the changed profiling macros from 5.6. Conflicts: src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp src/quick/util/qquickprofiler_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp Change-Id: Icb370b7c95aab12589ad73881ac6d178759a5c6b
| | * Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-251-2/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/quick/util/qquickprofiler_p.h Change-Id: I11a89c2a166115d6697adfba09928805643e709e
| | | * V4: Fix JIT codegen for null/undefined conditional jumpsErik Verbruggen2016-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking for undefined, both the tag and the value need to be checked. When loading the tag, it shouldn't end up in the same register that is used to hold the address of the QV4::Value. Change-Id: I380fce432ba489fdabe569dd2c9cac31e9905260 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-3/+3
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickwindow.cpp tests/auto/quick/qquicktext/BLACKLIST tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: I8bd68b0b5e853b7908791d2cbddd18dd527c76ae
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-181-26/+78
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4variantobject.cpp src/qml/types/qquickworkerscript.cpp src/quick/scenegraph/util/qsgdefaultpainternode_p.h tools/qmljs/qmljs.cpp Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
| * | | Merge remote-tracking branch 'origin/5.6' into 5.8Simon Hausmann2016-10-131-3/+3
| |\ \ \ | | | |/ | | |/| | | | | Change-Id: I175b27337b534c0b8f46a4a792d2c43cde73ffc4
| | * | V4: Fix usage of QV4::Value tags/typesErik Verbruggen2016-10-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These two were mixed, but have completely different values. Task-number: QTBUG-56471 Change-Id: Ifbf6da3032335ea89bfbc3acde17f64a571b9dc0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-101-23/+75
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/quickwidgets/quickwidget/main.cpp src/qml/jsruntime/qv4jsonobject.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/jsruntime/qv4qobjectwrapper_p.h src/qml/qml/qqmlengine.cpp src/qml/qml/qqmlpropertycache.cpp src/qml/qml/qqmlpropertycache_p.h src/quick/items/qquickanimatedsprite.cpp src/quick/items/qquickitem.cpp src/quick/items/qquickitem.h src/quick/items/qquickitem_p.h src/quick/items/qquickview_p.h src/quick/scenegraph/qsgcontext.cpp src/quick/scenegraph/qsgdefaultrendercontext.cpp Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-301-23/+75
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I241cd418bb7e7b95e0a0a2ee4c465d48be2a5582
| | | * V4: Free up 2 address bits in 64bit modeErik Verbruggen2016-09-281-23/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for the OS to use 49 address bits. It also maps JS Undefined to the C++ nullptr on 64bit. Task-number: QTBUG-54822 Change-Id: I7cc90620f499be1506a61aac77d72d067308838c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-211-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4isel_moth_p.h Change-Id: I8e86a649d1ef8ad27dc66cc8c290093b2faabc69
| * | | Fix binding dependencies when used in together with functionsSimon Hausmann2016-08-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a function called from a binding would access a scope or context property, we would end up registering those dependencies as permanent dependencies in the expression and set m_permanentDependenciesRegistered to true. Then after the binding evaluation itself, we would not end up registering the real binding's permanent dependencies. Change-Id: I3b6c1c181aa064d535362c736b5b2bbc4f576ba9 Done-with: Erik Task-number: QTBUG-54394 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devSimon Hausmann2016-08-271-17/+11
|\| | | | | | | | | | | | | | | Change-Id: Iaf83f4c74b25b08764005267713db91c95732fc0