aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jsonobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-121-2/+7
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlcompiler.cpp Change-Id: I802731139d47c5b733dd805f7bf432d67d7331e1
| * Fix a crash in JSON.parseLars Knoll2013-12-041-2/+7
| | | | | | | | | | | | | | | | | | | | Properly set members that are actually array indices and don't crash when trying to set those. Task-number: QTBUG-35383 Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780 Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Milian Wolff <[email protected]>
* | Encapsulate the current context and fix it's usageLars Knoll2013-12-041-1/+1
|/ | | | | | | | | | | 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 <[email protected]>
* Remove debug outputEskil Abrahamsen Blomfeldt2013-11-091-1/+0
| | | | | | | | | Some applications (like e.g. the Tweet Search example) prints out a ton of these "scanEscape" messages to the console. Change-Id: Ibfa9c4780705167693c7fb6af8cad1e312549a5f Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* 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 <[email protected]>
* Optimise string additionsLars Knoll2013-11-051-1/+1
| | | | | | | | Small optimisation for string additions, also add one more check for exceptions in the code where required. Change-Id: I6c14bc88ea5d03f7eeed0e0168c5195f9f823693 Reviewed-by: Simon Hausmann <[email protected]>
* Fix various compiler warnings in order to remove warn_off in the near futureErik Verbruggen2013-11-041-23/+23
| | | | | Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <[email protected]>
* Protect write accesses to objectsLars Knoll2013-10-291-2/+2
| | | | | | | | Don't write to objects if we have a pending exception to avoid any side effects. Change-Id: I9f93a9195a652dbae7033cc6ebb355d5d86e9b5e Reviewed-by: Simon Hausmann <[email protected]>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-291-3/+7
| | | | | | | | | | | | | | 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 <[email protected]>
* Fix the remaining objects against self destructionLars Knoll2013-10-111-0/+3
| | | | | | | | This makes pretty much all test cases pass with exact garbage collection. Change-Id: Ia874e3c17c3984afb7cfe370f9bd3ad8fe46699a Reviewed-by: Simon Hausmann <[email protected]>
* Use SafeValue instead of Value in ScopedValue methodsLars Knoll2013-10-021-1/+1
| | | | | Change-Id: Ie463efe600d498ce77d4b9e8b48abcfd61c1ab78 Reviewed-by: Simon Hausmann <[email protected]>
* Fix ObjectIterator API to be GC safeLars Knoll2013-10-021-9/+5
| | | | | Change-Id: I3a9c48d53d8dbadcb9b32c00fcef1f89447c4b8c Reviewed-by: Simon Hausmann <[email protected]>
* Fix a few more uses of ValueLars Knoll2013-09-281-55/+63
| | | | | Change-Id: Ib34a348d6091cc5f0a624a3f80569a08c7c78989 Reviewed-by: Simon Hausmann <[email protected]>
* Remove Value::fromString()Lars Knoll2013-09-281-5/+5
| | | | | | | | replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <[email protected]>
* Make API of QV4::JsonObject GC cleanLars Knoll2013-09-281-10/+14
| | | | | Change-Id: Ie7f2d63402c9486b30caf5866af8c747026c091d Reviewed-by: Simon Hausmann <[email protected]>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-7/+7
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <[email protected]>
* Move more API over to use ValueRefLars Knoll2013-09-261-12/+16
| | | | | Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646 Reviewed-by: Simon Hausmann <[email protected]>
* Fix cases where mark() would access uninitialized memoryLars Knoll2013-09-221-2/+3
| | | | | Change-Id: I4e07e20d30ba57759a0ece1c298a02b098718b33 Reviewed-by: Simon Hausmann <[email protected]>
* Fix some more methods to take ValueRef'sLars Knoll2013-09-221-4/+4
| | | | | | Change-Id: Ia0e30ba98c16e51c9992027c7e5f78d4def8697a Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Gunnar Sletta <[email protected]>
* convert Managed::put() API to be GC safeLars Knoll2013-09-221-3/+8
| | | | | Change-Id: I09198ce372fa545372db389fac26828d21ad5731 Reviewed-by: Simon Hausmann <[email protected]>
* 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 <[email protected]>
* Cleanup Object::define*Property APILars Knoll2013-09-221-4/+4
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <[email protected]>
* Add a Safe<T> class and start using itLars Knoll2013-09-221-1/+3
| | | | | | | | | | The class denotes objects that are stored safely in areas controlled by the GC. These we can convert fast to a StringRef etc. Change-Id: I6b154eccaefddc42d4fafca55b7ee9e77179830c Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Gunnar Sletta <[email protected]>
* Further work towards an exact GCLars Knoll2013-09-221-15/+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 <[email protected]>
* Convert more methods to return a Returned<>Lars Knoll2013-09-181-22/+24
| | | | | Change-Id: If294c9c4f574824c308b63a11da1337226180105 Reviewed-by: Simon Hausmann <[email protected]>
* Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-181-19/+24
| | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <[email protected]>
* Convert builtin methods to return a ReturnedValueLars Knoll2013-09-181-5/+5
| | | | | Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <[email protected]>
* Use a ReturnedValue for Managed::getIndexed()Lars Knoll2013-09-181-3/+9
| | | | | Change-Id: I0371ed21c4ef99564d3ffa1082dd109e890a78bf Reviewed-by: Simon Hausmann <[email protected]>
* Use ReturnedValue for Managed::get().Lars Knoll2013-09-181-3/+5
| | | | | Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca Reviewed-by: Simon Hausmann <[email protected]>
* Rename QV4::ValueScope to QV4::ScopeLars Knoll2013-09-181-2/+2
| | | | | | | | 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 <[email protected]>
* Require a ValueScope for ScopedCallData as wellLars Knoll2013-09-181-2/+3
| | | | | | | | This brings things more in line with ScopedValue, and also simplifies cleanup of Scoped values. Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77 Reviewed-by: Simon Hausmann <[email protected]>
* Use a ReturnedValue for Managed::call()Lars Knoll2013-09-181-2/+2
| | | | | Change-Id: Ief2d75e9789dd367c603d90dc0fe5316a0d055e3 Reviewed-by: Simon Hausmann <[email protected]>
* Use a ReturnedValue when converting to String or ObjectLars Knoll2013-09-121-2/+2
| | | | | | | | Also rename Value::toQString() to Value::toQStringNoThrow(), and add a throwing toQString() method for JS use. Change-Id: I821b33fc61abb7d08839df965fd337685f61a545 Reviewed-by: Simon Hausmann <[email protected]>
* Continue conversion to using scoped valuesLars Knoll2013-09-111-4/+7
| | | | | | | | | | | This converts all methods in qv4runtime_p.h to not use raw values in arguments anymore. The conversion of return values will be done in a separate commit. Change-Id: Ie6e8f3bed459d09cb831f7f87920b7eada161502 Reviewed-by: Simon Hausmann <[email protected]>
* Move CallData onto the JS stackLars Knoll2013-09-111-9/+10
| | | | | Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510 Reviewed-by: Simon Hausmann <[email protected]>
* Remove more usages of Object::setPrototype()Lars Knoll2013-09-021-1/+0
| | | | | Change-Id: I33383baf14e764ce79252a100a6d769bde75331a Reviewed-by: Simon Hausmann <[email protected]>
* Move prototype pointer into QV4::InternalClassLars Knoll2013-09-021-1/+1
| | | | | | | | | | | | | 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 <[email protected]>
* change calling convention for JS function callsLars Knoll2013-09-021-6/+9
| | | | | | | | | | | | 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 <[email protected]>
* Remove QV4::DiagnosticMessageLars Knoll2013-08-201-1/+1
| | | | | | | | | | QQmlError provides the same functionality, so let's rather use that where required. Remove the dependency of codegen onto the ExecutionContext that was only required for error handling. Change-Id: Ib0b61c0e138f89ff989c32996c93c339e4b62223 Reviewed-by: Simon Hausmann <[email protected]>
* Restructure source codeLars Knoll2013-08-081-0/+1040
Move the v4 engine classes from a subdir of qml/qml into two subdirs (compiler and jsruntime) of the qml module Remove an unsued qv4syntaxchecker class, and move the moth code directly into compiler. Change-Id: I6929bede1f25098e6cb2e68087e779fac16b0c68 Reviewed-by: Simon Hausmann <[email protected]>