aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix failing tst_qqmlecmascript::qtbug_22843:"with .pragma library"Simon Hausmann2013-06-231-1/+4
| | | | | | | | | | | | | | | | Try to to load a .pragma library type of script only once, even if it has a syntax error. Change-Id: I32d7fb71647f413dc75e339e7bff8d74f7754c87 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix syntax error propagationSimon Hausmann2013-06-131-6/+14
| | | | | | | | | | | | | | | | | | For syntax errors we use the DiagnosticMessage type in qv4context.cpp, that contains detailed information about the error. We must catch that error correctly in QQmlVME::run and report it to the engine. Change-Id: I8f53c7db8dbdc6afa72396f3c25537690a6f5841 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Move QV8QObjectWrapper::newQObject into QV4::QObjectWrapperSimon Hausmann2013-06-051-1/+1
| | | | | | | | | | | | | | | | ...where it is just called wrap(), because it doesn't always create a new JS wrapper for the QObject. Change-Id: Ieed0fc97174eb51cd04df0149e715c234a5822bd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix missing object markings in QV4::ScriptSimon Hausmann2013-06-021-1/+1
| | | | | | | | | | | | | | | | | | Store the qml activation object as Persistent value, as the script object is often stored on the heap. Also make sure to mark it in QmlBindingWrapper. Fixes various valgrind errors in tst_qqmlecmascript. Change-Id: I7edf1e18db0e6a5ab9dcbfd57e258d72fe62cd77 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Cleanup the context wrapper codeLars Knoll2013-05-301-2/+3
| | | | | | | | | | | | | | | | Remove the QV8ContextWrapper class and move the code out of the v8 directory. Change-Id: I00c02f7310a3e43bd105c5bc5af034ce652cfd49 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of Get/SetHiddenValue in the v8 APILars Knoll2013-05-241-3/+3
| | | | | | | | | | | | | | | | | | | | It was only used to mark an object as something to be used as a binding. Simply use one of the free bits in QV4::Managed for that. Also changed a bit more code over from v8 to v4. Change-Id: I6e787e611041e058fe109df1d7a13598655f8eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of some v8 based codeLars Knoll2013-05-241-2/+2
| | | | | | | | | | Change-Id: Iee910dcc1d3148922d2f92055eb06cdb0b889502 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove the remaining dependencies onto the binding rewriterLars Knoll2013-05-241-1/+1
| | | | | | | | | | | | | | | | Remove the remaining places that were rewriting bindings. Remove the binding rewriter class. Change-Id: Ib1e9121dc10f4526ddb7cf0ae32fecd8ce2d4993 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove QV8Bindings classLars Knoll2013-05-241-46/+1
| | | | | | | | | | | | | | | | | | This class tries to optimise binding compilation with v8. With the approach in v4 where we don't rewrite binding expressions anymore, this is not required anymore. Change-Id: I616aeeba85bc17a950d4c7341b3042ed8aa42bff Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove all references to the old v4 codeLars Knoll2013-05-231-50/+0
| | | | | | | | | | | | | | | | The old v4 files have already been removed, so cleanup all the #ifdef'ed code that still references them. Change-Id: Ifc5c59add5af36a61586a43b13291d7836cccd78 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix crash in tst_qqmlecmascript::qtbug_22843()Simon Hausmann2013-05-231-2/+4
| | | | | | | | | | | | | | | | | | Parse errors throw exceptions, which we must catch here. The caller will check !m_program and return accordingly. This restores the previous behavior also found in stable/dev. Change-Id: Iecff94858ba12f13e581ec1664a092b3e9cd963d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Replace usage of v8::Script and qmlModeCompile with QV4::ScriptLars Knoll2013-05-221-6/+15
| | | | | | | | | | Change-Id: I114a0b7faed39be313cde5617a0ce4a06dece7e2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::BooleanLars Knoll2013-05-211-1/+1
| | | | | | | | | | Change-Id: I10b4240db78532dfdf972bb0a6f191462d81caaa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::NumberLars Knoll2013-05-211-1/+1
| | | | | | | | | | Change-Id: I38bdf8fe4dd73c61317912ec6308a9a1e870ad99 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::IntegerLars Knoll2013-05-211-1/+1
| | | | | | | | | | Change-Id: I6b9ab830c4ff3cbf986dbcf7c056648b5a16a222 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Small exception handling fixesSimon Hausmann2013-05-211-0/+1
| | | | | | | | | | | | | | | | | | * Don't accept the exception if we're going to re-throw it (partial unwind is not necessary as we don't have a stack-based context to clean up) * However do accept() it if we decided to handle it (in qqmlvme.cpp) Change-Id: I63bfa34f30fe19ad36de746b1f15fc6b641e563b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Convert the remaining TryCatch statements to use QV4::ExceptionLars Knoll2013-05-211-14/+7
| | | | | | | | | | | | | | | | v8::Script::Run doesn't catch the exception anymore. Instead we handle this on the calling side, removing all needs for v8::TryCatch. Change-Id: I946269a6734f50c728c4f153c00cd19db48f1a6a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert qqmltypeloader to use QV4::PersistentValueLars Knoll2013-05-081-5/+5
| | | | | | | | | | Change-Id: Ifc4e2aea870a3a8ab37cd4d0674c672f0850f98f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove more v8::Persistent usagesLars Knoll2013-05-071-8/+4
| | | | | | | | | | Change-Id: Ifa1706e2e609ded86a8bc1a840ca2ed36b869098 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::LocalLars Knoll2013-05-061-3/+3
| | | | | | | | | | | | | | | | | | The class was doing exactly the same thing as v8::Handle in our implementation. Removing it cleans up quite a bit of code. Change-Id: I37a3dcdef062fc388751e9ef0a158b5926ba2efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove v8::HandleScopeLars Knoll2013-05-031-5/+0
| | | | | | | | | | | | | | This class never made sense with v4... :) Change-Id: Id597d791d1adf52cc821d6d46f57cb24d1acd343 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup v8 Context handlingLars Knoll2013-05-031-2/+0
| | | | | | | | | | | | | | | | | | We don't need or use v8 Context objects, so it's sufficient to have one global context for now. Remove all code related to entering or leaving Context's. Change-Id: I4f7ddaa4907e59de5713368fa13bbc40e5830542 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Disable the old v4 engine by defaultLars Knoll2013-04-201-2/+8
|/ | | | | | | | Left the code in there, as a reference for how we might want to build up binding evaluation in the new v4. Change-Id: I5c81ea986d642b524fb02087d819b39c4e3fb257 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* | Move VME exception to a better placeAlan Alpert2013-01-081-4/+5
|/ | | | | | | | | If o is not created, then ddata on the next line may also not create successfuly leading to an invalid memory access before we reach the !o exception. Change-Id: I9b127dff7955456aacb25138fabaabaabaab921f Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
* Only free context if the owning QV8ContextResource gets destroyedPhilip Lorenz2012-12-101-0/+1
| | | | | | | | | | | | | | | | | | Since fdeee38b781376012c4f086276c3c376726c8839 QQmlXMLHttpRequest stores the calling context for later use. This leads to issues after the first request completes and the wrapping QV8ContextResource gets freed by garbage collection and therefore removes the associated QQmlDataContext which may still be required for later calls (e.g. if the calling context is part of a stateless library). This patch introduces an ownership flag for QV8ContextResource which indicates if the associated context should be cleared when the object is destroyed. Task-number: QTBUG-28351 Change-Id: I552ebb5c55b889eb33f3884283c8fdf037ac33be Reviewed-by: Alan Alpert <aalpert@rim.com>
* Enable mobule build with QT_NO_TRANSLATIONTasuku Suzuki2012-11-261-0/+2
| | | | | | Change-Id: Id7aeef0d499f48ddc64b4ea3e4dc713db8458c38 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
* Add designer support for animations and componentCompleteMarco Bubke2012-11-221-16/+16
| | | | | | | | | In the designer animations confuse users, if you change a state or move a item around. Also component complete is called later by the designer. The call in the VME is to early. Change-Id: I49aa04edbc49fb44ddb7b52062307982865efd7e Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
* Change qml list interfaceMarco Bubke2012-10-231-3/+8
| | | | | Change-Id: I185c6f4cef6105544504324c1616b5995c219fe3 Reviewed-by: Christiaan Janssen <christiaan.janssen@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>
* Add a Q_UNREACHABLE to improve code generation a littleThiago Macieira2012-09-131-0/+1
| | | | | | | | The code can't reach there anyway, so let's help the compiler out a little. Change-Id: Icee6ebe426c1116a7baaf2c5766c6d8f8276f3ac Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Make the instruction table be constThiago Macieira2012-09-131-4/+4
| | | | | | | It's never going to be modified, so it should be const. Change-Id: Ibc3bac0583f72ccbf7caa69aeab029bae03d3cdd Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Evaluate bindings more intelligently during constructionAaron Kennedy2012-08-291-8/+25
| | | | | | | | | | | | | | | | | 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>
* Avoid dynamic lookup of signal handler argumentsMichael Brasser2012-08-241-1/+4
| | | | | | | | | | | Rewrite signal handlers to include the parameters in the rewrite. Also check whether parameters are actually used when possible, and if not don't provide them to the expression. Change-Id: I7d65c05f4639979dd61035cf7478119ef7647c25 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Reduce memory consumption in QV4Bindings::BindingMatthew Vogt2012-08-171-3/+1
| | | | | | | | As with QV8Bindings::Binding, access details from the QML IR instruction object rather than storing a copy of the values. Change-Id: I2b629ee1b06ed74c7b38e6d047ef6a98acd45086 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>
* Permit value types with metatype IDs >= QMetaType::UserMatthew Vogt2012-08-101-14/+14
| | | | | | | | | Remove the assumption that value types must be types defined by Qt, having metatype IDs below QMetaType::User. Task-number: QTBUG-26352 Change-Id: Ib5a56ff2e7892e82adf17a3a1e7517a0c9fe0534 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Make QQmlScriptString opaque.Michael Brasser2012-08-031-4/+4
| | | | | | | | Allow for future optimization by encapsulating the raw script data. Change-Id: I1863103e8e6d74ede60593cabb240e16f2ae657e Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Improved error messages for malformed .import statementsMatthew Vogt2012-07-111-2/+7
| | | | | | | | | Report errors in .import statements, rather than pass them through to V8 to yield 'Syntax error'. Task-number: QTBUG-24867 Change-Id: I111b3bd3d198e97f42b29591f61753e86295aeb2 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-091-2/+2
| | | | | | | | | 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>
* Disallow parent changes for QML created objectsAaron Kennedy2012-06-061-7/+6
| | | | | | | | | Currently this is protected with a QML_PARENT_TEST environment variable to allow the rest of QtQuick to be updated before it is enforced. Change-Id: I4dd3644cbbce91d67f24c9556637f97eafb00638 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Send valueTypeIndex to setBindingNoEnable in the expected format.Michael Brasser2012-06-041-2/+3
| | | | | | | Ensure we send a -1 if the property is not a value type property. Change-Id: Ic4fa6954a0bcfd32d50da565f82f21f17d81ac9b Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-14/+8
| | | | | | | | | | 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/+5
| | | | | | | | | 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>
* QtDeclarative: Fix warnings about deprecated QCoreApplication::translate().Friedemann Kleint2012-05-221-1/+0
| | | | | Change-Id: I4abd4ee98ca9d4267c5ad71d3b9c2e7d5de60902 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Allow the existence of a VME metaobject to be assertedMatthew Vogt2012-05-211-3/+4
| | | | | | | | | Test for the existence of a VME metaobject. Otherwise, assertion of a static cast result is not meaningful. Change-Id: Ic9e9c38e5dce65c41d20e405c33e179334c37b00 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Add QQmlEngine::trimComponentCache()Matthew Vogt2012-05-171-8/+29
| | | | | | | | | | | | Allow unused data in the engine's component cache to be safely discarded so that the memory can be freed for other purposes. Unloading of scripts that are no longer required after trimming unused components is not yet supported. Task-number: QTBUG-25653 Change-Id: I37bc9d5592eeb5edceeb34d010a555dcffd11cea Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Permit signals to be emitted in a different threadAaron Kennedy2012-05-111-1/+1
| | | | | | | | | | | | The QQmlNotifier approach to connecting to signals did not support the cross-thread signal/slot model used elsewhere in Qt. This change allows one specific case of that - emitting a signal in a different thread than the one the QObject lives - to work. Task-number: QTBUG-25647 Change-Id: Ia8fdaf4c7d7e2ccd7ff7657bb1d8e26277eb60aa Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Allow V4 bindings to be assigned to aliasesMichael Brasser2012-05-101-4/+13
| | | | | | | | V4 bindings must be able to be retargetted for them to be assignable to aliases. Change-Id: I4d3addd0fdc90b9bf472c781d316f7f406eaf1d7 Reviewed-by: Chris Adams <christopher.adams@nokia.com>