aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qquickworkerscript.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Doc: Fix broken \qmlsignal linksSze Howe Koh2014-03-181-1/+1
| | | | | | | | Fix the breaks caused by the re-categorizing of \qmlsignal pages Task-number: QTBUG-35846 Change-Id: I528ae16ec522fc902133e22d8f53c87a7f0d56ad Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-2/+4
| | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix WorkerScript object leakLiang Jian2014-03-141-1/+5
| | | | | | | Delete WorkerScrip object in WorkerRemoveEvent::WorkerRemove event Change-Id: I1a304838e4a43577a5781216e32610ea36c5a7fd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename some filesLars Knoll2014-01-311-1/+1
| | | | | | | | | | | | Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to qv4value_inl_p.h. It makes more sense to have the class definition in the file that is named after the class and move the inline methods into a _inl file. Doing this now, as I expect we'll be needing a few more _inl files soon. Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-221-6/+6
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Encapsulate the current context and fix it's usageLars Knoll2013-12-041-3/+3
| | | | | | | | | | | 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>
* Simplify & speed up function callingLars Knoll2013-11-091-2/+2
| | | | | | | | | Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix various compiler warnings in order to remove warn_off in the near futureErik Verbruggen2013-11-041-4/+4
| | | | | Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix the remaining try/catch statements in C++Lars Knoll2013-10-291-14/+11
| | | | | Change-Id: I2421dc48fb271b66bd476fb16a32a88fcc4c5177 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Properly propagate parse errorsLars Knoll2013-10-291-5/+7
| | | | | | | | Replace all try/catch statements used when parsing with checks for engine->hasException. Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove internal method from public APILars Knoll2013-10-191-2/+2
| | | | | | | | QQmlError is public API and shouldn't expose an internal method. Change-Id: I7caf06af9340fefec5c96103395fe74acbf19497 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change exception handling APISimon Hausmann2013-10-021-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the exception handling API in the engine slightly, encapsulating any use of direct throw statements and catch blocks with concrete types. In the future we need to be able to change the way these are implemented, in order to ensure that the correct stack unwinding code is triggered for throw and re-throw. This patch separates the C++ exception object thrown from the V4 exception (that includes value, throwing context pointer) and stores the latter inside the engine. In order for that to compile, ExecutionEngine::StackTrace and StackFrame had to move into the QV4 namespace directly. In addition the syntax for catching exceptions changes from try { ... } catch (QV4::Exception &ex) { ex.accept(context); QV4::ScopedValue exceptionValue(scope, ex.value()); } to try { ... } catch (...) { QV4::ScopedValue exception(scope, context->catchException()); } Context::catchException() checks if there's a "current" exception in the engine, and if not assumes that we caught an unrelated exception and consequently re-throws. partiallyUnwind() is also gone and replaced with rethrowException(), in order to encapsulate the re-throw. Lastly, in the future nesting try/catch blocks isn't going to be possible due to limitations in the common C++ ABI with regards to foreign exceptions. Change-Id: Ic81c75b057a2147e3176d8e0b4d326c14278b47d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix API for Object::define*PropertyLars Knoll2013-09-281-5/+4
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-3/+3
| | | | | | | | 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 CallContext to not hold arguments on the C stack anymoreLars Knoll2013-09-281-2/+2
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix QQmlV4Function API to be GC safeLars Knoll2013-09-261-1/+2
| | | | | Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-9/+14
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Fixed and updated Qt Quick's \qmlmodule pageJerome Pasion2013-09-251-1/+1
| | | | | | | | | | | -incremented version to Qt Quick 2.2 (in \qmlmodule page) -import changed to QtQuick 2.2 -\inqmlmodule no longer needs the version. QDoc will ignore the version but it is better to remove it now to avoid confusion Task-number: QTBUG-32172 Change-Id: I40b52e59667014720be40a35b3a8fb9836825e31 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* convert Managed::put() API to be GC safeLars Knoll2013-09-221-5/+5
| | | | | Change-Id: I09198ce372fa545372db389fac26828d21ad5731 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Introduce a Referenced<T> class to pass Objects into methodsLars Knoll2013-09-221-2/+2
| | | | | | | | | | Added some convenience typedefs (StringRef, ObjectRef, ReturnedString, ScopedString, ...) Used StringRef in newBuiltinFunction() for testing. Cleaned up the duplicated code for thrower functions. Change-Id: I7b7676690cbe70d9eabb0a5afd0d922f0be3aefd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup ExecutionEngine::newBuiltinFunction() usagesLars Knoll2013-09-221-2/+2
| | | | | | | And change the return type to be GC safe Change-Id: I6d7513962370fea4072a3d8c6b2c6f2d1705992e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Further work towards an exact GCLars Knoll2013-09-221-12/+17
| | | | | | | | | | | Add some more convenience in the helper classes in qscopedvalue_p.h Make accesses to CallData safer, and change ExecutionEngine::newObject() to return a safe pointer. Change-Id: I980909754ce9681cf6faa1355bab3a1e5d6dd186 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-181-1/+2
| | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert more methods to use ReturnedValueLars Knoll2013-09-181-1/+1
| | | | | | | Change Exception.value() and a few other places. Change-Id: I53ce17e5656e260138b1ac7f6d467e4636c0a0b9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert builtin methods to return a ReturnedValueLars Knoll2013-09-181-5/+5
| | | | | Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename QV4::ValueScope to QV4::ScopeLars Knoll2013-09-181-3/+3
| | | | | | | | The class is going to be used all over the place, so let's give it a short name :) Change-Id: If61543cb2c885e7fbb95c8fc4d0e870097c352ed Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Require a ValueScope for ScopedCallData as wellLars Knoll2013-09-181-3/+4
| | | | | | | | This brings things more in line with ScopedValue, and also simplifies cleanup of Scoped values. Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a ReturnedValue for Managed::call()Lars Knoll2013-09-181-4/+7
| | | | | Change-Id: Ief2d75e9789dd367c603d90dc0fe5316a0d055e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move CallData onto the JS stackLars Knoll2013-09-111-13/+14
| | | | | Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* change calling convention for JS function callsLars Knoll2013-09-021-6/+14
| | | | | | | | | | | | This allows faster pass through of the data if we have nested calls. Also make sure we always reserve at least QV4::Global::ReservedArgumentCount Values on the stack to avoid stack corruption. Change-Id: I42976460f1ef11a333d4adda70fba8daac66acf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Various build fixes for Windows:Simon Hausmann2013-06-261-4/+3
| | | | | | | | | | * Fix processor #defines in stack trace generation code * Fix return type of doEdgeSplitting. It doesn't actually return anything. * Work around internal compiler error in the array construction in qquickworkerscript.cpp Change-Id: I8fac4bc2e8ca7447f4eeff260d8502d70ff6faf6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove the context argument from Managed::callLars Knoll2013-06-221-2/+2
| | | | | Change-Id: I0895f9a94af47c8aab1dc93579921737e9516f7d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix two more errors in the worker script auto testLars Knoll2013-06-181-6/+1
| | | | | Change-Id: Ib1359a985efae18cd4fc8344b81092af57f1a9d4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix parts of workerscriptLars Knoll2013-06-181-1/+1
| | | | | | | | | | | | The worker script creates a special QmlContextWrapper that doesn't contain many things found in the main thread. However we still need to be able to cast to it, so it should be the same class as the regular context wrapper. Fixes parts of the worker script auto tests. Change-Id: I3697b2b0080dc4ac967eb447e2efd0f28fbab465 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix crashes in workerscript tests (qqmlecmascript and qquickworkerscript)Simon Hausmann2013-06-051-1/+2
| | | | | | | | | | | | | We need access to the QNam for a worker and other bits from the v8Engine, so for that it's easiest right now to store the v8engine pointer directly. There aren't many occurrences of v8engine left and we're gradually getting rid of them, but this let's the tests not crash at least :). Once the transition is complete, QV8Engine should collapse and v4->v8Engine->jsengine should become v4->publicEngine again. Change-Id: I98558dd687875f20f1dbe25381ee7efe502c7f24 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove some more v8 usageLars Knoll2013-06-031-6/+7
| | | | | Change-Id: I00c4a2403e12bc87743a073f245c38b007e9531d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Start converting casting of Managed to subtypes to a better schemeLars Knoll2013-05-311-1/+1
| | | | | | | | | | | 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>
* Cleanup the context wrapper codeLars Knoll2013-05-301-3/+5
| | | | | | | | 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-1/+1
| | | | | | | | | | 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>
* Replace usage of v8::Script and qmlModeCompile with QV4::ScriptLars Knoll2013-05-221-16/+13
| | | | | Change-Id: I114a0b7faed39be313cde5617a0ce4a06dece7e2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert the remaining TryCatch statements to use QV4::ExceptionLars Knoll2013-05-211-5/+5
| | | | | | | | 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>
* Fix some parts of workerscript and convert to v4Lars Knoll2013-05-211-32/+37
| | | | | | | | Add some try/catch blocks around calls to v4, fixing some crashes in the worker script auto test. Change-Id: I591a25facc8afd5c6f99ffb7b75530c890318280 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename QV8Worker to QV4::SerializeLars Knoll2013-05-211-5/+5
| | | | | | | | The class is only being used in WorkerScript, but in itself only does serialization of JS Values. Change-Id: Ibf1b06acf5abcfcc00cada9cc8cad9a833bd7ea3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* convert qv8workerscript to v4Lars Knoll2013-05-211-2/+2
| | | | | Change-Id: Ifc204f53a46c857a2a7caaa4f6900d4300163dbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup v8 dependencies from QQmlV8FunctionLars Knoll2013-05-081-2/+2
| | | | | | | ... and rename it to QQmlV4Function Change-Id: Iad72347babf62691e26306877d4f229fda127eb7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove v8 dependencies from QQmlV4HandleLars Knoll2013-05-081-1/+1
| | | | | Change-Id: I87d2183738ec7cfeea846a28f2b9aed79a233f68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move QQuickworkerscript over to QV4::PersistentValueLars Knoll2013-05-081-18/+20
| | | | | Change-Id: I6ff1d4942eac147a5bebd4a7be0774dabae91a04 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* More steps towards eliminating the v8 layerSimon Hausmann2013-05-071-2/+2
| | | | | | | | * Changed the return type of the InvocationCallback from a v8 handle to a QV4::Value * Removed v4 auto tests and fixed build of other tests Change-Id: Ic927b925923ca8785170689a5c260969fd1cb794 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace v8::Undefined() with QV4::Value::undefinedValue()Simon Hausmann2013-05-071-3/+3
| | | | | Change-Id: I4c7bb5bcc1bc15a982bb83d2597e6ae4bc5710cd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of v8::LocalLars Knoll2013-05-061-9/+9
| | | | | | | | | 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>