aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
Commit message (Collapse)AuthorAgeFilesLines
* Implement support for providing information to Linux's perf JIT interface.Robin Burchell2015-08-211-1/+61
| | | | | | | | | | | | | For more information on what this is, see: https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt [ChangeLog][QtQml][Profiling] QtQml can now write additional information so that perf is able to give function names of JavaScript methods when profiling. To enable this, set the environment variable QV4_PROFILE_WRITE_PERF_MAP=1 when running the process in question. Change-Id: I187c9b0792f40d93c89a986c0edb3c4487095cb7 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Access the id objects through a specialized runtime methodLars Knoll2015-08-123-12/+2
| | | | | | | | This brings us one step closer to getting rid of the QQmlContextWrapper. Change-Id: Ied57f4c174c2ebd95096310a4ad4c0c28787e7a4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Access context properties through the qml contextLars Knoll2015-08-103-12/+10
| | | | | | | And get rid of another temp in the IR. Change-Id: I039393e020e5141f1986aee276246c30fd8057f3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use the QmlContext to access properties of the scope objectLars Knoll2015-08-103-14/+57
| | | | | | | | | Add some runtime methods to access properties of the scope object directly (using the QmlContext), and generate proper code to call those. Change-Id: I0b29357c9a3b9ad53ba568ec6cb763e8ecb10f21 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Add ability to retrieve and use the QmlContext from our generated codeLars Knoll2015-08-103-0/+12
| | | | | | | | | | | | | | Our generated code (JIT and interpreter) should operate on the QML context to retrieve QML related things. That's better than operating on 4 different temps. So this commit introduces the QML context as a temp in the code we generate for QML. The next commits will move things over to use that context with specialized runtime methods instead of using generic subscript/get calls on the different subobjects. Change-Id: Ia05cf339de9cdd23003f35cf78ede17d2590f8de Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove type punning from QV4::Value.Erik Verbruggen2015-07-242-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The union in QV4::Value is used to do type punning. In C++, this is compiler-defined behavior. For example, Clang and GCC will try to detect it and try to do the proper thing. However, it can play havoc with Alias Analysis, and it is not guaranteed that some Undefined Behavior (or Compiler depenedent behavior) might occur. The really problematic part is the struct inside the union: depending on the calling convention and the register size, it results in some exciting code. For example, the AMD64 ABI specifies that a struct of two values of INTEGER class can be passed in separate registers when doing a function call. Now, if the AA in the compiler looses track of the fact that the tag overlaps with the double, you might get: ecx := someTag ... conditional jumps double_case: rdx := xorredDoubleValue callq someWhere If the someWhere function checks for the tag first, mayhem ensues: the double value in rdx does not overwrite the tag that is passed in ecx. Changing the code to do reinterpret_cast<>s might also give problems on 32bit architectures, because there is a double, whose size is not the same as the size of the tag, which could confuse AA. So, to fix this, the following is changed: - only have a quint64 field in the QV4::Value, which has the added benefit that it's very clear for the compiler that it's a POD - as memcpy is the only approved way to ensure bit-by-bit "conversion" between types (esp. FP<->non-FP types), change all conversions to use memcpy. Use bitops (shift/and/or) for anything else. - only use accessor functions for non-quint64 values As any modern compiler has memcpy as an intrinsic, the call will be replaced with one or a few move instructions. The accessor functions also get inlined, the bitops get optimized, so in all cases the compiler can generate the most compact code possible. This patch obsoletes f558bc48585c69de36151248c969a484a969ebb4 (which had the exact aliassing problem of the double and the tag as described above). Change-Id: I60a39d8564be5ce6106403a56a8de90943217006 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* V4: fix failing tests for right shifts over 0 bits on non-Intel.Erik Verbruggen2015-06-191-22/+41
| | | | | Change-Id: I6a0428be2b81cb6723b591356f78712ef2cc0b8b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Some cleanups to QQmlRefCountLars Knoll2015-06-051-1/+1
| | | | | | | | | Rename QQmlRefPointer::take to adopt, as it's a better fit with the semantics. Get rid of the assignment operator from a raw pointer and add a Adopt argument to the constructor. Change-Id: Ia1ebe42b24570f32543e783f91eb3206602772a2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4: add JIT support for mips platforms (32-bit) and enable itJulien Brianceau2015-04-275-13/+99
| | | | | | | [ChangeLog][QtQml] Enabled Just-In-Time compilation for JavaScript on MIPS Change-Id: Idce070f29645760d6376767ef67e4592828c104d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-1/+1
| | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Always return a proper Value from JIT generated codeLars Knoll2015-04-201-1/+14
| | | | | | | | | | | | When throwing an exception, we ended up having junk data in the return value register. That could end up being written onto the JS stack when returning from the function, and then causing crashes in the garbage collector afterwards. Fix it by returning undefined in case we throw an exception. Change-Id: Ice380f2de673b179c1e2c98fbeb87e47347ef520 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-161-2/+2
|\ | | | | | | | | | | | | | | Conflicts: tests/auto/qml/debugger/qv4profilerservice/qv4profilerservice.pro tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro Change-Id: I76d87e3df97ebdba902ca3d7488c1582eca2a83c
| * V4 JIT: fix typo in Binop::int32BinopJulien Brianceau2015-04-141-2/+2
| | | | | | | | | | Change-Id: I68f073ab512b482c9b3b1ad7860f4c759245298e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | V4 JIT: cosmetic changeJulien Brianceau2015-04-141-4/+4
| | | | | | | | | | | | | | | | Since 4377d44fb7399751ed4f284bb4be7ece494aff6d, we can avoid one generateFunctionCallImp bounce. Change-Id: I2e92578dbc26a614f7626d2c28a2d9b28dd06b6b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove unused variable in InstructionSelection::run()Maks Naumov2015-03-211-1/+0
| | | | | | | | | | Change-Id: I61ebeab024cd3e31e9d94810454328b4e8d48364 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | V4: fix regalloc for loops with many life&changing vars.Erik Verbruggen2015-03-031-5/+10
| | | | | | | | | | | | | | | | | | | | | | When all registers are in use, and one needs to be spilled, the register whose use is the furthest in the future will be chosen. What needs to be taken into account is that any use that can also work from the stack can be skipped, because it does not require the value to be in a register. Task-number: QTBUG-44687 Change-Id: Ide624b190603d9a22f992d4ae5daa3ce8d94472c Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
* | V4: fix phi node use position calculation.Erik Verbruggen2015-03-031-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As phi-nodes get transformed into moves, and the moves end up right before the terminator of the basic block of the incoming edge, the use by that phi-node is the position of that terminator minus one. However, when checking if uses need a register, this was not taken into account, resulting in an invalid life-time interval split position calculation. Task-number: QTBUG-44687 Change-Id: I0edd416f7ee5c8ea16bf7133870be45d0e6efea9 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-0/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf LICENSE.GPLv2 examples/qml/networkaccessmanagerfactory/view.qml src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4stringobject.cpp Change-Id: I5d12f436d60995e51d5c2f59d364e9cbc24f8e32
| * V4: include alloca private header as alloca is used unconditionally.Pasi Petäjäjärvi2015-01-261-0/+1
| | | | | | | | | | Change-Id: Ic94a7ec3980ca9e2629620ef83c93b179d75162b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Update copyright headersJani Heikkinen2015-02-1212-84/+84
| | | | | | | | | | | | | | | | | | 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>
* | V4: change regalloc hints to be a QVarLengthArray.Erik Verbruggen2015-01-231-7/+13
| | | | | | | | | | | | Change-Id: I0541431dee0ce4575df56d952a3a9a2ab9fca01d Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QML: Fix MSVC 2013/64bit warnings.Friedemann Kleint2015-01-221-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compiler\qv4ssa.cpp(687) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(950) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(1117) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1120) : warning C4267: 'return' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1148) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1266) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(1622) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(2246) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data compiler\qv4ssa.cpp(4289) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data compiler\qv4ssa.cpp(4351) : warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned int', possible loss of data jit\qv4regalloc.cpp(1383) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data jit\qv4regalloc.cpp(1769) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jit\qv4regalloc.cpp(1814) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4mm.cpp(496) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4mm.cpp(503) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4mm.cpp(506) : warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data jsruntime\qv4regexp.cpp(60) : warning C4267: 'return' : conversion from 'size_t' to 'uint', possible loss of data jsruntime\qv4typedarray.cpp(85) : warning C4309: '=' : truncation of constant value Change-Id: I0b04e1a9d379c068fb3efe90a9db8b592061e448 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 JIT: ARM: move registers around.Erik Verbruggen2015-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 6572d4e50d73ac60a8974d07de74c27a7f99ebef we moved the addressTempRegister to r10, and in d8b276a59402cbbe6d070ba38805350e7f3dd8a1 we made sure that the YarrJIT saves it too. JSC solved this by moving it to r6, which is already saved by the YarrJIT. To make a future update of the assembler easier, we also move it to r6. This requires that we move our scratch register too. But, because it is used a lot, we don't want it above r7 for Thumb2 reasons. Therefore, we move the engine to r10, and the scratch register to r5. Change-Id: I35be539940d9fe80971973cfa7f3a8dab2196a1e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QML 3rdparty: revert unnecessary change.Erik Verbruggen2015-01-121-2/+3
| | | | | | | | | | | | | | | | It is the change to DataLog.h, which in turn forces the other changes in order to match types. Change-Id: Ie17e7efbd6a4d380a3b7383b0fd0243c6f68d0d5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 JIT: Hoist QVector allocation out of a loop.Robin Burchell2015-01-091-1/+3
| | | | | | | | | | | | | | Use erase() each loop iteration, but preserve the underlying allocation. Change-Id: I673766f5567794215465daa597a4839a4900450b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix build on MinGWKonstantin Ritt2014-12-281-0/+3
| | | | | | | | | | | | | | | | - alloca() needs malloc.h - crtdbg.h couldn't be found on MinGW Change-Id: Ibbf91a58d39ef1e2572baae3c409393acf7aa5df Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Cleanup code that modifies the JS stackLars Knoll2014-12-191-3/+24
| | | | | | | | | | Change-Id: Ic043e256c3df984bb06c9a16b86573b0173b19a1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Replace usage of stdout for debug output by qDebugErik Verbruggen2014-12-192-26/+63
| | | | | | | | | | | | | | | | This way even paranoid Androids can be show interesting stuff. Task-number: QTBUG-43109 Change-Id: Ib0ef9e8f6c6fc66e9ea9bfcaf2cd9e33d7469070 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-091-7/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
| * Fix crashes on QNX/x86Simon Hausmann2014-12-031-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On x86 we assume that ebx holds the address of the global offset table for position independent code. So before placing a run-time call we restore the register from it's position we saved it on earlier on the stack. However after commit d9f33ccdef985badc56fd8940373748626beffc7 the register wasn't saved on the stack anymore in the prologue because we skipped because it's caller saved. So when we seemingly reloaded ebx with the GOT from the stack, we loaded it from a location we never saved it to. This patch makes sure to always save it on the stack so that we can always restore it. Change-Id: I8f6a8e38779151fff517f17220f29a7cb45ca89d Task-number: QTBUG-43036 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Fix run-time string handling with regards to the new heapSimon Hausmann2014-11-213-24/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed runtimeStrings to be an array of Heap::String pointers instead of indirect String pointers. Later that member along with other GC related members will go into a managed subclass. Meanwhile the generated code no more loads String pointers directly but just passes the index into the run-time strings to the run-time functions, which in turn will load the heap string into a scoped string. Also replaced the template<T> Value::operator=(T *m) with a non-template overload that takes a Managed *, in order to help the compiler choose the non-template operator=(Heap::Base *) overload. This allows removing a bunch of Value::fromHeapObject calls. Change-Id: I20415c0549d33cca6813441a2495976b66d4c00e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Change signature or runtime methods to take an engine pointerLars Knoll2014-11-125-81/+85
| | | | | | | | | | | | | | | | | | This makes a lot more sense in the long term and is the more maintainable solution, once the GC starts moving objects around in memory Change-Id: I8f327c0f5b5b0af38c5fe1a217852ee8c4a5c2fc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Refactor ExecutionContextsLars Knoll2014-11-082-5/+5
| | | | | | | | | | | | | | Move the Data class out into the Heap namespace. Change-Id: I2b798deb53812a08155c92a0e6ef2dcd2ea137b8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Changed Value to store Managed::Data pointers directlySimon Hausmann2014-11-041-2/+2
|/ | | | | | | | This is a step towards storing direct heap object pointers for the values on the JS stack, to avoid the costly indirection for data access. Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix QQmlExpression/QQmlScriptString/QQmlBinding crashesSimon Hausmann2014-10-092-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | In the QQmlScriptString we store the binding id and it is an index into the runtimeFunctions array of the compilation unit. However we don't store the compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve it from the cache via the context url (we have the context after all). That turns out to be not a reliable way, as sometimes the URL might slightly differ from the originally compiled cache (qrc:/// turning to qrc:/ maybe). Consequently the type is (unnecessarily) compiled again and unfortunately not _linked_, therefore the runtime functions array is empty. Another option is that when the component was created from a QByteArray, then no entry exists in the cache in the first place. This patch addresses the problem by storing a reference to the compilation unit in the QQmlContextData. That we can safely retrieve and it'll make sure the compilation unit also stays alive. In the process of that the manual reference counting was switched over to QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit. Task-number: QTBUG-41193 Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace vsnprintf with qvsnprintf.Bjoern Breitmeyer2014-09-191-1/+1
| | | | | | | | Windows CE does not have vsnprintf, so use qvsnprintf instead. Change-Id: I30ddbf2469424ec174903f0cce2b482c652b5d22 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: fix stack layout.Erik Verbruggen2014-08-261-13/+15
| | | | | | | | | | | | | | | | | Commit d9f33ccdef985badc56fd8940373748626beffc7 introduced an off-by-one in the calculation of the offset of a saved register (in StackLayout::savedRegPointer), resulting in overwriting a callee saved register with the tag of a QV4::Value. This method now calculates those pointers relative to the bottom of the stack frame. The off-by-one didn't happen before that patch, because there was a magical +1 used in the constructor for the number of callee saved registers, thereby prevented this from happening. However, that resulted in a frame size that was unnecessary big. Task-number: QTBUG-40927 Change-Id: If88fe9f3490a4d23a1e69c630c87219fcfef671f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-2512-223/+127
| | | | | | | | | - 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 JIT: fix int32 to double conversion codeErik Verbruggen2014-08-141-2/+4
| | | | | | | Missing else: two (nearly identical) conversions would get generated. Change-Id: I745120f81d42bf28fbce7ab6a62da909a8e14458 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: add d8-d15 as available FP registers on ARM.Erik Verbruggen2014-08-141-1/+8
| | | | | | | | | | VFP3-d16 is the minimum implementation available on ARMv7, so these registers are also always available. The big added bonus is that they are callee saved, so using them will result in less loads/stores for doubles. Change-Id: I0cab3fe24d8677315b4c7d9449d8619cbf9a2919 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: support saving used callee saved FP registers.Erik Verbruggen2014-08-144-21/+46
| | | | | | | | This is not used yet by any platform/abi we support, because we do not define any callee-saved FP registers. Yet. Change-Id: I5857a452456175398c5e9681ff33800b9431b9da Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: calculate used registers and only save those.Erik Verbruggen2014-08-143-2/+37
| | | | | | | | | Instead of saving all possibly used ones. Note that floating point registers are not saved yet, as we don't support callee-saved FP registers yet. Change-Id: I1db2ba2513f7b466c64ec103eda0c464269247b0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: parameterize the prologue and epilogue generationErik Verbruggen2014-08-146-69/+84
| | | | | | | | | ... with the regular (non-FP) registers that need to be saved. This patch shouldn't change any of the JIT generated code, because all regular callee saved registers are passed in. Change-Id: Id11b8f37f06d80e8015ac6f0d0ccefdfa3342cbe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-141-3/+2
|\ | | | | | | Change-Id: I2e06c2fcd8aa9d5d090f0568be75272ec82f7b20
| * V4 JIT: fix JS stack frame size calculation.Erik Verbruggen2014-08-131-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | StackLayout::calculateJSStackFrameSize now returns the size in number of QV4::Value items, instead of bytes. The value is then multiplied in the assembler by sizeof(Value) to get the number of bytes. Previously, the return value was number of bytes, which also got multiplied. A direct effect is that the JS stack size will be ~87% smaller, with the nice effect that the GC will run faster (less roots on the stack). It also won't retain objects whose reference accidentally ended up on the stack below the used portion for the current function, so possibly freeing (more) objects (earlier) than before. Change-Id: Idd5a9c173e641c03e6b8a6fe743e403eda34dfe0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * V4 JIT: fix usage of d1 on ARM.Erik Verbruggen2014-05-261-1/+0
| | | | | | | | | | | | | | | | | | | | The d1 register is used by the JIT as a scratch register, so it is not available for the register allocator. If it would be used for register allocation, the JIT code generation might override it with something else, thereby clobbering the result. Change-Id: Iaf7db873d78e84c28ac9ea341f9d6da76330fe81 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 JIT: fix stack use below stack pointerErik Verbruggen2014-08-141-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | When storing a double value returned from a function call on platforms where the value wouldn't fit in a register, we used to store it on the stack and then load it into a FP register. This stack use was done without first lowering the stack pointer. For x86 and ARM, the value is loaded directly into the FP register, and for other non-64-bit platforms it correctly allocates the stack slot. Change-Id: Idbc260038958a036ac2a7383d845199626decc8e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 IR: change IR printing to be more readable.Erik Verbruggen2014-08-131-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New structure: - "comments" now start with a semi-colon, and have a list of key: values. ; predecessors: L17 L26 L36, loop_header: yes ; line: 30, column: 3 - when a temporary has a known type, it is written in front of the teporary when it is being assigned, and not repeated. var %109 = this double %42 = 42 - an expression starts with the operation, followed by the operands that are separated by commas. The type of the operands is the type mentioned when they are assigned. int32 %115 = sub %184, %185 if gt %27, 0 goto L40 else goto L41 - conversions do mention the operand type in order to make them easier to read. double %178 = convert var to double %60 - phi node operands are prefixed by the from-label to make it easy to match those operands with the from-block. double %62 = phi L35: %58, L34: %61 - all names except for "this" and built-ins are prefixed by a dot in order to make it clear that a lookup will occur, just like member accesses. $6 = call .int2char($0) %7 = this %8 = %7.toString() Change-Id: I9f626a91f97ca7c3f27e01a5539f3c4fc10a46b4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 RegAlloc: fix callee saved register range handlingErik Verbruggen2014-08-131-15/+19
| | | | | | | | | | | | | | | | | | | | This makes sure that the index of the fixed(FP)RegisterRanges matches the indexes for normal-/fpRegisters, because this index is used to check if a chosen register intersects with a fixed (= caller saved) register at call sites. Change-Id: Ie31554dbe8ed99cb38ca6b2506da663be41d82f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | V4 RegAlloc: fix use position calculation for phi node arguments.Erik Verbruggen2014-08-131-11/+8
| | | | | | | | | | | | | | The correct calculation was already done, but the value was discarded. Change-Id: I600aeb9414736a3b7924a4a607233ab9bf6c02b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>