aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jsonobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Convert Boolean, Number and DateObjectLars Knoll2014-07-221-3/+3
| | | | | Change-Id: I8815578422fe1af87eb5f02899f35131fea70b76 Reviewed-by: Simon Hausmann <[email protected]>
* Get rid of different macros for vtable specializationsLars Knoll2014-07-221-1/+1
| | | | | | | Detect existence of a a vtable entry at compile time. Change-Id: Ieed5d34b063184bc4435b22c6685ac0e3fabf493 Reviewed-by: Simon Hausmann <[email protected]>
* Avoid calling destroy() on most objectsLars Knoll2014-07-221-1/+1
| | | | | | | | | The method is now optional, and we can simply avoid calling it if all members an object has are themselves garbage collected. Change-Id: If560fce051908bcc10409ead1a7d8a5bd5fa71d2 Reviewed-by: Simon Hausmann <[email protected]>
* Correctly parse unicode escape sequences between 0 and u001fLars Knoll2014-03-251-2/+0
| | | | | | | | | The old code rejected these escape sequences because of a slight misreading of the spec. Task-number: QTBUG-36968 Change-Id: I56a0e76295d1903b4798719de028bd21ad5be719 Reviewed-by: Simon Hausmann <[email protected]>
* Cleanup our runtime methodsLars Knoll2014-03-111-1/+1
| | | | | | | | | Move all our runtime methods into the QV4::Runtime struct and give them nicer names without underscores. Sort them logically and remove a few unused methods. Change-Id: Ib69b71764ff194d0ba211aac581f9a99734d8180 Reviewed-by: Simon Hausmann <[email protected]>
* Change virtual methods in ArrayData to take Object pointerLars Knoll2014-01-241-1/+1
| | | | | | | | | Pass a pointer to the underlying object instead of the ArrayData to virtual methods that modify the arrayData. This prepares for allocating the ArrayData together with the array itself. Change-Id: I66fe187f8b1e4d382ab243a518dbde5f18a1d16d Reviewed-by: Simon Hausmann <[email protected]>
* Split ManagedVTable into two classesLars Knoll2014-01-211-1/+1
| | | | | | | | Keep the basic methods in ManagedVTable, but have the Object related stuff in an ObjectVTable class. Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e Reviewed-by: Simon Hausmann <[email protected]>
* Add a SimpleArrayData classLars Knoll2014-01-201-3/+1
| | | | | | | | | | | | | | | | This makes the ArrayData class 'pure virtual'. SimpleArrayData now contains the implementation of simple arrays. This makes the separation between simple and sparse arrays a lot cleaner. It also allows us to move len and offset from the base class into the SimpleArrayClass. This fixes some bugs where we accessed len for sparse arrays leading to some buggy behavior. Added a virtual length() method to ArrayData to query the highes used index in the Array. Change-Id: Iab2ba2a48ebe5b7031759eeb4ebe02b4d86233f0 Reviewed-by: Simon Hausmann <[email protected]>
* Cleanup: change signature of Object::insertMember()Lars Knoll2014-01-091-2/+1
| | | | | | | | | | | | Methods returning a Property pointer have to be removed, so that we can move over to store member data requiring only one value for the common case of data properties. This will in the long term reduce memory consumption on 64 bit systems quite a bit. Change-Id: I78de3794ec7b3bc5db13aa57275d3f08fa9d470a Reviewed-by: Simon Hausmann <[email protected]>
* Rework array handling for JS objectsLars Knoll2014-01-091-6/+7
| | | | | | | | | Split up ArrayData into two classes, one for regular arrays, one for sparse arrays and cleanly separate the two cases. Only create array data on demand. Change-Id: I9ca8d0b53592174f213ba0f20caf93e77dba690a Reviewed-by: Simon Hausmann <[email protected]>
* Move array data into it's own structLars Knoll2014-01-031-2/+2
| | | | | | | First step of separating the array data from Object. Change-Id: I5c857397f0ef53cff0807debdb1e405424e1046a Reviewed-by: Simon Hausmann <[email protected]>
* Move Managed::type and some flags into the vtableLars Knoll2014-01-031-5/+5
| | | | | | | | | | | | | Move the type flag into the vtable to free up these bits in the Managed class, and not have to set them at object construction time. As we often need to know whether a Managed object is a Object, FunctionObject or String, add some bitflags to test for these to the vtable. Change-Id: I7d08ca044544debb307b55f124f34cb086ad9e84 Reviewed-by: Simon Hausmann <[email protected]>
* 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]>