aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
Commit message (Collapse)AuthorAgeFilesLines
* Fix build for Android with android-clangLiang Qi2018-05-251-2/+1
| | | | | | | | | | jit/qv4assembler.cpp:65:11: error: unused variable 'IsIntegerConvertible_Shift' [-Werror,-Wunused-const-variable] const int IsIntegerConvertible_Shift = QV4::Value::IsIntegerConvertible_Shift; ^ Change-Id: I8fd7f03661e9bb7d80c92947cd43841189f148ce Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix crash with JIT on x86Simon Hausmann2018-04-111-0/+4
| | | | | | | | | | | | The stack must be 16-byte aligned in order for compiler generated alignment requiring SSE instructions to work on the stack. For x86 the stack upon entry is 4 bytes off due to the saved eip. Then another 20 bytes for the saved registers (ebp, eax, ebx, etc.). That means we have to add another 8 bytes to reach the next 16-byte alignment. Change-Id: Ifde49a89224a129f8307fff3713563b80772cff1 Task-number: QTBUG-66773 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Restore the QV4_WRITE_PERF_MAP featureUlf Hermann2018-03-191-6/+41
| | | | | | | | We want to be able to generate perf map files for JITed code. Task-number: QTBUG-67056 Change-Id: I56899e1dbf184083d94efe926d21fca4f9ea1e18 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix lookup of enums declared in QML singletonsSimon Hausmann2018-03-162-12/+0
| | | | | | | | | | | | | | | | | | | | | Given the following expression var x = MySingleton.MyEnumValue where MySingleton is a QML (composite) singleton and MyEnumValue comes from a QML declared enum, we had code in place up to (and including) 5.10 to attempt to optimize that expression to a enum constant at compile time. In 5.10 that optimization does not exist anymore. In <= 5.10 we would also skip the optimization under certain circumstances (too many statementes, etc.). The fallback that is in place for handling this at run-time tried to be smart by avoiding the QQmlContextWrapper::get lookup and return straight a reference to the singleton as QObject. That works for regular property lookups, but it fails when trying to look up something like an enum, that isn't a meta-object property. Change-Id: I1819b9d8ae06a3f595e067bf5b018c4065be76bb Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-271-116/+116
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@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>
* Correctly set this object when calling scope/context functionsErik Verbruggen2018-02-202-0/+34
| | | | | | | | | | | | | When a function is called that is in a QML scope or a QML context, set the 'this' object to the QML scope. This is done by introducing two new interpreter instructions, which get the context passed in. Note: this patch is 5.11 specific. 5.9 had a similair issue, but the implementation is quite different, so that was fixed separately. Task-number: QTBUG-66432 Change-Id: Ie43150cdd26360025895df28d31264985abf1c15 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Finally really remove QT_NO_QML_DEBUGGERUlf Hermann2018-02-191-2/+0
| | | | | | | | | | We don't want the JIT to ignore the debug instructions, and in qsgatlastexture.cpp qqmlglobal_p.h which defines DEFINE_BOOL_CONFIG_OPTION was implicitly included via qml_debug. Change-Id: I82329b9422f4938f097263517afadebab33a0d0c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
* Optimize inc/dec operationsLars Knoll2018-01-091-24/+63
| | | | | | Change-Id: I3e1fa464e380a40b610bbc339bdbc272ebc863d1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Raise minimum supported MSVC version to 2015Friedemann Kleint2018-01-061-11/+2
| | | | | | | | | | | | Remove code for older versions and streamline #ifdefs. Remove the helpers macros Q_STATIC_ASSERT_FOR_SANE_COMPILERS and V4_ASSERT_IS_TRIVIAL. Task-number: QTBUG-40658 Task-number: QTBUG-51673 Change-Id: Ifa4fab653b10ce7858739adef08364cddc6507cf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix decoding of bytecode instructions on ARM generated on x86-64Simon Hausmann2018-01-051-6/+11
| | | | | | | | | | | | | | | | | | | | | | | Due to the difference of sign of the char type, byte code is encoded differently on x86-64 than if it was on ARM and it also is decoded differently. The problem at hand here was that negative jumps were encoded as two-byte instructions (opcode and negative offset as byte) on x86-64 when qmlcachegen is run. At run-time the negative offset was read into a char type and consequently interpreted as a positive jump, leading to crashes. The explicit use of qint8 as signed byte type in encoding/decoding sensitive parts avoids the decoding issue and should also result in consistent encoding. The added auto-test is (among other configurations) run in the CI under qemu, which means the x86-64 host-built qmlcachegen will generate byte code and the tst_qmlcachegen ARM binary will run under qemu and reproduce this scenario. Task-number: QTBUG-65521 Change-Id: I615628f53475dad38a41095c6e7ffea0c34d58ac Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Optimize cmpEq/NeIntLars Knoll2018-01-031-0/+28
| | | | | Change-Id: I67d3ba6b8bb9c44ba8477c959d389c8a8099aeb2 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Optimize ushr with constant argumentLars Knoll2018-01-021-14/+19
| | | | | Change-Id: I891509269fc8e35c4ad45a2cdce03fc2ace574cd Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Optimize shift operationsLars Knoll2018-01-021-21/+12
| | | | | Change-Id: I32a4382e915217ad36fb4e2a545769586c38b203 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Optimize bitAnd, bitOr and bitXorLars Knoll2018-01-021-14/+83
| | | | | Change-Id: I8e9ea1c26a1bd9c4320d61c2a8d89175a65fe945 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Don't load the JS stack frame pointer twiceLars Knoll2018-01-021-3/+0
| | | | | Change-Id: Ib2eccb825b2acfdc3f850fd15815c1ac894c685f Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Optimize generated code for toInt32 and toNumberLars Knoll2018-01-021-1/+27
| | | | | | | Gives some significant speedup for crypto.js Change-Id: Ie5e4922ceae43cc62e1d7fc98de4322d637bddc8 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Optimize JIT generated for for CreateCallContextLars Knoll2018-01-023-9/+26
| | | | | | | | | Added a storeHeapObject() call to the assembler, to ensure we store the pointer returned by newCallContext() correctly on 32 and 64 bit platforms. Change-Id: I2141d5dd3cdd39a9b8886236100e0437159c6fb9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* JIT: Inline load(Scoped)Local and store(Scoped)Local instructionsLars Knoll2017-11-303-67/+35
| | | | | | | | Generate inline code for loading and storing (scoped) locals in the JIT. Change-Id: I6eb72126a0a2c6012bf6e73df245c9301bd4c48d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4 JIT: Try not to overdo alignmentErik Verbruggen2017-11-281-8/+2
| | | | | | | | | | | | | The x86_64 assembler will not push a register aligned. The arm64 assembler will. The correct use for pushing constants is not to "prepare" the stack pointer and then push (because that would result in an unaligned value on arm64), but to load the value and do an aligned register push. This fixes a Bus Error on ARM64. Change-Id: I9c9ed643372025f5f7097e7f44ab17adfd0815a9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Change CallValue to have the value on the stackErik Verbruggen2017-11-232-4/+3
| | | | | | | | | | | | | | | We used to store the value-to-be-called in the accumulator. So the generated bytecode looked like: LoadReg r1 CallValue() The first thing done in CallValue is to store the accumulator. So by not loading the accumulator, we can actually remove the subsequent store, which results in less interpreter instructions and one less store in CallValue. Change-Id: Icc7c8a5449bf369b9226d66bc6055cb705ef660e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Collapse LoadRegExp+StoreReg into MoveRegExpErik Verbruggen2017-11-232-4/+5
| | | | | | | | LoadRegExp is nearly always followed by a store of the accumulator, so change LoadRegExp to be MoveRegExp. This saves an instruction. Change-Id: I5d47c5bf6ffd7f28247c328410872c3b229ca23c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Add fastpath for integer-to-integer comparissonsErik Verbruggen2017-11-231-15/+14
| | | | | Change-Id: I4831d0b4dda160e43ddbca08b9001611e9cc921d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Add int32 fastpath for inc/decErik Verbruggen2017-11-221-4/+51
| | | | | Change-Id: I276793a2fc4a253e5ec35e7f04a1032f23a03bad Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Add int32 fastpath for add/sub/mul in the JITwip/new-backendErik Verbruggen2017-11-211-34/+81
| | | | | Change-Id: I21b0e31c7c93ae51b4ab406948450e566546e246 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Shorten code by introducing an IntegerTag constantErik Verbruggen2017-11-181-13/+15
| | | | | Change-Id: If8f9bee79def412a16c163099705329a6860f752 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Add a baseline JITErik Verbruggen2017-11-175-0/+3742
| | | | | | | | This patch add a JIT back in for all platforms that supported JITting before, with the exception of MIPS. Change-Id: I51bc5ce3a2ac40e0510bd72a563af897c5b60343 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove now unused filesLars Knoll2017-06-3013-8715/+0
| | | | | | | | | Remove all files from the old compiler pipeline that are now unused. This includes the whole IR, JIT code generation, and the old Moth Isel. Change-Id: I50d06abfbcf0e9755a54ed94638f8bb74f9512b1 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Various compile fixesLars Knoll2017-06-221-0/+1
| | | | | | | | Make sure all libs and tests compile again after the latest changes. Change-Id: I749d3d2d0109cc97df2ecec93809ea8a1b3014a9 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix compilation issue when compiling the old JIT codeLars Knoll2017-06-221-2/+2
| | | | | Change-Id: I18cd60e770b04aaba6d5ec62012f88a2743e73dd Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Add support for post increment/decrementErik Verbruggen2017-06-211-2/+2
| | | | | Change-Id: Ie3f03a548105fe49d29e3d60bf823435f21b0340 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Support object literalsErik Verbruggen2017-06-201-2/+5
| | | | | Change-Id: I7fc4565044caf23bec239561be4fbc020ccc2468 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-151-0/+9
|\ | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp Change-Id: I3c41b9fc9ba7d41741e4dd400402ae80dd7726d9
| * Jit: fix unary minus for integersErik Verbruggen2017-06-071-0/+9
| | | | | | | | | | Change-Id: Ib2cdfe6f09528d169e9ea6f8b872de875317c9c9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-3/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4argumentsobject.cpp src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4errorobject.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4managed.cpp src/qml/jsruntime/qv4managed_p.h src/qml/jsruntime/qv4object.cpp src/qml/jsruntime/qv4object_p.h src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4heap_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/memory/qv4mmdefs_p.h src/quick/scenegraph/util/qsgdistancefieldutil.cpp src/quick/scenegraph/util/qsgdistancefieldutil_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
| * 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>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-04-222-0/+3
|\| | | | | | | Change-Id: I95266fdaf5c6dc65969bd2e28403da7969367d32
| * Silence GCC 7 warnings about implicit fallthrough in Qt codeThiago Macieira2017-04-202-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/devSimon Hausmann2017-04-085-80/+89
|\ \
| * | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-04-075-80/+89
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4vme_moth.cpp Change-Id: I865d794e550a263387a39ca8d051ebf48b70cbc0
| | * Fix locals register allocation on ARM when cross-compilingSimon Hausmann2017-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | r11 needs to be saved :). This ammends ecda87091f290daec34bee6b55dd9cf920ffdcff Change-Id: Ib69712527e04b9bcec4c9e74dea43a915e2bd0f9 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| | * Fix double conversion code generation when cross-compilingSimon Hausmann2017-04-062-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | We can't use QV4_USE_64_BIT_VALUE_ENCODING for deciding how generate code for checking if the tag of a value contains the necessary mask to detect doubles. Change-Id: Id5a5c1b136313aa4dfd2c997898e97cd4ebaeb83 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix shadow stack space handling when cross-compilingSimon Hausmann2017-04-061-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both MIPS and X86-64 on Windows reserve space for four registers on the stack, that the called function may use to spill the parameters passed in registers. This needs to be handled without #ifdefs in order to support cross-compilation and from the looks of it it was also wrong on MIPS. Change-Id: If65a6a0f6f64b8536703d32e7678e30ad807f7c8 Reviewed-by: Julien Brianceau <jbriance@cisco.com> Reviewed-by: Lars Knoll <lars.knoll@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 engine parameter passing when cross-compilingSimon Hausmann2017-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use addressForArgument() only to access the incoming functions parameters in JIT generated code, which is the engine parameter. While not currently supported by the current set of cross-compiling assemblers, the use of sizeof(Type*) may become an issue in the future, so let's use the correct value right away. Change-Id: I3e44279257f595a8be2c61bcfe15070a90038eb7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix loading of strings when cross-compiling from 64-bit host to 32-bitSimon Hausmann2017-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The use of sizeof(Type*) is not allowed when calculating indices into pointer arrays. Change-Id: I5531efc80d0267eaceade76ad2b96d454eab9392 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix Clang warning about member in template class not definedThiago Macieira2017-04-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qv4isel_masm.cpp:285:44: warning: instantiation of variable 'QV4::JIT::Assembler<QV4::JIT::AssemblerTargetConfiguration<JSC::MacroAssemblerX86_64, QV4::JIT::TargetOperatingSystemSpecialization::NoOperatingSystemSpecialization>>::Void' required here, but no definition is available [-Wundefined-var-template] Depending on qv4assembler.cpp instantiating the same template that q4isel_masm.pp required is fragile. So move the definition to the header, next to the class. Change-Id: I27b55fdf514247549455fffd14b178ec9d4b508d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix encoding of primitive constants when cross-compilingSimon Hausmann2017-03-313-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-303-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>