aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth_p.h
Commit message (Collapse)AuthorAgeFilesLines
* V4: Remove more jumps.Erik Verbruggen2013-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* Remove more uses of ValueLars Knoll2013-10-021-1/+1
| | | | | Change-Id: I889e760f75b485a28e1f2a2c26b2337ae9bfafac Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4: remove inplace operationsErik Verbruggen2013-09-301-3/+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>
* Merge branch 'wip/v4' of qtdeclarative into devSimon Hausmann2013-09-201-3/+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-9/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4script.cpp Change-Id: I20136cab29d86862b5bd9208003200bc24bcdacf
| * | | Make it possible to supply an external JS unit generator to the iselSimon Hausmann2013-09-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Use a handwritten offsetof macroLars Knoll2013-09-201-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Remove unused code to generate post increment and decrement expressionsLars Knoll2013-09-121-8/+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>
* | | Fix passing of exception table pointers to ARM runtime on unwindingSimon Hausmann2013-09-121-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our synthetic exception unwind table for ARM is located at (char *)codeStart + function->codeSize; This relies on function->codeSize to contain the number of bytes of instructions the function has, not the size of the MacroAssemblerCodeRef (which contains the size of the entire area). This patch fixes the calculation of function->codeSize and also replaces the QHash for the IR::Function* -> CodeRef mapping in the masm backend with a simple vector that's perfectly sufficient. Bug spotted by Petr Nejedly Change-Id: I78a53599085c613c6d97aa2490922f54e0bb4f63 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Generate CallData structures directly in the instruction selectionLars Knoll2013-09-111-4/+5
|/ | | | | | | | | Like this we can hand the CallData through the runtime methods without any need to modify them. This simplifies the code in there, and should also speed them up to some degree. Change-Id: Ibd92ff4a8f279a5c4a054c5678646f658cfed5ca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Temporarily collect a map of all functions in the engineSimon Hausmann2013-09-021-0/+1
| | | | | | | | | | | | | | | | At the moment we collect a lot of compilation units (one per binding expression!), which for long running QML accumulates and creates a horrible performance when trying to retrieve back traces. There is work in progress to reduces the number of units down to one per QML file, and then the fixed sorted QVector might proof to be a more efficient data structure for the lookups. But until that code lands, this patch proposes to use a QMap instead for the time being, that tracks all functions. This brings down the qtquickcontrols auto-test run from 2.5 minutes to just under a minute on my machine. Change-Id: I45bf609055877081daa984de90f291a030f2f24f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* The fast and the furious, register drift.Erik Verbruggen2013-08-271-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the register allocator for X86_64 on Linux and MacOS. The implications are: - handle as much as possible with current code with as few changes as possible - temporarily force the register allocator to spill unop/binop arguments to the stack by doing a call in the implementation (as is the current case), so no change is needed here - only have loadThis and loadConst handle registers - have any method that might need to handle registrers actually cope with them - the inline versions of binops are not generated, as they cannot cope with registers. This will change when ISel for binops is added in the next patch. This means that we are still running with the handbrakes on, but allow for full-throttle in certain/limited cases. Note about the changed test: multiplication always returns a Number (double), so the operands are passed as doubles, so __qmljs_mul will return a double. For addition this is different: because it might return a Number or a String, the operands are passed as whatever fits best. So __qmljs_add will return an int when both operands are ints. Hence the change to the tests. Change-Id: If5bd7dffca8f7de5ba45af700b9c7bb568fc74b7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'wip/v4' of ssh://codereview.qt-project.org/qt/qtdeclarative ↵Simon Hausmann2013-08-201-8/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into dev Conflicts: src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4codegen_p.h src/qml/compiler/qv4isel_moth.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4runtime_p.h src/qml/jsruntime/qv4script.cpp sync.profile Change-Id: I1d785e2134bffac9553a1c16eed12816cbd1ad2c
| * Cleanup: Determine the root/entry function in isel independent codeSimon Hausmann2013-08-191-1/+1
| | | | | | | | | | Change-Id: I99004b872be9bd7d9dd0c798eb2d9bb4ddfa4cbd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Get rid of engine pointer in iselSimon Hausmann2013-08-181-3/+3
| | | | | | | | | | Change-Id: I58759712624713cd2215621dca4ccc86fa9a9194 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Eliminate all vm functions on the isel sideSimon Hausmann2013-08-161-2/+1
| | | | | | | | | | Change-Id: I7c0e50498c937ce554b019f98829fa8c5d96c18e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Ported identifiers in moth to use runtime stringsSimon Hausmann2013-08-161-2/+0
| | | | | | | | | | Change-Id: I09f04994a2ebe631b12fa76b77a622711de31926 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Initial port of moth to the new compile data structuresSimon Hausmann2013-08-161-1/+15
| | | | | | | | | | Change-Id: I2ead40c5c8c9b12b29c48c387ea424838d1f7d9e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Move arguments object creation into the generated codeLars Knoll2013-08-171-0/+1
| | | | | | | | | | | | | | | | | | | | So far we've been creating the arguments object at runtime in initCallContext(). It's much more efficient to simply add arguments as a local variable in qv4codegen if it's being used and initialize it through a builtin method. Change-Id: I6913f3565adf3aa1917adae8dceef9f50ecf1722 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move the Param struct out of the Instr union.Erik Verbruggen2013-08-141-4/+4
|/ | | | | | | | The parameter struct was accidentally put in the instruction union. As it is not an instruction, it should not be part of that union. Change-Id: Id70619fed50ae606f43f2c1701f28aea0a0baed7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix binop related crashes in the interpreterSimon Hausmann2013-08-091-0/+2
| | | | | | | | | | | | if (foo instanceof blah) would crash because we generated a BinOp instruction with a null aluop pointer. Instanceof, in and add are binops that now require a context, and thus require a different instruction (BinOpContext). This was already handled by the traditional binop() of the isel, but not by the binop expression that can be in a cjump. Centralize the code by calling a common binop helper from isel binop as well as cjump. Change-Id: I793ee3eebe56db4c86d5399a783a84be3093fd35 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Clean up some header dependenciesLars Knoll2013-08-081-1/+1
| | | | | | | | The compiler should have as little dependencies onto the runtime as possible. Change-Id: I3e16a55a4920299945ed405926a6851ed947f42d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Restructure source codeLars Knoll2013-08-081-0/+201
Move the v4 engine classes from a subdir of qml/qml into two subdirs (compiler and jsruntime) of the qml module Remove an unsued qv4syntaxchecker class, and move the moth code directly into compiler. Change-Id: I6929bede1f25098e6cb2e68087e779fac16b0c68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>