summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4isel_masm.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build on Android with -developer-buildSimon Hausmann2013-10-111-2/+2
| | | | | | | | | | | | That configuration implies -Werror for some kind of warnings. This patch fixes * Mix of different types in conditional (qv4isel_masm.cpp) * Noreturn function returning instead of calling another noreturn function at the end (qv4engine_cxxabi.cpp) * An out-of-line function being declared inline Task-Number: QTBUG-33998 Change-Id: I3ba58dcadeac6774c5de63e6bb551354a2f23332 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Small optimisation for bit shift operationsLars Knoll2013-10-111-4/+4
| | | | | | | | | We don't need the right side of the shift operation as uint. Converting it to int is cheaper and more then enough, as all but the lowest 5 bits are ignored anyway. Change-Id: I8833e6cc4e565b8bd1e35a22250e03a9b34938df Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add support for showing disassembled ARM JIT codeSimon Hausmann2013-10-101-1/+1
| | | | | | | | | | Ported the ARM disassembler from upstream trunk. QtQml needs to be configured with qmake CONFIG+=disassembler and QV4_SHOW_ASM=1 enables the dump at run-time. Change-Id: Ia13a98835829fde0d3c5a795cb8f6ef9de951807 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: ISel for bitwise or/xor.Erik Verbruggen2013-10-101-8/+62
| | | | | | | Removes another 4mln calls when running v8-bench.js. Change-Id: I7fd777e4e6303f989391c4d1e361277cc24b37e8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: generate some strict (not) equal conditionsErik Verbruggen2013-10-101-9/+163
| | | | | | | | | | | Checks for strict (not) equal to null, undefined, or a boolean value can be generated without reserving extra registers, or doing a call. This reduces the amount of runtime calls from >25mln to ~6500 for v8-bench.js Change-Id: If08d1124b2869227654b1233a89833c5b5e7b40c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: do not generate inline fall-back code for strings types.Erik Verbruggen2013-10-101-1/+3
| | | | | Change-Id: I30ac6fcbc7d03f412ff03e87f2ecf61fd2617108 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: Remove more jumps.Erik Verbruggen2013-10-101-1/+5
| | | | | | | | | | | | | | | | | | | | | Do not generate jump instructions when the target immediately follows the current basic block, even if there are intermediate jumps in between as long as they jump to the same basic block. In the IR snippet below, no jumps will be generated at all. … L8: goto L6; L12: goto L6; L6: goto L4; L11: goto L4; L4: goto L2; L10: goto L2; L2: …. Before this change, the gotos in L8, L6, and L2 were still generated. Change-Id: I718ed0d41c603a6905f2279b782cd9e9cafb7d55 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: enable register allocator for linux/x86.Erik Verbruggen2013-10-041-1/+7
| | | | | Change-Id: I9424838139a419beb2e207f168fc25c0c47c64e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: fix visitRet for 32-bit architectures.Erik Verbruggen2013-10-041-10/+43
| | | | | Change-Id: I004fe8d5de0f5a932c23393ed06a04738b8e8bf1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup exception handlingSimon Hausmann2013-10-031-1/+0
| | | | | | | | | | The code in the Exception class operates entirely on the engine's data, so move it into ExecutionEngine instead. This eliminates the need for a QV4::Exception class and catches and old code that tries to still do catch (Exception &) instead of catch (...) Change-Id: Ie608bec6af652038aca6c9423c225a4d7eb13b39 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: implement convertUInt32ToDouble on ARMv7.Erik Verbruggen2013-10-031-4/+0
| | | | | Change-Id: I11caf07a8776bb2c6527639f22d47103f4ca1cef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: invert conditions when the true block follows the test.Erik Verbruggen2013-10-031-17/+30
| | | | | Change-Id: I5044acd4263b71734e4eb5d7e74b1a4a8414741e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change exception handling APISimon Hausmann2013-10-021-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the exception handling API in the engine slightly, encapsulating any use of direct throw statements and catch blocks with concrete types. In the future we need to be able to change the way these are implemented, in order to ensure that the correct stack unwinding code is triggered for throw and re-throw. This patch separates the C++ exception object thrown from the V4 exception (that includes value, throwing context pointer) and stores the latter inside the engine. In order for that to compile, ExecutionEngine::StackTrace and StackFrame had to move into the QV4 namespace directly. In addition the syntax for catching exceptions changes from try { ... } catch (QV4::Exception &ex) { ex.accept(context); QV4::ScopedValue exceptionValue(scope, ex.value()); } to try { ... } catch (...) { QV4::ScopedValue exception(scope, context->catchException()); } Context::catchException() checks if there's a "current" exception in the engine, and if not assumes that we caught an unrelated exception and consequently re-throws. partiallyUnwind() is also gone and replaced with rethrowException(), in order to encapsulate the re-throw. Lastly, in the future nesting try/catch blocks isn't going to be possible due to limitations in the common C++ ABI with regards to foreign exceptions. Change-Id: Ic81c75b057a2147e3176d8e0b4d326c14278b47d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove some more uses of QV4::ValueLars Knoll2013-10-021-6/+6
| | | | | | | All remaining uses should be GC safe now. Change-Id: I05c962de6ab896f108f70caa1bf937a24e67bfe1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more uses of ValueLars Knoll2013-10-021-18/+18
| | | | | Change-Id: I889e760f75b485a28e1f2a2c26b2337ae9bfafac Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4: remove inplace operationsErik Verbruggen2013-09-301-82/+0
| | | | | | | | | Inplace operations are expanded when building the IR, so the neither the IR, nor the instruction selection backends or runtime need to handle them. Change-Id: Id01f9544e137dd52364cf2ed2c10931c31ddfff3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: changed environment variable SHOW_CODE.Erik Verbruggen2013-09-301-1/+1
| | | | | | | | | Use QV4_SHOW_ASM for the generated assembly from the JIT, and use QV4_SHOW_IR to get dumps of the IR. Change-Id: Id85d3d6c87b47088c312475a7c737d54c58c7791 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: optimize mem2mem copies.Erik Verbruggen2013-09-281-4/+13
| | | | | | | | Instead of loading and decoding a value and then encoding and storing it, we can just as well fold that into a load+store. Change-Id: I84c8eb310510a91cefe2cbc0d4bb01856b41663d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-9/+9
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use SafeValue in more placesLars Knoll2013-09-281-1/+1
| | | | | Change-Id: Ic15c1419c74f22bd7639ce8746ff11b15240b718 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Clean up QV4::ExecutionContextLars Knoll2013-09-281-2/+4
| | | | | | | Remove an unused variable, and don't copy runtimeStrings Change-Id: I2197a7eb82ab3dbefea83cc917567390266f9673 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix CallContext to not hold arguments on the C stack anymoreLars Knoll2013-09-281-4/+5
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4: enable register allocator on linux and macos on x86_64.Erik Verbruggen2013-09-251-1/+1
| | | | | Change-Id: I958cf90da5c44b0119c5666df6ed2e4820444841 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: fixes after NaN boxing changes.Erik Verbruggen2013-09-251-29/+17
| | | | | Change-Id: I22a1b46f488dc65513ed287dabe7d85469cc5173 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: re-enable SSA transformation and optimization.Erik Verbruggen2013-09-251-1/+1
| | | | | | | But keep the register allocator disabled for now. Change-Id: I475835ec35ef31d76e084788a754c00b1f8fdda6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: generate code for unary not operator.Erik Verbruggen2013-09-251-1/+14
| | | | | Change-Id: I00a47d261a76db0b938f8c9300be9afc06b42d02 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix cases where mark() would access uninitialized memoryLars Knoll2013-09-221-0/+1
| | | | | Change-Id: I4e07e20d30ba57759a0ece1c298a02b098718b33 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change the runtime API over to using StringRef's instead of String*Lars Knoll2013-09-221-4/+9
| | | | | Change-Id: I0ea95e6cca995dc5f98871f0369204af18e48111 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'wip/v4' of qtdeclarative into devSimon Hausmann2013-09-201-4/+3
|\ | | | | | | | | | | | | | | This brings in the infrastructure for the new compilation of QML and JS in the loader thread and the new VME replacement for creating objects in the GUI thread. Change-Id: Ib8127c10f5cb3ad238e57469723d031ab765a79b
| * Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into HEADSimon Hausmann2013-09-201-202/+488
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4isel_masm.cpp src/qml/jsruntime/qv4script.cpp src/qml/qml/qml.pri src/qml/qml/qqmltypeloader_p.h Change-Id: Ia784d855a2131e3289454f12d841ca2c65be15c1
| * \ Merge branch 'dev' of qtdeclarative into wip/v4Simon Hausmann2013-09-111-48/+81
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4script.cpp Change-Id: I20136cab29d86862b5bd9208003200bc24bcdacf
| * | | Beginning of a new qml parserSimon Hausmann2013-09-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to parse QML and JavaScript binding expressions/functions in one go and generate data structures that allow for the parsing to happen in a thread and the instantiation of the object tree in another thread, just reading from the generated data structures. This will replace qqmlcompiler and the VME. This new way of loading QML is currently hidden behind the QML_NEW_COMPILER=1 environment variable. There's lots of work left to fill in the gaps in object construction, Component support, Component.onComplete, error messages, etc. etc. Change-Id: I5e40643cff169f469f0b6ce151584ffee5ca5e90 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * | | Make it possible to supply an external JS unit generator to the iselSimon Hausmann2013-09-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for QML unit generation, when we share the JS generator for QML types/strings and JS code. Change-Id: I50f0c1fa6721d6e3e59417c6c256c82aec124e8f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | V4: fixes after ReturnValue and ValueRef introduction.Erik Verbruggen2013-09-201-3/+10
| | | | | | | | | | | | | | | | | | | | Change-Id: I072cd7168aca4163af560c0b65e8527ddf55e26b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | V4 JIT: generate inline code for more binops.Erik Verbruggen2013-09-201-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bitwise-and, shift left, and shift-right. Change-Id: Ifa949c60261054218797302673822f480f47bd6e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | V4 IR: rename ObjectType to VarTypeErik Verbruggen2013-09-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ObjectType was a misnomer: it was used to indicate that the expression could have multiple types, or that the type could not be inferred statically. Change-Id: Ic48a0cd1dd7ae7bfafd361e0c9792ab161417039 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | Use a handwritten offsetof macroLars Knoll2013-09-201-20/+20
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | clang complains about our usage of offsetof(). What we do is not strictly c++98 compliant, but compliant with c++11. So replace the default offsetof with a handwritten macro to shut up clang until we can switch to c++11 mode for all compilers. Change-Id: Id724adb323ba9724ad5d7d9e0dba5a73b51af24f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | | Refactor our NaN boxing to be more efficientLars Knoll2013-09-181-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use a unified way to store all Managed objects inside a Value, instead of distinguishing between strings and other objects. * On 64 bit we store pointers as pointers, so accessing them through Scoped<> objects is cheap. This implies that doubles are now stored in a mangled form (xor'ed with a mask). Change-Id: I582e0fb167a62c0c527c6bfa3452550e37944069 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Convert more methods to use ReturnedValueLars Knoll2013-09-181-4/+4
| | | | | | | | | | | | | | | | | | | | | Change Exception.value() and a few other places. Change-Id: I53ce17e5656e260138b1ac7f6d467e4636c0a0b9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Convert lookups to use ReturnedValueLars Knoll2013-09-181-4/+4
| | | | | | | | | | | | | | | Change-Id: Idbcd1fbd2aa43775ce8c1a3d8fac29a6b58b678a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Rename QV4::ValueScope to QV4::ScopeLars Knoll2013-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The class is going to be used all over the place, so let's give it a short name :) Change-Id: If61543cb2c885e7fbb95c8fc4d0e870097c352ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Change calling convention in JIT to use ReturnedValueSimon Hausmann2013-09-181-29/+11
| | | | | | | | | | | | | | | | | | | | | This simplifies the masm backend as well and should be faster. Change-Id: I64ad5d9ee1b6caca950471e3aec4ef19d7503e62 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | V4: Fix SSA decomposition when no regalloc is used.Erik Verbruggen2013-09-131-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add scheduling for moves generated by removing phi nodes by re-using the MoveMapping class from the register allocator. This change applies to both the JIT when no register allocator is used, and the interpreter. Change-Id: I38eac5b13759c7790132d1ef07fa17fcb53187e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Fix __qmljs_init_closure to use ReturnedValueLars Knoll2013-09-121-1/+1
| | | | | | | | | | | | | | | Change-Id: I777a63db32857a6a326839e3fcdb99657dc80e7f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Change binops to use ReturnedValueLars Knoll2013-09-121-4/+2
| | | | | | | | | | | | | | | Change-Id: I068b1af5c352fc84793079e5bccbe3482b04cafa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Convert unary operations and some other runtime methodsLars Knoll2013-09-121-10/+7
| | | | | | | | | | | | | | | Change-Id: I985876ade37efd24e1d4f8360a6472282cf44f8b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Use ReturnedValue for more runtime methodsLars Knoll2013-09-121-22/+16
| | | | | | | | | | | | | | | Change-Id: I6e92dccf4c3c1a9e4c23128ced41b6e19da1e490 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Remove unused code to generate post increment and decrement expressionsLars Knoll2013-09-121-51/+0
| | | | | | | | | | | | | | | | | | | | | | | | We generate lower level code in codegen and don't use these runtime methods anymore. Change-Id: If1023ce5295431305f4528839bcf2a3031fa7ad2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Use ReturnedValue for some more runtime methodsLars Knoll2013-09-121-15/+14
| | | | | | | | | | | | | | | Change-Id: I68c7d321f8d17b32110ee050aa48fae5735e63ad Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Use QV4::ReturnedValue in the runtime APILars Knoll2013-09-121-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | This makes function calls from the JIT/Moth into the runtime significantly nicer. Change-Id: Ie7d7123984d65c0bee0525d3d28c643a76b394c4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>