aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompiler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove old compiler and VMESimon Hausmann2014-03-071-3922/+0
| | | | | | | | | | | | This removes the bulk of the code. A few smaller cleanups remain, to be done in smaller changes as they move code around. Additionally the "optimize" option of qqmlbundle was removed. It called QQmlScript::Parser::preparseData, which however was not implemented and always returned an empty QByteArray. Therefore "optimize" would not do anything and the class is gone now :) Change-Id: I0c265e756704cb53c5250be1f69e4a3e1b6e64d5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a column to the default method error messageSimon Hausmann2014-03-021-0/+1
| | | | | | | | This brings both compilers in sync by reporting line and column if doing a signal object assignment without a default method. Change-Id: I8b1bf90c4ce3cd7b117ad7eecdbfe319b07b1191 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Compile functions and bindings in appropriate scopesSimon Hausmann2014-03-021-2/+6
| | | | | | | This enables accelerated property access also for this code path. Change-Id: Iafb177b1fe7878e6c54cfb258f2e8d8ea32aa59e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Clean up our internal namespacesLars Knoll2014-02-231-138/+138
| | | | | | | | QQmlJS::MASM -> QV4::JIT QQmlJS::V4IR -> QV4::IR Change-Id: I707e8990459114a699c200fe3c22cec3c8df1afc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* [new compiler] Fix error reporting null object group property accessSimon Hausmann2014-02-181-0/+1
| | | | | | | | The new code path reported line and column, the latter was missing from the old code path and is easily added. Change-Id: I730e56f0fe4e99091dfb10e5f601faf1d3b8949c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* [new compiler] Fix error message when assigning lists to singular propertiesSimon Hausmann2014-02-031-1/+1
| | | | | | | | Also adjust the error message for the other compiler when trying to assign lists to script strings. Change-Id: I50f833c340f3634a59c5b36f30aeafc53003e65e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Report errors when trying to bind to read-only propertiesSimon Hausmann2014-01-281-1/+1
| | | | | | | | | | | The only exception are initializers for read-only property declarations. Also adjusted the error location of one test to point to the correct value location as opposed to the property location, as with all the other similar errors. Change-Id: I2333d3c485fc374b1b39a5f5a4408af5cf08a20f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Improved error handling for namespaced property bindingsSimon Hausmann2014-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A binding with a qualified name that starts with a name space, must be followed by a type. For example MyNamespace.someThing.foo: 100 is not valid, something must be a valid type name and therefore start with an upper case letter. Similarly an object declaration like this: MyNamespace.something { ... } is not valid neither. The current compiler reported the latter as "Expected type" and the former as "Invalid attached property name". The message for the latter is not very good, because we know that "MyNamespace" is a namespace and therefore "something" cannot be a attached property name, it must be the attached property type first. In the new compiler this hits the same code path and thus the same error message. So this patch introduces the correct error message in the new compiler, adjusts it for attached properties in the old one and adjusts the test that now passes with both. Change-Id: I51c265a2acb80079c1dd62ef5ef77d5ff07d3ac1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-01-241-0/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/dialogs/qquickmessagedialog.cpp src/imports/dialogs/qquickmessagedialog_p.h src/qml/debugger/qqmlprofilerservice_p.h src/qml/jsruntime/qv4regexpobject.cpp tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
| * Parse source location for signal handling functionsUlf Hermann2014-01-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | Previously the source location of signal handlers was always line 0 and column 0. This poses problems when trying to extract meaningful profiling information. The change assigns the source location of the statement declaring the function as the function's source location. Task-number: QTCREATORBUG-11100 Change-Id: I4bb8682b35147a7cfe4ecec342d4a00623bb1e0d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | fix whitespaceOswald Buddenhagen2014-01-221-36/+36
| | | | | | | | | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | [new compiler] Add support for QML list modelsSimon Hausmann2014-01-201-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | List model definitions make heavy use of custom parsers, which requires AST access as well as a general port to the new QQmlCustomParser API. Additional fixes in the custom parser support were needed to pass all tests: * Fix support for AcceptsSignalHandlers and AcceptsAttachedProperties * Don't call setCustomData unless the compiler generated data earlier Change-Id: Ic42f8a890391267c94f63d35f055b60fdbf3c83d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [new compiler] Add support for type and enum resolution for custom parsersSimon Hausmann2014-01-171-29/+21
| | | | | | | | | | | | | | | | | | This is in preparation for listmodel support, share the code for resolving types and enums between the old and the new compiler, as all it needs is the imports. Change-Id: I4908d71eee50c769108e0e2b68b03496722fa49d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-061-1/+4
|\| | | | | | | Change-Id: If9a205bea219b9aca95d78b1e556ca9bbff58dd0
| * Fix property access to QQmlPropertyMap objects when addressed via idSimon Hausmann2014-01-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Property access to id objects is optimized at compile time, but we cannot do that for QQmlPropertyMap instances (or generally fully dynamic types). This issue was a regression against Qt 5.1 Task-number: QTBUG-35906 Change-Id: I759a1a899f6a3a1f6466282f455b289ad7451086 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Change C++ parameter type used for var parameters in QML declared signalsSimon Hausmann2013-12-241-1/+1
|/ | | | | | | | | | | | | | "signal someSignal(var foo)" mapped to foo being of type QVariant. Unfortunately that is a "lossy" type and it cannot represent all JavaScript values, including for example function closures (as reported in the JIRA bug). Instead we should use QJSValue. It is an important behavioural change because it affects the presumably rare case of somebody declaring a signal in QML with such a parameter and connect to it from C++ (or trying to emit it) - in that situation the code needs to be changed. Task-number: QTBUG-35171 Change-Id: I4fb4a18b407e4ea6c28a3a297fc6f76edb76d734 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-121-1/+1
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlcompiler.cpp Change-Id: I802731139d47c5b733dd805f7bf432d67d7331e1
| * Revert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614"Alan Alpert2013-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit 27052dcad9810869a9065da4c06e9f14379411d7. While the additional flexibility would be nice, I've been reminded that we already did commit to it back in July. Change-Id: Iaf990dda98ee46eb028b4737bdeeafd050d9513f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Fix broken Maroon game / regression in PropertyChanges {} elementSimon Hausmann2013-12-101-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the expressions in PropertyChanges {} introduced a regression in where the evaluation context was incorrect and thus bindings would not be able to access the correct properties. For example PropertyChanges { target: someObject y: height / 2 } Here height should be looked up in the context of "someObject", not of the PropertyChanges element. This patch introduces an auto-test that verifies that the lookup context is correct and fixes the bug by disabling accelerated compile time property lookups for binding expressions that are requested from a custom parser. Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix dynamic properties in QQmlPropertyMap not always being visible in QMLSimon Hausmann2013-12-051-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQmlPropertyMap is a fully dynamic class that can add properties at any point in time. In order for these properties to be visible inside QML, we must disable the property cache (instead of trying to unsuccessfully re-fresh it). What happened in this particular case is that the QQmlPropertyMap derived type was instantiated and the VME instruction for creating it would also assign the property cache the compiler determined. There's no way for QQmlPropertyMap itself to access this property cache instance (stored in output->types[id].typePropertyCache) or invalidate it, so instead don't use the compiler's property cache when instantiating the type. This patch also disallows the adding properties to QQmlPropertyMap when it is used as base type for a new QML type, as we cannot provide the derived type to the QQmlPropertyMap constructor - this is only possible in C++. Task-number: QTBUG-35233 Change-Id: I7fa9e4a2224ccfdd7ccb3fd9f73919ecd46058a8 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove unused memberLars Knoll2013-12-041-1/+1
| | | | | | | | | | Change-Id: I9926f1ab10ea04387f17794944dcc11f4a2a9054 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add support pre-compiled bindings for QML custom parsersSimon Hausmann2013-11-291-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example the x property in PropertyChanges { target: foo x: someItem.x - other.width / 2 } was compiled at run-time dynamically, which produces slower code (no type information available) and slows down the type instantiation, because the compilation happens every time at instantiation time (or later). With this change, when the custom parser behind PropertyChanges requests a binding ID for "x", the right hand side will be added to the bindings to compile, then compiled and later at run-time the QQmlBinding constructor that takes a QQmlBinding::Identifier can retrieve the correct compiled function from the QV4::CompiledData::CompilationUnit. Change-Id: I857fb2d39e82714b225bc9394b9904b795c6662b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'release' of ssh://codereview.qt-project.org/qt/qtdeclarative ↵Simon Hausmann2013-11-261-4/+2
|\| | | | | | | | | | | into stable Change-Id: I0bf06be69927d5961f1bdb4948c3572ef6111923
| * Fix memory corruption in QML expression compilationSimon Hausmann2013-11-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We store QQmlPropertyData pointers in our IR for Qt meta-object property resolution at compile time. As it turns out however, it is possible that these pointers change after retrieval from the QQmlPropertyCache, as the cache may change later in the compilation process. Therefore we must do what also QQmlCompiler does by storing a copy of the QQmlPropertyData. For the JS IR we can do that conveniently through the IR memory pool. A side-effect of this bug was that QQmlPropertyData pointers were re-used and so the identity check in the isel later such as _function->contextObjectDependencies.contains(m->property) for dependency tracking failed. In the example given in the bug report it was determined that the window.contentWidth property wouldn't need a property capture, and therefore the binding was not re-evaluated as window.contentWidth later in the binding evaluation phase received its correct value. This patch also fixes the incorrect debug output names assigned to JS binding expressions, where the index used to look up the name is per compiled object, not per QML component. Task-number: QTBUG-35063 Change-Id: I3e5bbfaac11e5c122a2ed15a3e486a93988e1b6e Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Improve type interference for QObject propertiesSimon Hausmann2013-11-251-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | Propagate QObject properties in member expressions across temporaries as part of the type interference SSA pass. This replaces the earlier attempt to resolving QObject properties in fieldMemberExpression() in the codegen, but it was incomplete and now things like the following are fully resolved: var tmp = blah.somePropertyThatReturnsAQQuickItem; <-- QQuickItem property return type propagated into tmp var width = tmp.width; <-- and picked up here again to resolve the index of width instead of by name With this patch Temp gets a helper structure with a function pointer, initialized to aid the resolution of properties in Qt meta objects. This structure is propagated into the temps until it reaches the next member expression that uses the temp. Similarly QObjectType is added as IR type, next to VarType. The resolution inside the SSA type interference pass also requires passing through the QQmlEngine from the upper caller levels, in order to resolve the property type to a potential QMetaObject property. Change-Id: I14c98fa455db57603da46613ce49c174d0944291 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix failing assertion when trying to assign to an id referenced QML objectSimon Hausmann2013-11-191-0/+5
| | | | | | | | | | References to id addressed QML objects are member expressions, which are unlike other member expressions by not being lvalues. Handle this correctly. Task-Number: QTBUG-34890 Change-Id: Ied6230edbc561128ad36bf0d1a1918185204deec Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614Alan Alpert2013-11-131-1/+1
| | | | | | | | | Making it public right now seems a little premature, given all the work happening on the engine now (and for 5.3). We'll be in a better position to commit to it or not next release. Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2bbbb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix a few more compiler warnings in release buildsLars Knoll2013-11-091-4/+2
| | | | | Change-Id: I826226b7ddd4a74037b5bbe9a4a7322d404f53a9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Improve debugging of QML expressionsSimon Hausmann2013-11-011-1/+4
| | | | | | | | Add the name of the property to the generated IR function ("expression for x") to make it easier to debug. Change-Id: If35f42764774e6d7f40d3bf080e1fbdb12321ed5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Resolve member expressions of QObject membersSimon Hausmann2013-10-311-1/+2
| | | | | | | | | | | | ...when the base is a QObject property itself or an ID referenced object. This patch resolves for example the width property in a parent.width expression to be a per-index lookup at run-time. That requires the base ("parent") however to be a final property or come from an object where expected revision is known, i.e. a QML imported object (scope or context). Change-Id: Iaa1f57ace452da5e059c1d4e63b52b316e1a6b08 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Initial support for resolving meta-property access for the scope and context ↵Simon Hausmann2013-10-311-24/+36
| | | | | | | | | | | | | | | | | objects at QML compile time This avoids having to do a string lookup for ids and in the import cache at run-time, before we can do a string hash lookup in the property cache. Instead we resolve final properties in the context and scope object at compile time and look them up at run-time using their index instead. The dependencies to these properties are also tracked separately and recorded in the compiled data. This is merely the initial patch. There's a lot left to do, such as having specialized getter and setters for specific property types. Setters are missing altogether right now and will fall back to name lookup. Change-Id: If3cb4e7c9454ef4850a615f0935b311c9395b165 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup QML specific JS code generatorSimon Hausmann2013-10-291-4/+3
| | | | | | | | Move parameters global to the entire QML file to the constructor, pass component/context specific parameters to the generate function. Change-Id: I6c3ab41b3bab19b066bbe20f971c5cafaeb70b98 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Speed up id object lookupsSimon Hausmann2013-10-291-1/+15
| | | | | | | | | | | | | | | | | We can resolve lookups for objects referenced by id at QML compile time and use a run-time helper to extract the id object out of the QML context data by index instead of name. Dependencies to id objects are also tracked at compile time and registered separately before entering the generated function code. The lookup of id objects is encoded in the IR as special member lookups. Members will also then in the future be used to for property lookups in context and scope properties, as well as any other property lookups in QObjects where we can determine the meta-object. Change-Id: I36cf3ceb11b51a983da6cad5b61c3bf574acc20a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4 debugger: retrieve formals and locals.Erik Verbruggen2013-10-241-1/+1
| | | | | Change-Id: I47507a4d7d1b429b9c43ed3a7822079efe577327 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Qml JavaScript code generation cleanupsSimon Hausmann2013-10-201-68/+49
| | | | | | | | | | | | | | | * Run the binding expressions, functions and signal handlers through the V4 codegen _per_ component, and run the isel at the end for the entire file. We need to do per-component codegen because we want to set up the correct id and object scopes, which are different for the root component and anonymous components. * Changed V4IR::Module to allow for the concept of "qml modules" where there is no root function defined. This is a logical consequence of running v4 codegen multiple times with different input but the same V4IR::Module. Change-Id: Ib3a719f83507cbab7c2e4e145ccad5b663c795cf Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Compile signal handler expressions in the loader threadSimon Hausmann2013-10-111-2/+56
| | | | | | | | | 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-111-19/+16
| | | | | | | | ...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-111-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Improve error location reporting for invalid aliases in old VMESimon Hausmann2013-09-301-1/+1
| | | | | | | | | When an alias declaration is missing a location, report the error with the location of the alias declaration, not the object declaration. This matches the code patch in the new compiler, which also reports it accurately. Change-Id: I709dbddb3273f4e05cc4d63079da52d7224466bd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add Singleton support for QMLAntti Piira2013-09-211-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces Singleton support for QML (Composite Singleton). For now, the Singleton support is only availabe for QML types in modules or (remote and local) directories with qmldir file. However, in the future this support may be expanded to arbitrary QML file imports without by leaving out the qmldir requirement. You define a QML type as a Singleton with the following two steps: 1. By adding a pragma Singleton to a type's QML file: pragma Singleton The pragma and import statements can be mixed and their order does not matter. Singleton is the only supported pragma for now. Others will generate errors. 2. By specifying a qmldir file for the directory of your imported type and prepending the type with "singleton" keyword as follows: singleton TestTypeSingleton TestTypeSingleton.qml Alternatively you may specify a qmldir file for a module and specify your type as a singleton as follows: singleton TestTypeSingleton 1.0 TestTypeSingleton.qml Composite Singletons may be included in a module and may be used with a local namespace qualifier when imported with: "import xxx as NameSpace" A singleton instance is created at first use and stored into the QmlEngine (one instance per engine) and eventually released by the engine's destructor. CompositeSingletonType has a dual nature and will return true to both isComposite() and isSingleton() calls. In most cases its enough to check for just isComposite() or isSingleton(). However, there is a isCompositeSingleton() available as well. I used "qlalr --no-debug --no-lines --qt qqmljs.g" to generate the qqmljsparser and qqmljsgrammar files from qqmljs.g. Unit tests are included. Change-Id: I91b303612c5e132143b325b9a8f982e9355bc90e Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Make QQmlAbstractUrlInterceptor publicAlan Alpert2013-09-191-1/+1
| | | | | | | | | | | A supporting class for file selectors and qml import control, it allows redirecting local file paths (use a QNAM for remote paths). All work was done previously for Qt 5.1, including tests. This is just making it public for Qt 5.2. Change-Id: Icb319cc23200541c8e4088b2d400e9af94f3eee5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-061-1/+3
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv8debugservice.cpp src/qml/qml/v8/qv8engine.cpp tests/auto/quick/qquickitem/qquickitem.pro Change-Id: Ic4a1dcdd8b8a84155d2f2abefdf1da5c3a56af31
| * Fix crash when trying to set versioned group propertiesSimon Hausmann2013-08-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | If a property isn't available due to revisioning, we print an error message. Producing the error message should be done with care of obj->type being -1 to avoid out-of-bounds on the output->types array. Task-number: QTBUG-33179 Change-Id: I7bd420f2dfa0ca2d616340a68999d58022974435 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Fix regression in tst_qqmlecmascript::signalAssignmentSimon Hausmann2013-07-051-0/+6
| | | | | | | | | | | | | | | | | | | | Detect errors in the signal declaration already at compile time, re-introducing the earlier code in qqmlcompiler.cpp that checked that. This also means that the parameter string construction can be done once for each signal and not for each handler. Change-Id: Icf6242a793939466bbc44d43bf041281164ad1b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Get rid of the signal expression rewriterSimon Hausmann2013-07-031-26/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the entire rewriter with more or less: expressionToEval = "(function(<named params here>) { " + expr + " } )" This also fixes crashes at run-time when the signal rewriter was executed from the loader thread and tried to use a v4 identifier hash with the same engine that's also in the main thread. Change-Id: Ib1e4927d330706a593411fbff64ed3da1e23d0e0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Replace us of v4 identifiers for object id mapping in qml compilerSimon Hausmann2013-07-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The compiler is executed in a separate thread, at which point it doesn't work very well to access the identifiers data structures of the engine on the main thread, allocate new strings and potentially also trigger GC. This patch moves the data into an intermediate QVector and constructs the identifier hash on the receiving end in QQmlContextData::setIdPropertyData. Change-Id: I676cf633cf1c55ee2e8f818e6963368ad55913cd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Convert QV8Engine::illegalNames() to use the identifier hashLars Knoll2013-06-281-5/+5
| | | | | | | | | | Change-Id: I436c2a17e417cb311f10290a4cc6e5b728b4b7be Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert IdentifierHash to be template basedLars Knoll2013-06-281-1/+1
| | | | | | | | | | | | | | | | | | Make it a template based class, so we can store more then just integers here and replace more StringHash'es with it. Change-Id: I21442d13c6260f184bc7b63a8a58e826699f0c83 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of QQmlIntegerCacheLars Knoll2013-06-281-3/+3
| | | | | | | | | | | | | | Replace by the new IdentifierIntHash. Change-Id: Ib210cd898a30ad3e2f9349387e1a74d92ed5f831 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-0/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9