aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Optimize String.replace and RegExp.execLars Knoll2013-09-026-42/+87
| | | | | | | This speeds up the v8 regexp benchmark by a factor 2.5 :) Change-Id: Ibd6b18ee28181aa712429cbec4598984e0c69820 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimize ScriptFunction::construct() and creation of FunctionObjectsLars Knoll2013-09-024-17/+27
| | | | | Change-Id: I7df04171a26cbe659e85f14878cc4e51030e8a5a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Inline identifier lookup where it makes senseLars Knoll2013-09-022-2/+9
| | | | | Change-Id: I42ac6f4232fec2ce1535a007007542d8cc116433 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use Q_ASSERT instead of assert to get rid of the checks in release buildsLars Knoll2013-09-021-2/+2
| | | | | Change-Id: Ia4b5bda273d44ec4c25ba955018a0f6fe220551e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimize Function.apply()Lars Knoll2013-09-021-3/+15
| | | | | Change-Id: I693413e7be5520e13139594f7654a36ce54a59ce Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimise property lookups on primitive typesLars Knoll2013-09-023-31/+168
| | | | | | | | This gives a large speedup on code such as "foo".charAt(2), or (5.).toString(). Change-Id: I8b6c46f2f69a4b00f82048a9368d8e9baf4d89ee Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a small bug in ExecutionContext::getPropertyAndBaseLars Knoll2013-09-021-1/+2
| | | | | | | | Don't return the activation object as base, as it's only a helper for mutable properties in regular call contexts Change-Id: I2c36a4aff9cf82d87f80e541b4ec21ef17e18e8d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more usages of Object::setPrototype()Lars Knoll2013-09-0215-40/+23
| | | | | Change-Id: I33383baf14e764ce79252a100a6d769bde75331a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more usages of Object::setPrototype()Lars Knoll2013-09-024-62/+49
| | | | | Change-Id: I8c49f61bc85e3d98dea90bf05db1a3f22d08f7b1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup calls to Object::setPrototype()Lars Knoll2013-09-0221-102/+86
| | | | | | | | Rather use the correct internalClass directly when constructing the objects. Change-Id: I8e916f1ce8f83d291c08ca6332fe85b1f57b90b5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move prototype pointer into QV4::InternalClassLars Knoll2013-09-0246-243/+304
| | | | | | | | | | | | | The prototype is actually the same for most objects. By moving it into the internal class, we can save 8 bytes per object, as well as allowing for some future optimizations. Also fix a bug in the implementation of the Error prototype objects. Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add the object's prototype to the InternalClass structureLars Knoll2013-09-023-2/+39
| | | | | Change-Id: Ifa97d3354a7a7afadf70f9ba540716bd5b1eef44 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused arvument from Object constructorLars Knoll2013-09-023-3/+3
| | | | | Change-Id: I2c26bd8af9b352baed9b84a6b6401633ded4da85 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused variableLars Knoll2013-09-021-1/+0
| | | | | Change-Id: I163baea9105c6241a7d162a7e7468a70a29b3eaf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove unused constructorLars Knoll2013-09-022-12/+0
| | | | | Change-Id: Ibba688aea338c9f3deb33ae7488b7239ec9a485c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix some bugs in the code generatorLars Knoll2013-09-022-13/+30
| | | | | | | | | | | | | arguments can't be used as lvalue in strict mode. We however also threw an error in some cases where it was used as an rvalue, e.g. in (arguments < 10) the delete operator should throw a syntax error in strict mode on all unqualified variables Optimize the identifier() code a little: arguments and local variables inside eval do not need to be looked up by name. Change-Id: If3e9305187acf72820c5164aa9754927a2c4d5d5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add Value::isNullOrUndefined()Lars Knoll2013-09-022-3/+5
| | | | | | | Allows for some smaller optimization in the call stack. Change-Id: Id5beeb04e9f9dbf9e61280cee7bf6758a4c02310 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix incorrect implementation of Array.toString()Lars Knoll2013-09-021-1/+9
| | | | | | | | The spec says we need to call join with empty arguments if it's callable, otherwise fall back to Object.toString() Change-Id: I36aed164b60fad89b7d23b8a6993964c344a9ed3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* change calling convention for JS function callsLars Knoll2013-09-0249-385/+549
| | | | | | | | | | | | This allows faster pass through of the data if we have nested calls. Also make sure we always reserve at least QV4::Global::ReservedArgumentCount Values on the stack to avoid stack corruption. Change-Id: I42976460f1ef11a333d4adda70fba8daac66acf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* move methods to create a new context into the ExecutionContext classLars Knoll2013-09-026-36/+34
| | | | | | | | This avoids one indirection when calling the methods and cleans up the engine a bit. Change-Id: I426f41e23f6a7262af95b9807b00920530fef642 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a SimpleScriptFunction classLars Knoll2013-09-0210-37/+177
| | | | | | | | | Choose whether we use a stack based context for a function, when the actual closure is generated, not at call time. This speeds up function calling for leaf functions. Change-Id: Ibcbf3acb5610a7f59b6474e982122df03c1c5298 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move call context creation into the ExecutionContext classLars Knoll2013-09-025-70/+63
| | | | | Change-Id: Ie66a5892b0e5ab74bead1fcb59ffad5a867e0509 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Temporarily collect a map of all functions in the engineSimon Hausmann2013-09-027-1/+33
| | | | | | | | | | | | | | | | 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>
* Fix crashes when running tst_qqmlecmascript::importScripts with aggressive gcSimon Hausmann2013-09-022-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | In the case of imported JavaScript files, it may happen that we parse the JS once and then re-use it across different places where it is imported. That means we parse and compile the JS once, keep the QV4::Script around and call it as a function closure with different qml global objects (contexts), depending on where it is imported from. In this situation it is possible that the QV4::Script's run() is called once, a new function object is created, we call it to return the JS library to "eval" itself into the qml scope and afterwards it may happen that the function object is garbage collected. It is at this point possible that the compilation unit's refcount therefore also drops to zero, and thus subsequent calls to QV4::Script::run() that create new QQmlBinding objects will access a dangling compilationUnit pointer. This patch fixes that by making QV4::Script - which is holding a QV4::Function pointer - also have a persistent, which maintainers a refcount on the compilation unit. If the script dies, the persistent will get collected and the last deref will delete the unit. A script can however outlive the engine, but PersistentValue has the mechanism built in to free itself on engine destruction, which will also deref the unit accordingly. Change-Id: I0a7f4e64497bde423ffa55c705af55cdb7d29cf2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* New scenegraph renderer and atlas textures.Gunnar Sletta2013-09-0218-676/+4059
| | | | | | | | | | | | | The renderer tries to batch primitives together where possible, isolate non-changing subparts of the scene from changing subparts and retain vertexdata on the GPU as much as possible. Atlas textures are crucial in enabling batching. The renderer and atlas texture are described in detail in the doc page "Qt Quick Scene Graph Renderer". Change-Id: Ia476c7f0f42e1fc57a2cef528e93ee88cf8f7055 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix the header guard for the ARM unwinder helperThiago Macieira2013-09-021-2/+2
| | | | | | | | | Make it match the file name, instead of being exactly the same as the DWARF2 header. This way, it's possible for both headers to be included. Change-Id: I9a386d3203c8f1482d28b1d1074206cf354db33e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename the DW2 and ARM unwinder helpers to standard _p.hThiago Macieira2013-09-025-5/+5
| | | | | | | | | | 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>
* Fix bad cast from non-const QMap iterator to const_iteratorThiago Macieira2013-09-021-1/+1
| | | | | | | | | At that point in the ARM unwinder, the non-POD QMap global static (!) is not const, so QMap::lowerBound returns a regular iterator. Change-Id: Ia4dad7ee1a9cf593b0e1d273d193337fac7d9b69 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* wince: Build fix, assert() is not present in this platform.Sérgio Martins2013-08-293-5/+14
| | | | | Change-Id: Ib29f1411b9829bc9bf6a94e4fb23a33f955ee1b2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* wince: Build fix, disable the assembler when JIT is disabled.Sérgio Martins2013-08-298-16/+18
| | | | | Change-Id: Ibd22f27401c3751bc64749c6f1eea3aba57d66eb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Generate code for conversion to signed int32.Erik Verbruggen2013-08-295-21/+94
| | | | | Change-Id: I862a8c9c262b658859cc9b57ea0b6e9eb60e32e5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Generate code for conversion to boolean.Erik Verbruggen2013-08-293-5/+54
| | | | | Change-Id: I59e24264325b6560ee1c0dbdafacb1f08c3671d5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qmltest: Add QTestDefinedVariablesCaroline Chao2013-08-281-1/+10
| | | | | | | | | | | QTestDefinedVariables is used by the QTestRootObject to check is a preprocessor variable is defined. Adding QT_OPENGL_ES_2_ANGLE. It can be useful to know if it is defined (Win32 + Angle) while running a test. Change-Id: I2f9ffb1028c94095c711ab64737b53b60c055312 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* qmltest: Register test object as a singletonCaroline Chao2013-08-282-11/+29
| | | | | | Change-Id: I5f6c404ff2901082f22b953b29aed08d3488f31d Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* V4 regalloc: fix off-by-one in availability calculation.Erik Verbruggen2013-08-281-26/+10
| | | | | | | | | Simplified the algorithm, and use it to iterate over all registers. The previous version did not initialize bestReg correctly, thereby skipping the first register (which could also be the best one). Change-Id: I7e33f93a27e8fe64cd00acac755cf67ca5f0b1b8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 regalloc: do not overwrite register availability in hole.Erik Verbruggen2013-08-281-1/+1
| | | | | | | | | | | When a fixed interval for a register is inactive, the register is free until that interval becomes active, or (and this was missing), until another interval uses it before that position. So instead of blindly overwriting the freeUntilPos, take the qMin of the existing one with the intersection position. Change-Id: I2730a748ef1e46b4782fbb9814e800eca52172f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* wince: Build fix, abort() is not available on this platformSergio Martins2013-08-282-3/+3
| | | | | Change-Id: I0962f8b89de465d84d913b46ba482a538fe25495 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Generate code conversion to double.Erik Verbruggen2013-08-286-11/+94
| | | | | | | | 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>
* wince: Build fix, CONST conflicts with Windows macros.Sérgio Martins2013-08-282-2/+12
| | | | | | | | Don't #undef system macros in header files, they propagate quickly through other headers and make it very difficult to fix these problems. Change-Id: Id5efdfa69d0eefa8c740b14f839194039bd9752b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix unused variable warningKai Koehne2013-08-281-1/+1
| | | | | | | | Fix gcc warning: unused parameter ‘newEffect’ Change-Id: If4ca8058b5b637518a868947226c834d571f7037 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QQuickPlatformFileDialog: fix directoryEntered() signal connectionJ-P Nurmi2013-08-271-1/+1
| | | | | | Task-number: QTBUG-33008 Change-Id: I8c4d06bb9dded7b894ca576efd0a64dce9f9a720 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* The fast and the furious, register drift.Erik Verbruggen2013-08-2711-422/+1047
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* wince: vsnprintf is not available, use qvsnprintfSergio Martins2013-08-271-2/+3
| | | | | | | Change-Id: I42c87b2c319ce5b530ac5dc673edc99b067fafd7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
* Silence MinGW/gcc-4.8.1 compiler warnings.Friedemann Kleint2013-08-262-60/+69
| | | | | | | | | | | | | | | | | Reorder V4::Object's and V4::Value's private object inline functions such that its definitions are visible from where they are being referenced. qv4object_p.h:418:13: warning: 'uint QV4::Object::arrayLength() const' redeclared without dllimport attribute after being referenced with dll linkage qv4object_p.h:430:13: warning: 'void QV4::Object::setArrayLengthUnchecked(uint)' redeclared without dllimport attribute after being referenced with dll linkage Change-Id: I49a3c9d1da637eaf038f53b29ec13c35253de9f1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Interpreter fixes.Erik Verbruggen2013-08-261-7/+15
| | | | | | | | - Support constants in phi-nodes - Fix possible null-pointer dereference. Change-Id: I7cb773f1b4469d1cda648317670d9993d5b35ca3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Allow for function declarations inside conditionalsSimon Hausmann2013-08-232-32/+0
| | | | | | | | | This is strictly speaking a regression from 5.1/v8, which allows for that as real world JavaScript appears to require it. Task-number: QTBUG-33064 Change-Id: Iceaca84373f12fb08459ed007afb25b5a705fa31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Don't crash with deferred propertiesAlan Alpert2013-08-221-1/+1
| | | | | | | | | | | There are cases where a qmlExecuteDeferred(o) can be postponed until the context of o is being destroyed, at which point it's too late to create an object in that context. Task-number: QTBUG-33112 Change-Id: I7f981b5e34e3cb8a52c00de4742a7242d7e4df54 Reviewed-by: Christopher Adams <chris.adams@jollamobile.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* TestLib: Fix regression in error location outputCaroline Chao2013-08-221-6/+6
| | | | | | | | Error location returned should be given in the test file not in TestCase.qml. Change-Id: Ifea51fe5e39890a369c4dca6754abd46d2ee9bc2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup: Rename overloaded () operators of CodeGen to more descriptive ↵Simon Hausmann2013-08-224-7/+7
| | | | | | | function names Change-Id: I529c3d5c80ed7f703046a2803c492c4b15511049 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup: Separate JS environment scanner class declaration from definitionSimon Hausmann2013-08-222-306/+358
| | | | | | | This will allow the use of it from outside. Change-Id: Ia05a17b4b4f3e772554979e215a6252a75a63273 Reviewed-by: Lars Knoll <lars.knoll@digia.com>