aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4/qv4irbuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old v4 and rename v4vm to v4Simon Hausmann2013-04-291-1387/+0
| | | | | | | | For archeologists v4 can still be found in the history. Otherwise it is confusing to have both engines in the tree. Change-Id: Ice05afb7013f0fe536aab6bb19114f696c58fc94 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge branch 'stable' into devGunnar Sletta2013-01-171-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | | | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-041-2/+0
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/parser/qqmljskeywords_p.h sync.profile tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I9bc6659e1bab924009167bec567354d40a77a8cb
| * Declare QJSValue as a metatype where it is defined.Stephen Kelly2012-12-041-2/+0
| | | | | | | | | | | | | | Instead of in multiple different TUs, therefore causing ODR violations. Change-Id: I08d3624d3ed5a995e96488361665afa197fb9fc9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Added parsing for getter/setter definitions in property assignments.Erik Verbruggen2012-12-171-1/+13
|/ | | | | | | Specified in ecma 5.1, 11.1.5. Change-Id: I93d12593534ed8a987922c8aa329124940e77c6f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Refactor singleton type registration codeChris Adams2012-08-281-7/+5
| | | | | | | | | | | Previously each singleton type was registered as an implicit separate import. This commit changes the code so that these types are treated just like any other type in the registration sense. It also ensures that singleton types are instantiated per-engine. Change-Id: I5c81c4ca5bf65210f7125d74a62a282a21838068 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-271-6/+6
| | | | | | | | | | | | | When resolving property names, only properties known to the current context of execution should be available. If a property name has been overriden by a component extension, code executing in the context of the base component should resolve the property name to the property available inside the base component or its bases. Task-number: QTBUG-24891 Change-Id: I9687cc28e108226d5a939627a901c8254344b598 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-161-2/+2
| | | | | | | | | | Reduce memory consumption by storing source location coordinates as 16-bit variables (in run-time structures). Also modify qmlmin to restrict line lengths so that the column bound is not normally exceeded. Change-Id: I08605626ffbdf081b6da2aea1116bdfe24998572 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Add type name to singleton (module api) implementations.Glenn Watson2012-08-081-7/+7
| | | | | | | | | | | | | This change renames the previous module api implementation to singleton types. When a singleton type is registered, a type name must be provided that is used when accessing the API from QML. This makes the implementation more consistent with the rest of QML. Task-number: QTBUG-26549 Change-Id: Iab0bb1ccf516bd3ae20aee562a64d22976e0aecd Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-091-24/+13
| | | | | | | | | When a property referenced in a binding is not marked as final, do not automatically abort optimization. Instead generate both V4 and V8 binidngs, and only fall back to the V8 binding if necessary at run time. Change-Id: I1bcc7e2b495935c5d519a9a223f640c1972cdb4e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Store QQmlMetaObject in V4Aaron Kennedy2012-05-251-4/+4
| | | | | | | | | d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 caused a regression where V4 would not handle bindings as the meta object wasn't correctly stored in the IR. Change-Id: Id0af2175c15db69de9108060ff4901d0003de67b Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-24/+22
| | | | | | | | | | For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Enable binding to properties of type QJSValue.Andrew den Exter2012-05-241-0/+4
| | | | | | | | | This allows javascript objects of all types to be bound to properties declared in c++. Compared to a QVariant the primary benefit this offers is a type which functions and objects with functions can be bound to. Change-Id: Idb3313e7ff1d616ab12d44f616083c8296201f3a Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* QtQuick: Fix string related warnings, single character strings.Friedemann Kleint2012-05-141-5/+5
| | | | | | | | | - Fix warnings about truncation from size_t to int (MSVC 2010, 64bit). - Remove single character strings. Change-Id: Iaf4406e4e04d55d2d8b762f3433269868842a6f9 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Add support for variant properties in V4Matthew Vogt2012-04-161-2/+10
| | | | | | | | | | | Support initialization of variant properties in V4. Variants can be set to contain basic types in V4, but we can't extract data from them since they may contain data types that V4 does not comprehend. Task-number: QTBUG-25022 Change-Id: I1935d77b50c5a3481c4c8ddd86b9d3d970571217 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix constant folding for simple binary expressionRoberto Raggi2012-04-031-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change improves constant folding of numeric and string literals. Also, we go back generating quadruples instead of IR-tree-expressions. This is kind of needed to reduce register pressure in the V4 VM. That is, V4 has typed registers so before reusing a register we need to look at the type and eventually dispose its contents (e.g. when a QString or a QUrl is stored in the register). Unfortunately, we can't effort to have all these checks in the V4 instructions. So we change `binop' to generate literals (e.g. CONST or STRING) or a TEMP (aka a preassigned register that cannot be reused). For exmaple, the IR code generated for Rectangle { color: "b" + "l" + ("u" + "e") width: 10 + 20 + 30 } is ==================== line: 3 column: 10 L0x811ca10: t0 = string_to_color("blue"); return t0; ==================== line: 4 column: 10 L0x811ca50: return 60; Change-Id: I4d8482ddab9193d8469bda6461bfb2e5a3eeb197 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add floats to the high level IR type system.Roberto Raggi2012-04-031-0/+3
| | | | | Change-Id: If78870000eb72231e6eac67ec8a3d6441b5a4877 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Change V4 to explicitly use doubles to represent numbers.Roberto Raggi2012-04-031-9/+9
| | | | | | | Rename the V4 instructions to match the new type system. Change-Id: I640ab52c024a29179e816e29a12f0a36813d18c6 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add templated module api registration functionChris Adams2012-03-261-10/+10
| | | | | | | | | | | | | | | This commit adds a templated module api registration function which allows clients to provide type information at registration time. We use this typeinformation in V4 if available, in order to allow module APIs to be used in v4 bindings. This commit also clarifies the ownership semantics of QObject module apis, and updates some documentation references which were missed during the rename of Declarative to Qml. Task-number: QTBUG-24894 Change-Id: Iebb61ca8d8eacbb15218549eab715e22f52a1474 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Disable module api object support in v4.Michael Brasser2012-03-211-2/+2
| | | | | | | | | | We cannot create the module object during compilation as compilation may be done in a thread. Disable this optimization until additional type information can be known at compile time. Change-Id: I416ebf7595e2916a28f22fa8ebf512cbf3a8cde3 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix bug in v4 strict equality.Michael Brasser2012-03-151-12/+16
| | | | | Change-Id: I184065e0b7c8c6536f2081b9bf03e98992a4c9fe Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix AND expression in v4Luis Gabriel Lima2012-03-141-3/+9
| | | | | | | | | | | | | The type of the and expressions, e.g. (a && b), were being assigned to the type of the right hand expression (b). As reported in QTBUG-24660, this approach could lead to some unexpected behaviors. Now, when the left and right hand expressions are of different types, the responsability to deal with the and expression is delegated to v8. Task-number: QTBUG-24660 Change-Id: Ic42ebb035e62e2f197c337b2106d00453a99f04c Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Support module api objects in v4.Michael Brasser2012-03-141-0/+51
| | | | | Change-Id: I72911a2c8e0a8613e53861da7b38312e51bf57da Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix v4 nested object access bug.Michael Brasser2012-03-121-3/+4
| | | | | | | | | Use the correct type to look up the sub property. Task-number: QTBUG-24606 Change-Id: Iab372ca7440249241bf855d2875a947ad8fe4527 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Keep high-level intermediate representation for IR::BINOPs.Roberto Raggi2012-03-091-5/+7
| | | | | | | | | That is, keep binary expressions in HIR, this will make constant folding more effective. Also, the register allocator for expression-trees used in the V4 compiler will do a better job. Change-Id: I2d5eea08ecd9c8d6f3aa21f1fd674a691ef9e1b0 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove non explicitly typed IR::CONST() nodes.Roberto Raggi2012-03-091-5/+5
| | | | | | | | | This change ensures that IR::CONST expressions created by BasicBlock::BINOP(op,left,right) have the correct types. Change-Id: Iabac3f4ee1b897cc0d0bdf7e7385d7ae6dc513e4 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Correctly place '.' when building name for call expressions.Michael Brasser2012-03-071-1/+1
| | | | | Change-Id: Ic0119a0f4c02387ed19e2905f0b24c4ce86565cb Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-3/+6
| | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+1303
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>