aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4/qv4compiler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old v4 and rename v4vm to v4Simon Hausmann2013-04-291-1580/+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>
* 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>
* 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>
* 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>
* Evaluate bindings more intelligently during constructionAaron Kennedy2012-08-291-8/+9
| | | | | | | | | | | | | | | | | Instead of just evaluating bindings in a fixed order, and possibly having to evaluate a single binding multiple times, prior to reading a property, we check if there are any bindings "pending" on it and evaluate them then. A pending binding is one that has been assigned to the property, but not yet evaluated. To minimize side effects we only do this for "safe" bindings. A safe binding is one that has no side effects, which we currently define as not calling functions or otherwise assigning values during its evaluation. This isn't an entirely foolproof way to ensure that the evaluation has no side effects, but it should be good enough. Change-Id: I98aa76a95719e5d182e8941738d64f8d409f404a Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Refactor singleton type registration codeChris Adams2012-08-281-5/+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>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-161-5/+5
| | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | 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-3/+5
| | | | | | | | | 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>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-1/+1
| | | | | | | | | | 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/+22
| | | | | | | | | 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-1/+1
| | | | | | | | | - 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 var properties in V4Matthew Vogt2012-04-241-0/+18
| | | | | | | | | | | | Support initialization of var properties in V4. Var properties, which can only be manipulated by V8, are constructed directly into the form in which they will be stored. Task-number: QTBUG-25022 Change-Id: I27c6af9f8a310e7baec91bef2593c8518ec1e462 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Add support for variant properties in V4Matthew Vogt2012-04-161-0/+21
| | | | | | | | | | | 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>
* Remove sharing of V4 subscriptionsRoberto Raggi2012-04-041-12/+17
| | | | | | | | | Unfortunately, sharing subscriptions doesn't play nice with the linked lists we maintain to observe QML bindings. Change-Id: I8ab351987138caf8fa7fbdeff4dbf2b34184a05c Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Remove obsolete codeRoberto Raggi2012-04-041-31/+1
| | | | | Change-Id: I5812990703c4339018af4327cd7b44199a1705fd Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add Throw instruction to the V4 virtual machineRoberto Raggi2012-04-031-1/+25
| | | | | | | | Also, throw an exception when trying to assign something that is not a QUrl or a QString to a QUrl. Change-Id: Ic48fd519c8318d391706ebca1955a5dd2ef6e80e Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix constant folding for simple binary expressionRoberto Raggi2012-04-031-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 support for floating conversions.Roberto Raggi2012-04-031-9/+26
| | | | | Change-Id: I4feee2a3c5fcfa32b89859ddbfe17e6163983ab9 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Change V4 to explicitly use doubles to represent numbers.Roberto Raggi2012-04-031-63/+63
| | | | | | | Rename the V4 instructions to match the new type system. Change-Id: I640ab52c024a29179e816e29a12f0a36813d18c6 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix crash in QUrl-to-int conversion in v4Chris Adams2012-03-301-3/+2
| | | | | | | | | | Also adds various unit tests for other conversion operations. Note that many of the conversion operations produce the wrong results, and have been marked with QTBUG-24706. Task-number: QTBUG-24706 Change-Id: Id96a7409e31f2e889dce6b501247f58b59fa6a98 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Use metaObjectForType in the v4 compiler.Michael Brasser2012-03-301-1/+1
| | | | | | | Match usage in the v4 IR builder. Change-Id: Ibc69a01d3948ab3ad0ed5c656e99b13a7edda8fc Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Always enable value type support in v4.Michael Brasser2012-03-201-4/+0
| | | | | Change-Id: Ifb4e44aa6d2f13c79319d03e0fd7a4c0c3db06d8 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Support null -> QObject and QObject -> bool conversions in v4.Michael Brasser2012-03-201-0/+6
| | | | | Change-Id: I66602bf52986a388f9b6fe2bcd4630b862138906 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix bug in v4 strict equality.Michael Brasser2012-03-151-1/+15
| | | | | Change-Id: I184065e0b7c8c6536f2081b9bf03e98992a4c9fe Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Support module api objects in v4.Michael Brasser2012-03-141-0/+16
| | | | | Change-Id: I72911a2c8e0a8613e53861da7b38312e51bf57da Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Add two argument Math.min and Math.max support to v4.Michael Brasser2012-03-121-0/+34
| | | | | Change-Id: I26a4812b76571bf0ae6a0b4bd5d1e2afd64051df Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Add Math.ceil and Math.abs support to v4.Michael Brasser2012-03-121-0/+12
| | | | | Change-Id: I23e7c8294abf80914d4529740af6e9124f66c5bf Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Keep high-level intermediate representation for IR::BINOPs.Roberto Raggi2012-03-091-19/+10
| | | | | | | | | 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>
* Merge master <-> api_changesMatthew Vogt2012-03-051-2/+23
| | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+1399
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>