aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4numberobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-181-7/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * Use the new macros for disabling warnings in qtdeclarativeThiago Macieira2015-07-281-7/+3
| | | | | | | | | | Change-Id: I476da50ba23598c7ca98651477fb701f74053b82 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* | qml: Avoid heap allocations due to QString::fromLatin1()Sérgio Martins2015-08-131-2/+2
| | | | | | | | | | | | | | By using QStringLiteral when the argument is a literal. Change-Id: Ib25042d10f3d9d0aca81af74cde0107aba4f9432 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Move the StringValue members of ExecutionEngine onto the JS stackLars Knoll2015-06-101-4/+4
| | | | | | | | | | Change-Id: Ib55c05f1730b7659e2f6fee7e1fa79c10c759167 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-241-0/+1
| | | | | | | | | | | | | | | | This is a cleaner separation and further reduces include dependencies in the definitions of our basic data structured. Change-Id: I18aa86cdea0c0dfbc16075d4d617af97e638811e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | More cleanupsLars Knoll2015-04-211-2/+2
| | | | | | | | | | | | | | | | Get rid of Value::asObject(), and pass const Managed pointers into some more vtable methods. Change-Id: Ia4f427d5fd8868f77b4015d1ce5424d32bfc2115 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Get rid of asNumberObjectLars Knoll2015-04-211-2/+2
|/ | | | | Change-Id: Ie6355beabce3de65c215514d9dc98294b5980c9d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-031-3/+9
|\ | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4numberobject.cpp Change-Id: I4e66a03ef4d99cec192c9da30c028fd8c1f4ac0d
| * V4: fix ToFixed rounding for 0 fraction digits.Erik Verbruggen2015-03-031-3/+9
| | | | | | | | | | | | | | | | | | (12.5).toFixed() should return 13, not 12. Task-number: QTBUG-43885 Task-number: QTBUG-44039 Change-Id: Id2b19641e8c12dd5755d8447508b74567e4a2b9b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-191-5/+5
| | | | | | | | | | | | | | | | Use std::math on floats and doubles, and qMath on qreals, and only include the math headers actually needed. Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* | Store a double in NumberObjectLars Knoll2015-01-231-4/+3
| | | | | | | | | | | | | | Makes more sense than storing a Value in there. Change-Id: I2e6ca71477100c1e1639bb89cced4f4049b5e5c2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | CleanupsLars Knoll2015-01-231-16/+16
| | | | | | | | | | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of all uses of Managed::engine()Lars Knoll2015-01-211-2/+2
| | | | | | | | | | Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove all the setVTable() calls that aren't required anymoreLars Knoll2015-01-211-1/+0
| | | | | | | | | | | | | | | | The memory manager's allocation methods now set this up correctly for us :) Change-Id: I8492bf732df601f95a1a851fb3804127ffc83935 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup: remove Value::toString/Object overloads taking a contextLars Knoll2014-11-151-15/+17
| | | | | | | | | | Change-Id: I4cb63c3cc4eb9bb81f10f9826f80e581b4e1990c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert methods in RuntimeHelpers to take an engine pointerLars Knoll2014-11-121-2/+2
| | | | | | | | | | | | | | This is safer and cleaner than to use a context pointer. Change-Id: Id5ef4e6667571897cd029125a0bdc18ce299da6d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move more Data objects into the Heap namespaceLars Knoll2014-11-091-2/+2
| | | | | | | | | | Change-Id: I87866f8dcbaac1087da7bbd2902aa5b062afca53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move Data of FunctionObject and related classes into HeapLars Knoll2014-11-081-1/+1
| | | | | | | | | | Change-Id: Iadf74f953798c1884e0ec704ccb7c70d971e3273 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move the throw methods from ExecutionContext to ExecutionEngineLars Knoll2014-11-041-6/+6
| | | | | | | | | | | | | | | | The methods don't require a context, and thus shouldn't be implemented there. Change-Id: If058e0c5067093a4161f2275ac4288aa2bc500f3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup header file dependenciesLars Knoll2014-11-041-0/+2
|/ | | | | Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Convert remaining FunctionObject's to new constructor schemeLars Knoll2014-07-221-2/+2
| | | | | Change-Id: I440d5b128d0ee28566ebfa82c2505a4bd97bba6b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of all uses of ObjectRefLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I705e2362dcda542f56826dadec6b0a6f15848788 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ExecutionContext to new storage schemeLars Knoll2014-07-221-28/+28
| | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert Boolean, Number and DateObjectLars Knoll2014-07-221-2/+2
| | | | | Change-Id: I8815578422fe1af87eb5f02899f35131fea70b76 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of different macros for vtable specializationsLars Knoll2014-07-221-2/+2
| | | | | | | Detect existence of a a vtable entry at compile time. Change-Id: Ieed5d34b063184bc4435b22c6685ac0e3fabf493 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid calling destroy() on most objectsLars Knoll2014-07-221-2/+2
| | | | | | | | | 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 <simon.hausmann@digia.com>
* Fix Number.toExponential with parameterSimon Hausmann2014-05-211-1/+1
| | | | | | | | | | The fractionDigits parameter was unfortunately ignored, due to an accidental double variable declaration, the latter in a narrower scope shadowing the former in the correct scope. Task-number: QTBUG-38577 Change-Id: I28f35466d2d744e84b86a3ca6b3371eb86869b55 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup our runtime methodsLars Knoll2014-03-111-2/+2
| | | | | | | | | 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 <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>
* 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>
* Simplify & speed up function callingLars Knoll2013-11-091-6/+6
| | | | | | | | | 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>
* 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 <simon.hausmann@digia.com>
* Protect write accesses to objectsLars Knoll2013-10-291-2/+1
| | | | | | | | 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-9/+17
| | | | | | | | | | | | | | 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>
* Smaller cleanupsLars Knoll2013-10-111-0/+1
| | | | | Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove some more uses of QV4::ValueLars Knoll2013-10-021-10/+19
| | | | | | | All remaining uses should be GC safe now. Change-Id: I05c962de6ab896f108f70caa1bf937a24e67bfe1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more occurrences of QV4::ValueLars Knoll2013-09-301-1/+1
| | | | | Change-Id: I66c370680d7e6bee2e73a7a940aa96ab4009ec57 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix API for Object::define*PropertyLars Knoll2013-09-281-9/+11
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove Value::fromString()Lars Knoll2013-09-281-6/+6
| | | | | | | | replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Value usage in ErrorObjectsLars Knoll2013-09-281-2/+2
| | | | | Change-Id: Iaa14ad5a8d3f085843e49195f8f4bb7bb020b9b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct QV4::Value usageLars Knoll2013-09-281-8/+9
| | | | | | | | 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::toInteger(double) and related to PrimitiveLars Knoll2013-09-281-1/+1
| | | | | | | Also clean up a few other direct uses of Value Change-Id: Ie27d42c1b31b9e6d16d0a60071cb5e4e1c5b9e8b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-9/+9
| | | | | | | | 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-12/+12
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prevent objects from being collected while in their constructorLars Knoll2013-09-221-1/+1
| | | | | | | | | | | | | While objects are being constructed, we don't have a reference to them on the JS stack yet. So the constructor needs to protect itself against being collected by putting the this object onto the JS stack. Added an environment switch MM_EXACT_GC to test exact garbage collection. Change-Id: Ie37665a954de800359c272ffbebbe1488e7a8ace Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert the last methods in qv4object_p.hLars Knoll2013-09-221-1/+3
| | | | | | Change-Id: I4fda83a0832760c277e629d4e658da718c0bf92b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a StringRef for Managed::get()Lars Knoll2013-09-221-2/+2
| | | | | | | | | 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>
* Cleanup Object::define*Property APILars Knoll2013-09-221-15/+15
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>