aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypewrapper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* fix whitespaceOswald Buddenhagen2014-01-221-1/+1
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Split ManagedVTable into two classesLars Knoll2014-01-211-3/+3
| | | | | | | | Keep the basic methods in ManagedVTable, but have the Object related stuff in an ObjectVTable class. Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Encapsulate the current context and fix it's usageLars Knoll2013-12-041-7/+7
| | | | | | | | | | | Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the vtable pointer from the object to the internal classLars Knoll2013-12-041-1/+1
| | | | | | | | This saves one pointer per object, and willmake other optimizations easier in the future. Change-Id: I1324cad31998896b5dc76af3c8a7ee9d86283bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make comparison of singletons and qobjects workAlbert Astals Cid2013-11-181-0/+11
| | | | | | | | | | | Otherwise you can end up with some weird situation in which you have two objects, you print them and then you print the comparison and get a Foo(0x858480) b Foo(0x858480) a == b false Task-number: QTBUG-34651 Change-Id: Id2444d919f039be085eb5ed9112345db691540a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow passing qmlRegisterSingletonType QObjects to C++ as QObject*Albert Astals Cid2013-11-141-0/+5
| | | | | | | | | | | | | At the moment you can pass them as their FinalType* or as one of their ParentType* but not as QObject* which does not make much sense to me Task-number: QTBUG-34617 Task-number: QTBUG-30730 Change-Id: Id5cfb7bbb123456ef43f44f33b450f8966a7641a Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Speed up lookups of imported scriptsSimon Hausmann2013-10-311-3/+2
| | | | | | | | | | The QQmlContextData stores the JS objects of imported scripts in a QList<PersistentValue>. Instead of indexing into that list, this patch changes ctxt->importedScripts to be a JavaScript array, that in the IR we can index via subscript. Change-Id: Ie2c35fb5294a20a0b7084bb51d19671a27195fec Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Protect write accesses to objectsLars Knoll2013-10-291-0/+2
| | | | | | | | Don't write to objects if we have a pending exception to avoid any side effects. Change-Id: I9f93a9195a652dbae7033cc6ebb355d5d86e9b5e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-291-2/+5
| | | | | | | | | | | | | | We don't want to check for exceptions after every single line on our runtime methods. A better way to handle this is to add the check in all methods that have direct side effects (as e.g. writing to a property of the JS stack). We also need to return whereever we throw an exception. To simplify the code, ExecutionContext::throwXxx methods now return a ReturnedValue (always undefined) for convenience. Change-Id: Ide6c804f819c731a3f14c6c43121d08029c9fb90 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct QV4::Value usageLars Knoll2013-09-281-5/+7
| | | | | | | | Remove Value::fromString(String *), and make Encode safe against encoding raw Managed * pointers. Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-2/+2
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-6/+6
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert the remaining vtable methods to be GC safeLars Knoll2013-09-221-1/+1
| | | | | Change-Id: I679d1833609c41d71e8436ec0ba8a4624f0c4dd0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* convert Managed::put() API to be GC safeLars Knoll2013-09-221-3/+3
| | | | | Change-Id: I09198ce372fa545372db389fac26828d21ad5731 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a StringRef for Managed::get()Lars Knoll2013-09-221-4/+6
| | | | | | | | | also store "toString" and "valueOf" as identifiers in the engine and fix two places where we compared strings the wrong way. Change-Id: I70612221e72d43ed0e3c496e4209681bf254cded Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-181-12/+15
| | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use ReturnedValue for Managed::get().Lars Knoll2013-09-181-9/+9
| | | | | Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more usages of Object::setPrototype()Lars Knoll2013-09-021-2/+0
| | | | | Change-Id: I33383baf14e764ce79252a100a6d769bde75331a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move prototype pointer into QV4::InternalClassLars Knoll2013-09-021-2/+2
| | | | | | | | | | | | | The prototype is actually the same for most objects. By moving it into the internal class, we can save 8 bytes per object, as well as allowing for some future optimizations. Also fix a bug in the implementation of the Error prototype objects. Change-Id: I4d4b641055f644a9b088f27be34bfdb0446279b7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix hasOwnProperty on various types wrapped in QMLSimon Hausmann2013-08-081-4/+11
| | | | | | | | | | | | * Change semantics of Object::query to not walk the prototype chain but let the caller do that where needed (__hasProperty__) * Re-implement query in various places * Implement method_hasOwnProperty to fall back to query() if getOwnProperty failed * Fix missing prototype initialization in some qml wrappers, as well as missing base class calls to ::get() Change-Id: Ic2a702fd5ff3be2ff3c8317a8a24f99940a9594f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of QHashedV4StringLars Knoll2013-06-281-6/+2
| | | | | | | | This was required while we were using V8, but now we can simply pass QV4::String pointers. Change-Id: If6338e4a455d6132fe14e5e603e4fe9e477d1ffb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove context parameter from Manged::put.Lars Knoll2013-06-221-8/+8
| | | | | Change-Id: Ib99e726ffbb20463d45a8444b4fbdfe32cd6dbef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove context parameter from Managed::get()Lars Knoll2013-06-221-6/+7
| | | | | Change-Id: I61837e4b17d7475dcda2f31b8a293c0020930d52 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of QV8QObjectWrapper:setProperty and SetPropertySimon Hausmann2013-06-071-4/+2
| | | | | | | | Fold it all into QV4::QObjectWrapper::setQmlProperty and remove a lot of otherwise unused code. Change-Id: Ic28233fa7d4df898ff39ac065044319e01d47b88 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Simplify QObjectWrapper calls from within other type wrappersSimon Hausmann2013-06-071-9/+3
| | | | | | | ... with the help of a getQmlProperty static function. Change-Id: Ia823ba9ac995cb1a0591081bf18418f48d60e04d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of QV8QObjectWrapper::getPropertySimon Hausmann2013-06-071-4/+9
| | | | | | | Replace the call sites with calls to getQmlProperty on the QObjectWrapper. Change-Id: I3dbc3788c8d1631d817f65c738f0a8a31deb2866 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix regression with meta object revision checkingSimon Hausmann2013-06-031-4/+4
| | | | | | | | | | | | | Commit 00a07bcbd7a592072822b0e55ab2e75e90c3f9f5 replaced the CheckRevision parameter on the call GetProperty on the scope QObject with a get that would do IgnoreRevision. This adds a property getter on the QV4::QObjectWrapper that allows for checking the meta object revision. The plan is to move all of the property getter code from QV8QObjectWrapper into QV4::QObjectWrapper incrementally. Change-Id: I8e5a93ce3351a8c5dba13f14cd43e4036875b792 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Convert more subclasses of Managed to the new casting schemeLars Knoll2013-05-311-1/+0
| | | | | Change-Id: I4105f61d8b1d32b59281eb28fc31002a0ac4e4eb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Start converting casting of Managed to subtypes to a better schemeLars Knoll2013-05-311-2/+2
| | | | | | | | | | | There is now a template based as<Foo>() method available in Managed, that'll allow casting to the proper subclass. It uses the pointer to the vtable and compares it to the classes static vtable for type checking. Like this we can avoid that Managed has to know about all subclasses. Change-Id: Ic966bbe00d85224b8d96cc0ff00f69a6ac67129e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Port the list wrapper over to v4Lars Knoll2013-05-311-2/+1
| | | | | | | Also fix two places where we did a wrong type check. Change-Id: Ibc988b1b38803ca6acf6914487415026910f744e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup the context wrapper codeLars Knoll2013-05-301-1/+1
| | | | | | | | Remove the QV8ContextWrapper class and move the code out of the v8 directory. Change-Id: I00c02f7310a3e43bd105c5bc5af034ce652cfd49 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Port the type wrapper over to v4Lars Knoll2013-05-301-0/+276
Change-Id: Id442281a366914be818b068f70ebe5200c527254 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>