summaryrefslogtreecommitdiff
path: root/src/qml/compiler/qv4isel_masm.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Fix passing of exception table pointers to ARM runtime on unwindingSimon Hausmann2013-09-121-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | V4 JIT: add env. var. QV4_NO_REGALLOC.Erik Verbruggen2013-09-121-6/+9
| | | | | | | | | | | | | | | | | | | | | If set to anything, no register allocation will be performed. Change-Id: Ibe11ad8c8ac6dacd898bc4a4d5296476ca6ddb14 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | V4 JIT: fix visitRet for UInt32 temps.Erik Verbruggen2013-09-121-1/+4
| | | | | | | | | | | | | | | Change-Id: Ia104cc50523f6aef348ecbe0b597b79c1817390a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | V4 JIT: finish swapValues.Erik Verbruggen2013-09-121-4/+39
| | | | | | | | | | | | | | | Change-Id: I92b2a84128714927d61c9879c5ddb584631ea2ce Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | V4 JIT: generate code for binary expressions.Erik Verbruggen2013-09-111-21/+331
| |/ |/| | | | | | | Change-Id: If32ee3528fa0b6a2d04263d6c6abe1d34053d658 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Continue conversion to using scoped valuesLars Knoll2013-09-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | This converts all methods in qv4runtime_p.h to not use raw values in arguments anymore. The conversion of return values will be done in a separate commit. Change-Id: Ie6e8f3bed459d09cb831f7f87920b7eada161502 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove unusued methodLars Knoll2013-09-111-11/+0
| | | | | | | | | | Change-Id: I76233198e01d853637bd09b12f73ba3b45104e70 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Properly unwind the js stack for generated codeLars Knoll2013-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Surround all calls into generated code with a try {} catch {} statement that resets the jstack to the correct position. Like this we properly unwind the js stack in all cases, and can also use stricter assertions in our ScopedCallData, etc. classes to check that the stack is healthy. Change-Id: I7ca03e06ea55007be683305d9c2a6898cf5fc689 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Generate CallData structures directly in the instruction selectionLars Knoll2013-09-111-29/+58
| | | | | | | | | | | | | | | | | | 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>
* | Create a stack for JS values and use it in the interpreterLars Knoll2013-09-111-9/+22
|/ | | | | | | | | | | | First step towards being able to do an exact GC. Create a stack for JS Values that is separate from the C++ stack. Use the stack for generated methods (masm and moth). Change-Id: I80ac0e5b5d86439dda5e9ea2b21fa0c57d8aef22 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Temporarily collect a map of all functions in the engineSimon Hausmann2013-09-021-0/+5
| | | | | | | | | | | | | | | | 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>
* Rename the DW2 and ARM unwinder helpers to standard _p.hThiago Macieira2013-09-021-1/+1
| | | | | | | | | | The Qt convention is that private headers end in _p.h. A great deal of our build automation relies on this, including the choosing of which headers to install and which ones not to. Change-Id: I03ab6021e0a8a68d5a9cbc9d9387a9c5331f7bb7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Generate code for conversion to signed int32.Erik Verbruggen2013-08-291-8/+82
| | | | | Change-Id: I862a8c9c262b658859cc9b57ea0b6e9eb60e32e5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Generate code for conversion to boolean.Erik Verbruggen2013-08-291-0/+45
| | | | | Change-Id: I59e24264325b6560ee1c0dbdafacb1f08c3671d5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Generate code conversion to double.Erik Verbruggen2013-08-281-1/+64
| | | | | | | | Performance improves by about 15% on fact.3.js when Qt is build in debug mode. Change-Id: I4a1c868fe211c1e0f9e7d9a5652f7726b37405d1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* The fast and the furious, register drift.Erik Verbruggen2013-08-271-253/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-140/+107
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-13/+1
| | | | | | | | | | Change-Id: I99004b872be9bd7d9dd0c798eb2d9bb4ddfa4cbd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix ARM buildSimon Hausmann2013-08-191-0/+1
| | | | | | | | | | | | | | | | Re-add variable only needed for ARM build and replace references to removed codeRef variables from QV4::Function. Change-Id: Id47fe57be2aa653bd8f81996463d970f27427f37 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Cleanup: Make isel subclass the unit generatorSimon Hausmann2013-08-181-7/+6
| | | | | | | | | | Change-Id: Iadff4974ec6fde25c6586d03d23136ea280f9555 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>
| * Merge Function::init with the constructorSimon Hausmann2013-08-161-4/+6
| | | | | | | | | | Change-Id: I557f8a80aa2c74398b94e87ed0f29fe8d2297150 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Eliminate all vm functions on the isel sideSimon Hausmann2013-08-161-4/+2
| | | | | | | | | | Change-Id: I7c0e50498c937ce554b019f98829fa8c5d96c18e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Use indices into the runtime functions array instead of function pointers in ↵Simon Hausmann2013-08-161-3/+2
| | | | | | | | | | | | | | the isel for closures Change-Id: Ieaf7b112f80adc3f1041cb1397db4eab55fb0184 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Get rid of the functions list in QV4::ExecutionEngineSimon Hausmann2013-08-161-2/+7
| | | | | | | | | | Change-Id: I97067dbb2819936a1b2029c9f63f0627cb6b8bd2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Reduce ExecutionEngine dependencies in the moth and masm iselSimon Hausmann2013-08-161-4/+4
| | | | | | | | | | Change-Id: Ic3d0287e15c404c5527fa6fe0dfa759631b66dd4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Get rid of the QV4::Function in the masm iselSimon Hausmann2013-08-161-24/+12
| | | | | | | | | | Change-Id: Ide70ca5a3f3dcc793fb96fd64f8b8df6b07d1168 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Ported the compile-time class setup for object literals to be run-time basedSimon Hausmann2013-08-161-4/+3
| | | | | | | | | | Change-Id: I21225e4bf0f66914229cf64fa29ce870548c0e93 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Store line number mappings in the compiled functionSimon Hausmann2013-08-161-5/+5
| | | | | | | | | | Change-Id: I4e37aac3618b20ccd52ce4833098781374a3daf6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Ported regular expressions over to be run-time generated dataSimon Hausmann2013-08-161-4/+2
| | | | | | | | | | Change-Id: I04e693d4923c97c3d869a5beb17011f6aad85f03 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove identifier() from masm iselSimon Hausmann2013-08-151-8/+1
| | | | | | | | | | | | | | It isn't needed anymore. Change-Id: Ia9977db4d247c35d170e74f68a602cecde096165 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Ported lookups to use the compiled data infrastructureSimon Hausmann2013-08-151-62/+6
| | | | | | | | | | Change-Id: Idf75cd51087ea825f22aabda59661be461fd3b86 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Convert more of the masm backend to generate code for run-time stringsSimon Hausmann2013-08-151-27/+25
| | | | | | | | | | Change-Id: Ib560f86b2b32162a9344487f4cde03e76231b089 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Prepare MASM for better runtime string handlingSimon Hausmann2013-08-151-5/+11
| | | | | | | | | | | | | | | | | | | | Keep the run-time functions as-is by taking String pointers and use a little bit of inline assembly to resolve the string ids to string pointers, by adding a runtimeStrings array pointer next to the lookups in the context (similar mechanism). Change-Id: Ib5a70bdf47fef7c447d646ccfe03f3dc30d39f20 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Initialize formals and locals from the compiled function data instead of in ↵Simon Hausmann2013-08-151-3/+1
| | | | | | | | | | | | | | the isel Change-Id: I9db976df310a5986ceca66d21efeeae536dbede4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Move codeRef out of QV4::FunctionSimon Hausmann2013-08-151-6/+24
| | | | | | | | | | Change-Id: I65700b9cc4907aaa28623a95204e88f87fccfd49 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Move the masm compilation unit entirely into qv4isel_masmSimon Hausmann2013-08-151-6/+29
| | | | | | | | | | Change-Id: If24b6a761dc2f2443520b31b5130ab44b739cdf3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix writing the function offset table and initialize the pointer to the ↵Simon Hausmann2013-08-151-1/+8
| | | | | | | | | | | | | | compiled function in the runtime function Change-Id: I9aed9f394fedc4a4ea334f6ab1b72fe749c64c72 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Begin using the compiled data structures for runtime stringsSimon Hausmann2013-08-151-3/+6
| | | | | | | | | | Change-Id: Idbf278a96624bf101df35de40577b38e593f22be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Various fixes to the optimizer.Erik Verbruggen2013-08-201-1/+4
| | | | | | | | | | | | | | | | | | | | Mainly type inference and type propagation. Also added constant/copy propagation pass, which is disabled for the moment. Change-Id: I286c1fbced0d175be76868e870ca92c0da88babd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add linear scan register allocation.Erik Verbruggen2013-08-191-2/+19
| | | | | | | | | | | | | | | | Currently disabled for all platforms. Will be enabled step-by-step when specific platforms get supported. Change-Id: I144c6c991b1666e1ff752d776bca0a7b57a4fe7c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move arguments object creation into the generated codeLars Knoll2013-08-171-0/+6
|/ | | | | | | | | | 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>
* Fix leak of QString in V4 IRSimon Hausmann2013-08-121-1/+1
| | | | | | | | | The destructors of the IR nodes won't be called because they come out of a memory pool. Therefore we must store strings by pointer from the function's string pool. Change-Id: I841e801b81c871e8d08cf63ee1e053744c0bf4dc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of unused outer function pointer of QV4::FunctionSimon Hausmann2013-08-121-3/+0
| | | | | Change-Id: I3ea88d3c259447081d1ac5f85d7da95fed8f02f6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Restructure source codeLars Knoll2013-08-081-0/+1466
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>