aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qv8qobjectwrapper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QDeclarativeExpression: storing column number in expression locationChristiaan Janssen2012-01-161-1/+2
| | | | | Change-Id: I2d69738158abfc76f80b1cfc0e0ccb145fda2245 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Handle exceptions inside QV8QObjectConnectionList::qt_metacallChris Adams2011-12-291-0/+12
| | | | | | | | | Previously, exceptions were not handled in the connectionlist. This could cause v8 to assert under certain circumstances. Task-number: QTBUG-23375 Change-Id: Ie5f043b50bb6b02a77be464ca18ea8e3bbb0f501 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Introduce more generic fast property handlingAaron Kennedy2011-12-051-183/+212
| | | | | | | Also reduce the number of direct calls to qt_metacall(). Change-Id: I04cd6e516a3e61058548309a19fe0b830f15c93f Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Ensure connection lists get cleanedAaron Kennedy2011-11-091-0/+2
| | | | | | Task-number: QTBUG-21368 Change-Id: I2cdecc984edb76a5fb1417cfdb29ffe6b90b0993 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Include correct line number when throwing an exception from a slotAaron Kennedy2011-11-081-1/+2
| | | | | | Task-number: QTBUG-20344 Change-Id: I25be1520b55ce13d4e1c75e06effa1dee8530a7a Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Skip the captured properties step in bindingsAaron Kennedy2011-11-041-13/+7
| | | | | | | | | | Objects and notifiers in the capturedProperties list were not guarded which can lead to crashes if they're deleted prior to the binding completing. Now the notifiers are connected to and guarded immediately to prevent this. Change-Id: I912e323c52bf6169fb5077e552d5d38d9aa7faec Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Add support for more sequence typesChris Adams2011-11-021-5/+15
| | | | | | | | | | | | | | | | | | | | | | | This commit adds support for more sequence types by adding a sequence wrapper. This class enables conversion between v8::Array and C++ sequences of various types (currently just QList<int>, QList<qreal>, QList<bool>, QList<QString>, QList<QUrl> and QStringList), but more types can be added later if required). When a JavaScript object is created from such a sequence, its prototype object is set to the v8::Array prototype object. The indexed setter, indexed getter, length and toString methods are implemented directly or in terms of the underlying sequence resource. Note that currently, sequences of ValueTypes are NOT supported, due to the fact that operations like: someObj.someValueTypeSequence[i].x = 5; would not behave as required. Task-number: QTBUG-20826 Task-number: QTBUG-21770 Change-Id: I36deb448fb0e87a32084a900e70a2604ff369309 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Declarative: Fix gcc 4.6 warnings about assigned/unused variables.Friedemann Kleint2011-11-011-1/+0
| | | | | | Change-Id: Iac4bb4a6b1aa4071a239bb25f25f01b71e36868b Reviewed-by: Alexis Menard <alexis.menard@openbossa.org> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Rename QDeclarativePropertyCache::Data to QDeclarativePropertyDataAaron Kennedy2011-10-261-23/+23
| | | | | | | This class is now too large to be nicely nested. Change-Id: I32cfa5caa524b8bf447d1f8c53ef2763f60bdac1 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Cache QObject method argumentsAaron Kennedy2011-10-251-79/+50
| | | | | | | | This more than doubles the performance of invoking simple QObject methods with parameters - such as myFunction(int,int) - multiple times. Change-Id: I4bf21fb3980b09aedf0f440a246682c418933a65 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Merge PropertyCache::Data and ValueTypeDataAaron Kennedy2011-10-171-2/+1
| | | | | Change-Id: I22cbb159d009151dd77ecbcdad16f27ecb9d6dba Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Add JavaScript "var" property type to QMLChris Adams2011-10-061-0/+5
| | | | | | | | | | | This commit adds a new syntax which allows "var" type properties which can have JavaScript objects (as well as other basic types) assigned to them. Such JavaScript objects cannot be bound to. Task-number: QMLNG-18 Change-Id: If7f5045f4669e0d5c1b8d0891ed765128d0bc1c6 Reviewed-on: http://codereview.qt-project.org/1466 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Asynchronous component instantiationAaron Kennedy2011-09-291-0/+3
| | | | | | | | | | | | | This introduces two main: * the QML compiler executes in a separate thread * item instantiation can be interrupted and resumed to allow it to be split across multiple frames. Task-number: QTBUG-21151 Change-Id: I9631c62bb77da3a2e0c37f0da3719533fdce4fef Reviewed-on: http://codereview.qt-project.org/5676 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Build with qt-in-namespaceKent Hansen2011-09-281-2/+5
| | | | | | | | Change-Id: Ia57e4f14d94ad63194dad52892bedf316a58a79a Reviewed-on: http://codereview.qt-project.org/5693 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix potential memory corruption.Jędrzej Nowacki2011-09-151-1/+17
| | | | | | | | | | | | | The code exploited information that most of types in union use d pointers and that size of d pointer is less or equals then sizeof(QVariant) or sizeof(double). Still the code may suffer from an alignment issue on some exotic platforms. Change-Id: I4ef331f4cdb7177337ddcc8696f78d85e9594d27 Reviewed-on: http://codereview.qt-project.org/4244 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Merge branch 'master' into refactorGunnar Sletta2011-09-121-10/+47
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/declarative/cppextensions/qwidgets/qwidgets.pro examples/declarative/minehunt/main.cpp examples/declarative/minehunt/minehunt.pro src/declarative/items/context2d/qsgcontext2d.cpp src/declarative/items/qsgflickable.cpp src/declarative/items/qsgtextedit.cpp src/declarative/items/qsgtextinput.cpp src/declarative/particles/qsgangleddirection.cpp src/declarative/particles/qsgcumulativedirection.cpp src/declarative/particles/qsgcumulativedirection_p.h src/declarative/particles/qsgfollowemitter.cpp src/declarative/particles/qsgmodelparticle.cpp src/declarative/particles/qsgparticlesystem.cpp src/qtquick1/util/qdeclarativeview.h tests/auto/declarative/examples/examples.pro tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp Change-Id: Ib4be2a5e742dee1a399d73da97161736f77448e5
| * Allow reference to signals using 'on' handler syntax.Michael Brasser2011-09-011-10/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | This will allow APIs like the following: trigger: mouseArea.onClicked However, signal handlers will not be callable from QML: mouseArea.onClicked() //throws exception Change-Id: I2ef5cb4e1f3ed4814ef590962391e1b14e3f0c43 Reviewed-on: http://codereview.qt.nokia.com/3683 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* | Fix export symbols for QtDeclarative and QtQuick1.Friedemann Kleint2011-08-311-1/+2
|/ | | | | | | | | | | Fix build on Windows and compiler warnings. Requires 090ee21eac7257644422e35395194e5fd7fb8efa in qtbase. Change-Id: Ief8da504ccd3e2c2e78644cc9943d685c4302019 Reviewed-on: http://codereview.qt.nokia.com/3988 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* More efficient type name cacheAaron Kennedy2011-08-301-8/+14
| | | | | | | | | | Instead of creating completely separate hashes for all the types used by every QML file, we simply link to the QDeclarativeTypeModule. This uses much less memory, and is faster to construct at startup. Change-Id: I28bc2807074f9c6f38096d6e4ce8be744159d023 Reviewed-on: http://codereview.qt.nokia.com/3741 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Don't enumerate Function.prototype.{connect,disconnect}Kent Hansen2011-08-261-2/+2
| | | | | | | | | | | | | | | QML/JS adds connect and disconnect methods to the standard Function.prototype object. Follow the convention of ECMA-262: Function properties should be non-enumerable. In particular, we don't want such built-in properties to show up in user code "for-in" statements. Task-number: QTBUG-21120 Change-Id: I416106badf35daddf32e16f757d37b2b09e58310 Reviewed-on: http://codereview.qt.nokia.com/3587 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Guard QML-specific handling of value type property accessKent Hansen2011-08-111-2/+4
| | | | | | | | | | | | When using QJSEngine, there is no QDeclarativeEngine associated with the QV8Engine, so check if it's there first. This was causing the QJS qobject bindings autotest to crash. Change-Id: If2c1d414d615bfbe93580d06555f5c17b0e41eef Reviewed-on: http://codereview.qt.nokia.com/2845 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix outdated license headers.Jason McDonald2011-08-051-17/+17
| | | | | | | Change-Id: I81fd41433b03b13befe0b5c68ec248ea71e8c235 Reviewed-on: http://codereview.qt.nokia.com/2596 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Ensure that the prototype chain is checked in property GetChris Adams2011-08-021-2/+2
| | | | | | | | | | | | | | This commit ensures that the prototype chain is checked during property Get operations on QObjects and other types in QML by returning an empty handle from the property Get interceptor if no valid property with the given name is found. Task-number: QTBUG-20336 Change-Id: I670ee211c74c0fdcb68c3f91b29fcc0ea8b55d6f Reviewed-on: http://codereview.qt.nokia.com/1477 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Merge the QJSEngine and QJSValue development branch into master.Simon Hausmann2011-07-291-16/+20
| | | | | | | | | | | | This replaces the dependency to QtScript with two new builtin classes QJSValue and QJSEngine. This is still work in progress, development continues now in the master branch. Change-Id: I7f5487feb45c972f25a22b10cc81b9218b9805de Reviewed-on: http://codereview.qt.nokia.com/2299 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Fix alias warnings in QV8QObjectWrapperAaron Kennedy2011-07-291-51/+68
| | | | | | | | Task-number: QTBUG-19736 QTBUG-19693 Change-Id: I4f6c56dc4f60224dd79e669099c198b883429f54 Reviewed-on: http://codereview.qt.nokia.com/2363 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow object to be accessed by multiple QDeclarativeEnginesAaron Kennedy2011-07-251-1/+1
| | | | | | | | | Task-number: QTBUG-18610 Change-Id: Idd9444018b5344586d6579ddac6a0ffd26bf7139 Reviewed-on: http://codereview.qt.nokia.com/2075 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Compile fix.Kim Motoyoshi Kalland2011-07-211-1/+1
| | | | | | | Change-Id: Ie6e1f814b6791ddc2b02a845ebd8bc20765f7193 Reviewed-on: http://codereview.qt.nokia.com/1941 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Optimize QDeclarativePropertyCacheAaron Kennedy2011-07-041-5/+5
| | | | | | | | | The creation of QDeclarativePropertyCaches contributes significantly to the initial compile time of a QML app. Change-Id: Iac5d1578155dfa4678a0e21eab51f4c1675762a9 Reviewed-on: http://codereview.qt.nokia.com/1026 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Don't exceed SMI boundsAaron Kennedy2011-07-041-7/+7
| | | | | | | | | | If we use an integer that is greater than the maximum SMI value on 32-bit systems (like ARM), v8 allocates the integer as a HeapNumber which is unbelievably slower. Change-Id: I518b5947627631a2621344b656afa0dde002fe82 Reviewed-on: http://codereview.qt.nokia.com/1025 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Correct handling of CONSTANT propertiesAaron Kennedy2011-06-151-1/+1
| | | | Were being marked as missing a notifier instead.
* Performance improvementsAaron Kennedy2011-06-141-30/+118
| | | | | | | | | | | | There are two main changes here. First, where possible, we mark properties as "IsDirect" which means that they exist in a C++ QMetaObject (as opposed to a dynamic meta object), which allows us to call QObject::qt_metacall() directly, bypassing any dynamic meta object stuff. The second change is to use an ascii string comparator in V8 where possible. V8 stores ASCII string internally as ASCII strings, and asking it to compare them to a UTF16 string requires a conversion.
* Add QHashedV8String to improve lookup performanceAaron Kennedy2011-06-141-24/+35
| | | | | | Also inline QV8QObjectWrapper::getProperty() which significantly improves context lookups which contain a lot of QObject property lookup misses.
* Use fast property accessors for readonly propertiesAaron Kennedy2011-06-101-2/+20
|
* Use optimized QObject wrapper whenever it is possibleAaron Kennedy2011-06-101-1/+5
|
* Minor XXX fixupsAaron Kennedy2011-06-091-29/+86
|
* Implement global handle trackingAaron Kennedy2011-06-081-34/+26
| | | | | This makes it easier to track down handles that have been double Dispose()'d. See qv8engine_p.h for details.
* Implement ListModel in V8Aaron Kennedy2011-06-071-10/+19
|
* Allow the same QObject to be used in multiple QDeclarativeEnginesAaron Kennedy2011-06-071-24/+120
|
* Initial V8 integrationAaron Kennedy2011-06-061-0/+1714