aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix some more issues with exact GCLars Knoll2013-10-152-3/+3
| | | | | | | | | Get the formal and local names of function object from the compilation unit to avoid creating another set of strings. Use a ScopedFunctionObject in eval() Change-Id: I6693aec2e88818df9c160b3780db12d8df79c2fe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix GC issue with incubatorsLars Knoll2013-10-151-19/+45
| | | | | | | | | | | | Never use multiple inheritance with Managed subclasses, as this can easily mess up garbage collection. In this case the vtable from the QQmlIncubator would be added before the start of the Managed pointer. That would not work correctly for the memory manager that casts void pointers to Managed pointers. Change-Id: I1c1ebc6c44bd9cb77eea49738e86ce3374c7ef80 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* inline get_element callsLars Knoll2013-10-149-21/+119
| | | | | | | | | | | Inline calls to get_element if the base is an object with a simple array structure, and the index is an integer number. Implemented for 64bit only for now, saves ~25% on crypto.js Change-Id: I3e34a6409169d90d3937f62264707d52a6c2f9f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid creating array attributes if possibleLars Knoll2013-10-146-57/+47
| | | | | | | | | | | Holes in arrays should be represented by an empty value, not by creating/setting array attributes. Reason is that the creation is irreversable, and slows down execution. This speeds up crypto.js by 10% Change-Id: I2e5472575479a5f2dbe53f59ecb8ed3aeab1be7a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix performance regression introduced by 6adb06Lars Knoll2013-10-141-1/+1
| | | | | | | | | The global scope is compiled as EvalCode. Because of this we were never using global lookups anymore, slowing down the v8 test suite by ~20%. Change-Id: I6c47ccf90f4d9ec3bf531bbb689d3f1511f69968 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a small bug in conversion to SInt32Lars Knoll2013-10-141-8/+0
| | | | | | | | | If the truncation from double returned out of bounds, the code was not generating the right call to the fallback method on 64 bit. Change-Id: I6a126dd013c5b6373762beef0c1459fae1c26ef2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Touch up QJSEngine::evaluate documentation.Mitch Curtis2013-10-141-4/+4
| | | | | Change-Id: I350ad1ccb8a6cf522787e4579292fa4ba1c8e043 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: fix stack size calculation on 32bit.Erik Verbruggen2013-10-141-2/+3
| | | | | | | | | Registers containing outgoing parameters for calls are saved as Value (so, 8 bytes long) instead of native register size. For 64 bit this is the same, but not for 32 bits. Change-Id: If1d55e9d552a301782816c9228390dc5611c6d00 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 disasm: fix sub sp,sp,immErik Verbruggen2013-10-141-1/+1
| | | | | | | | This is a special-case instruction, where the immediate needs to be multiplied by 4. Change-Id: I86e5ab9d39d65b8eab99fae859969896c6e5630c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't leave a window current when removing itGiulio Camuffo2013-10-141-2/+6
| | | | | | | | The window may be deleted before any other window is make current, and that would lead to memory corruption with Mesa's EGL. Change-Id: I414b972fd517f60c28d194fa059bf7871e422872 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add classnames for QML import plugins.Morten Johan Sørvig2013-10-1411-0/+11
| | | | | | | | | Needed for static builds. qmlimportscanner will read the "plugin" and "classname" entries. Change-Id: I31939451366ad3e771d516ac426525c8bcdba57d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement >>> inline for the JIT backendLars Knoll2013-10-123-8/+13
| | | | | | | | | The unsigned right shift operations can use a signed int as input, unifying the handling with the other shift operations. The only difference now is in the type of the return value. Change-Id: Ia9b83568951d1c1c77322d07cd734e2c37d34573 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* V4 JIT: fix register allocator after change to s/uint32 usage.Erik Verbruggen2013-10-121-8/+2
| | | | | | | | Now that shifts can take a signed int32, reflect it in the check if a binop will generate a call. Change-Id: I3cab436bace31cdda327cf6132aa873b6c5456b1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: clean-up conversion functions and add toUInt32.Erik Verbruggen2013-10-123-45/+107
| | | | | Change-Id: I7ac685145fa41db2a0e02c4d15d1d287d80621f8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 ARM: fix disassembler vmovErik Verbruggen2013-10-121-1/+1
| | | | | | | rt is on position 12. See A8.8.345. Change-Id: Ibf380b9bda8d2edd603857935d6c92cd89d0f104 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove some unused flags from ManagedLars Knoll2013-10-126-15/+3
| | | | | Change-Id: I94399489823d5b0d4d40f300e1999272dc2da5c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Compile signal handler expressions in the loader threadSimon Hausmann2013-10-115-7/+75
| | | | | | | | | Handle them similar to function declarations, except that we need to synthesize the expression into a function declaration that includes the signal parameter names. This is done quite similar to the code path in the new compiler. Change-Id: I751081f7f1052692da6e2ed60c7f5c017372d829 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Compile JS functions as part of the QQmlCompiler run in the loader threadSimon Hausmann2013-10-118-45/+50
| | | | | | | | ...instead of extracting the function body as a string and compiling it in the GUI thread. Change-Id: I3c3108f6e35464b5581a2d8b5799e7285858ce4d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Compile binding expressions in the QQmlCompilerSimon Hausmann2013-10-1115-43/+154
| | | | | | | | | | | | | | | | | | | | | | | | This is done by re-using the JS code generator from the new compiler. A few bugs were fixed on the way: * The index into the compiledData->runtimeFunctions array is not the same as the function index when they are collected (from the AST), as for example binding expressions may create extra V4IR::Function objects that break the 1:1 mapping. Therefore the JS code gen will return a mapping from incoming function index to V4IR::Module::Function (and thus runtimeFunction) * Binding expressions in the old backend get usually unpacked from their ExpressionStatement node. The reference to that node is lost, and instead of trying to preserve it, we simply synthesize it again. This won't be necessary anymore with the new compiler in the future. * Commit 1c29d63d6045cf9d58cbc0f850de8fa50bf75d09 ensured to always look up locals by name, and so we have to do the same when initializing the closures of nested functions inside binding expressions (in qv4codegen.cpp) * Had to change the Qml debugger service auto-test, which does toString() on a function that is now compiled. Even if we implemented FunctionPrototype::toString() to do what v8 does by extracting the string from the file, it wouldn't help in this test, because it feeds the input from a string instead of a file. * In tst_parserstress we now end up compiling all JS code, which previously was only parsed. This triggers some bugs in the SSA handling. Those tests are skipped and tracked in QTBUG-34047 Change-Id: I44df51085510da0fd3d99eb5f1c7d4d17bcffdcf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix failing assertion (index != -1) when trying to re-declare a function ↵Simon Hausmann2013-10-111-8/+3
| | | | | | | | | | | | | | | | | parameter Testcase: (covered in parserstress) function foo(x) { var x = 42; } In variableDeclaration, the lookup for "x" with findMember will return -1, and instead code for checking against arguments using indexOfArgument is needed. The easiest fix is to simply use identifier(), which handles this accordingly. Change-Id: I6a738d6196d4bff1fc987f111aebbaa83ed8f88f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix determination of lookup mode in V4 code generatorSimon Hausmann2013-10-114-43/+39
| | | | | | | | | | | | | | | | | | In order to determine the type of lookup we need (name or directly in environment members), we used Codegen::_mode, which is set to the currently suitable mode depending on the function (parameter to defineFunction). However that's not quite correct, the look-up mode depends on the function itself, not where it was called from. This patch corrects that by moving the compilation mode into the Environment itself. This is needed by follow-up patches. Additionally the "bool deletable" parameter to the builtin_declare_vars was always set to false, because it used mode instead of _mode, which was never set to Eval or QmlBinding. This will be cleaned up in a future patch. Change-Id: I878f187945e5de091689ab5d70a0f33eb5a9e38f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash in duplicate labelled statement checkSimon Hausmann2013-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | Testcase (part of parserstress in tests/auto/qml): outer: { do { inner: {} } while (false) } The labelled statement visitor, when hitting the outter label, would call enterLoop(), which sets _labelledStatement back to zero. That then gets added to the Loop object the do-while loop creates, and the duplicate labelled statement check then for inner would unconditionally dereference loop->labelledStatement. In all other places where we access loop->labelledStatement we have a null pointer check, so let's have one here as well. Change-Id: I9d5925a2abf4db691c49c0cdec3550938ee02efa Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix possible crashesLars Knoll2013-10-111-4/+9
| | | | | | | | This can (and does crash) when a gc gets triggered during the linking stage of a compilation unit. Change-Id: I06f1299adab68ff8e0a4755d02e246870797e7f2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Correct a small typo to QtQuick::Grid::horizontalItemAlignmentJan Arve Saether2013-10-111-1/+1
| | | | | Change-Id: I09d56b69d9d958e7ad4bebd78dd66316a84a50b6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Correctly set the vtbl for Boolean and NumberObjectLars Knoll2013-10-112-1/+5
| | | | | | | | Also accept a boolean primitive as input to Boolean.prototype.valueOf() Change-Id: I5b94d8d65b86e26860b9844eb4bf823577c8e924 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix the remaining objects against self destructionLars Knoll2013-10-1111-5/+45
| | | | | | | | This makes pretty much all test cases pass with exact garbage collection. Change-Id: Ia874e3c17c3984afb7cfe370f9bd3ad8fe46699a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimise code generation for convertTypeToSInt32Lars Knoll2013-10-116-8/+96
| | | | | | | | Add 64 bit code patch and avoid some duplicated calculation in 32 bit mode Change-Id: I0e111de8ac4e733aa8802c49b4b15d785688d7ea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build on Android with -developer-buildSimon Hausmann2013-10-113-3/+4
| | | | | | | | | | | | 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>
* Support statically linked module pluginsRichard Moe Gustavsen2013-10-112-109/+244
| | | | | | | | | | | | | | | | | | | | | | | | | Up til now, QQmlImports would always assume module plugins are dynamically linked, and as such, go looking for them on the file system. This would fail for plugins linked in statically. This patch will hook into QQmlImports at the place where it iterates through all plugins in a qmldir and try to load them dynamically. If some plugins cannot be resolved, we now do an extra interation over static plugins to check if any of them has the correct uri specified in their metadata. Hooking into the loading process this late, will ensure that as much code as possible is shared between dynamic and static plugin loading so that setting up base urls, namespaces and guards will remain the same. Note: this patch is one out of several patches that is needed to build QML2 apps statically, and depends on plugins reporting their URI through the plugin meta data system. This will be injected automatically by qmake+moc. Task-number: QTBUG-28357 Change-Id: If9a204e942ca7003448e188a1a47eec69b34c37b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Protect a few constructors against self destructionLars Knoll2013-10-112-1/+6
| | | | | | | | This gets most of qqmlecmascript to pass with aggressive and exact garbage collection. Change-Id: I93ecbfe55f62af68227cdf3b1ec2bd066f1cbdef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Smaller cleanupsLars Knoll2013-10-1113-43/+57
| | | | | Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove usage of String pointers where not requiredLars Knoll2013-10-113-10/+18
| | | | | Change-Id: Ia533308a1641fab263d8faa8316455e8ade1c859 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Mark strings stored in the lookupsLars Knoll2013-10-111-0/+2
| | | | | Change-Id: I4cb72a3eee9f87305316137b0a1bfd4a003de840 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct usages of Managed pointersLars Knoll2013-10-115-40/+44
| | | | | Change-Id: I32f61b7919797eef51a8705695787175b76244c4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Small optimisation for bit shift operationsLars Knoll2013-10-112-6/+6
| | | | | | | | | 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>
* Fix build on iOSSimon Hausmann2013-10-111-2/+6
| | | | | | | | | | | On 32-bit ARM, iOS uses SJLJ for exceptions, which is probably why _Unwind_Backtrace is not available (it's hard to implement reliably without unwind tables). Don't use it there, we don't need it (because we can't JIT). Task-Number: QTBUG-33979 Change-Id: Ifafbb59a32fd23c9b2e93228779535b2324ac4a3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Add support for showing disassembled ARM JIT codeSimon Hausmann2013-10-107-4/+2776
| | | | | | | | | | 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>
* qdoc: Added excludedirs to qtquickdialogs.qdocconfMartin Smith2013-10-101-0/+2
| | | | | | | | | Added excludedirs += ../qml to qtquickdialogs.qdocconf. Task-number: QTBUG-33966 Change-Id: I08a74061ed82301712239bc0979ed6fcea0a2448 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* V4 runtime: add some more counters.Erik Verbruggen2013-10-102-0/+21
| | | | | Change-Id: I872f259a9fd4580e8faeae664f4d34f59a785c4e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 JIT: ISel for bitwise or/xor.Erik Verbruggen2013-10-102-9/+63
| | | | | | | 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-104-33/+194
| | | | | | | | | | | 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-106-1/+55
| | | | | | | | | | | | | | | | | | | | | 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>
* Use common prefix for environment variableKai Koehne2013-10-091-3/+3
| | | | | Change-Id: Idbbdcad42106d30451000fc6593428a0bac4bc04 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Be explicit about precision specifiers.Gunnar Sletta2013-10-081-1/+1
| | | | | | Task-number: QTBUG-33912 Change-Id: I4b6988e7385bcf9167e5f44d0bde7c80fbc1e117 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* All matrices in a batch need to be 2D safe when merging.Gunnar Sletta2013-10-082-3/+18
| | | | | | | | | | | | If we merge geometry nodes that make actual use of the z-coordinate, this information becomes lost when merging and the result is that we end up with an arbitrary wrongfully applied transformation to the merged element. Task-number: QTBUG-33897 Change-Id: I6129243e9bb890949023c35dc6b7bce30d31709a Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Several smaller fixes to Animators.Gunnar Sletta2013-10-083-2/+23
| | | | | | | | | | | | | | Backwards animations are not supported for animators as the animation system cannot handle uncontrolled backwards animations. Make sure we write back values only for the animators that have run at all. Clockwise rotation to 0 can easily end up on 360 as a result the _q_interpolateClockwise function not being entirely correct. Change-Id: If69b8555a1361f46600a40e80419b65438c18097 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Delay calculation of offline storage path as long as is practically possible.Robin Burchell2013-10-081-6/+10
| | | | | | | | | This avoids calculating it incorrectly in the case that something later clobbers argv, such as a zygote or booster-type mechanism. Change-Id: Ifab16c7c94e9ee3fded0dfda2266a12c910858ee Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au> Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Fix qquickframebufferobject.h syncqt warningJ-P Nurmi2013-10-071-1/+1
| | | | | | | | QtQuick: WARNING: qquickframebuffe robject.h includes QQuickItem when it should include QtQuick/QQuickItem Change-Id: Ia702bab8881ade601693cbee495b1dc6a5e14abb Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QStringRef has toInt(), so no need to create a new QStringThiago Macieira2013-10-072-10/+6
| | | | | | | | Saves up on memory allocations. Change-Id: I0f7c82521b0b10085861fc62fed9b9d591169b5a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>