aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4dateobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move more objects over to the new allocation schemeLars Knoll2015-09-221-2/+1
| | | | | Change-Id: I0241efe10d115f8e4a646f840e47e220eb6cfc18 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Move more objects from the v4 engine to the js stackLars Knoll2015-04-241-1/+1
| | | | | | | Convert most of the prototype objects in the v4 engine. Change-Id: I365f290493c20973bc991b6a383649836e42a16a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Store the datetime as a double in the date objectLars Knoll2015-04-241-59/+60
| | | | | Change-Id: I6ae05a066d021e81eaed90866e09bf480f5d91d9 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>
* Get rid of asFunctionObject()Lars Knoll2015-04-211-1/+1
| | | | | Change-Id: Ib4858376dc0ec57fa473c80696abc66a570c90ec Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* More cleanupsLars Knoll2015-04-211-5/+5
| | | | | | | | 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 Value::asDateObject()Lars Knoll2015-04-161-18/+18
| | | | | Change-Id: I71816a784b5175f600c5a870318b16c0d84c42fb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-171-0/+1
|\ | | | | | | Change-Id: I4c338a44c1d64c2d8e637971ab3ec6982c40a685
| * Fix thread-safety: _POSIX_THREAD_SAFE_FUNCTIONS is in <unistd.h>Thiago Macieira2015-03-051-0/+1
| | | | | | | | | | | | | | If you don't include it, it isn't defined... Change-Id: I1a800c709d3543699131ffff13c388ba652761fc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-191-6/+2
| | | | | | | | | | | | | | | | 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>
* | CleanupsLars Knoll2015-01-231-66/+66
| | | | | | | | | | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove all remaining usages of ValueRefLars Knoll2015-01-231-1/+1
| | | | | | | | | | Change-Id: Icd76d3d03fac2e57530e55f8ec15b97109dcdcbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of all uses of Managed::engine()Lars Knoll2015-01-211-3/+3
| | | | | | | | | | Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove all the setVTable() calls that aren't required anymoreLars Knoll2015-01-211-2/+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>
* | Remove the remaining bit of code that use the vtable in the internalClassLars Knoll2015-01-211-1/+1
| | | | | | | | | | Change-Id: Ia52f0e6db325aab37477d455f163487b319dce29 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2015-01-161-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4debugging.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4functionobject_p.h src/qml/jsruntime/qv4qobjectwrapper.cpp src/quick/scenegraph/shaders/visualization.frag tests/auto/qml/qjsengine/tst_qjsengine.cpp Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30
| * Parse dates as Qt::RFC2822Date tooAlbert Astals Cid2015-01-081-0/+2
| | | | | | | | | | | | | | | | [ChangeLog][QtQml] Fix JavaScript Date parsing to correctly accept RC2822 dates. Task-number: QTBUG-38011 Change-Id: Ic7d3f5b8c624d6780d4c3595fd2efe22c427ffd3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove most of the places where getPointer() is usedLars Knoll2014-12-201-1/+1
| | | | | | | | | | | | | | This is no longer required, and simply uglifies the code Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Revert "Properly handle negative years when printing JS Dates to strings."Ulf Hermann2014-12-121-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f06daaf3d8747c6c0a277bf055c80d8f2e7bcc81. The only things actually specified by the ECMAScript standard on dates are: 1. Reparsing a date output from any of the to*String() functions has to result in the same date representation. 2. The ISO 8601 standard has to be followed for the ISO format. Currently we clearly don't follow rule 1. Date.parse(d.toString()) will not yield the same as d.valueOf() for negative dates. The ISO 8601 standard clearly has a year 0 while common human language has not. All non ISO date representations are considered "implementation-dependent" in the ECMAScript standard. We can thus define the relation between our representations and the ISO standard any way we like. If we try to match up the dates so that the negative years look equal in each representation we cannot properly interact with QDate for dates in the year 0 as that doesn't exist in QDate. We can, however, choose not to make the dates look equal. That means a date with a negative year will be "one off" when represented in ISO 8601. "333 BC" in human language is "-332" in ISO 8601. Our internal representation is aligned to ISO 8601 and the to*String() methods may output something else. That means we can easily set the year in ISO 8601 sense from the Date constructor as well as from setYear() and setFullYear(). This, of course, is somewhat unintuitive and also differs from most other JavaScript implementations (which don't have to interoperate with QDate). However, it is still correct. Change-Id: I5fc26b709a486cb520a075918b184a80bec56c9b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add default parameter value for ScopedCallData()Oleg Shparber2014-12-121-1/+1
| | | | | | | | | | Change-Id: I16b6662a47c682e145d3e2201f9e90f58405a599 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move prototype back from the vtable into ObjectLars Knoll2014-12-111-1/+1
| | | | | | | | | | | | | | | | This is the only way we can support a GC that moves objects around in memory. Change-Id: I1d168fae4aa9f575b730e469e762bc5b5549b886 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Ported ExecutionEngine::newString and newIdentifier to Heap::StringSimon Hausmann2014-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | Avoid the use of Returned<String> for newString and changed the identifier table to use Heap::String. This required moving some code back into Heap::String, but that's code that doesn't call back into the GC, so allocations and therefore future object moves aren't possible. Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Convert methods in RuntimeHelpers to take an engine pointerLars Knoll2014-11-121-1/+1
| | | | | | | | | | | | | | This is safer and cleaner than to use a context pointer. Change-Id: Id5ef4e6667571897cd029125a0bdc18ce299da6d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move Data of Variant and ArgumentsObject into Heap namespaceLars Knoll2014-11-081-4/+4
| | | | | | | | | | Change-Id: Id2092a15c9fb5341d9b5cf4a9ac7a978308e4174 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 Object::Data into the Heap namespaceLars Knoll2014-11-081-1/+1
| | | | | | | | | | Change-Id: I9d30081f71b83bc86f5e5714e23396b18c4d54c5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move the throw methods from ExecutionContext to ExecutionEngineLars Knoll2014-11-041-21/+21
| | | | | | | | | | | | | | | | 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>
* Properly handle negative years when printing JS Dates to strings.Ulf Hermann2014-10-241-1/+7
| | | | | | | | | | JavaScript knows a year 0. That is correctly translated into QDateTime terms when creating a Date object, but it's not correctly translated back when converting the JavaScript date to a string. Task-number: QTBUG-29491 Change-Id: I46b200a144434187656d08e87f422f97523acd0e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix setUTCXxx methods in DateLars Knoll2014-09-111-18/+9
| | | | | | | | | The methods where converting doing a localtime->UTC conversion even though the input was already in UTC. Task-number: QTBUG-38448 Change-Id: I4409275fade0dd2a677af2293edc87445f853879 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 most simple objects to the new constructor schemeLars Knoll2014-07-221-3/+3
| | | | | Change-Id: I90042037bc0555771bd98233977c7d2b735bb718 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Get rid of StringRefLars Knoll2014-07-221-1/+1
| | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ExecutionContext to new storage schemeLars Knoll2014-07-221-76/+76
| | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert DateObject over to new storage schemeLars Knoll2014-07-221-1/+1
| | | | | Change-Id: I34b391a79ef80ab09e892b9a00897b90b31802ef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert Boolean, Number and DateObjectLars Knoll2014-07-221-53/+53
| | | | | 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 time zone calculationFabian Bumberger2014-04-241-1/+1
| | | | | | | | | | | | The result of local time minus global time might be negative. On QNX time_t is defined as unsigned int and thus the subtraction will not produce the expected result. This patch converts the local time and the global time to double before subtracting them. Task-number: QTBUG-35693 Change-Id: Ifa442b242a4aa23c59fa427015346150b89c9343 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Call tzset() from getLocalTZA() so we learn about tz changesIain Lane2014-03-271-0/+1
| | | | | | | | | | | | | | Per POSIX, localtime_r isn't required to call tzset(). This means that we don't notice that the timezone has changed when calling Date.timeZoneUpdated() from JS. Call this in getLocalTZA() so that it always returns results pertaining to the selected timezone. Task-number: QTBUG-37683 Change-Id: Ia9098ef0100b7c909a82b125a5ea4f39fba1f306 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use Q_ASSERT instead of assertLars Knoll2014-03-191-2/+1
| | | | | Change-Id: I6185b59a7dfd6977ce82581ab4385e07d78f13f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup our runtime methodsLars Knoll2014-03-111-3/+3
| | | | | | | | | 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-4/+4
| | | | | | | | 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 Managed::type and some flags into the vtableLars Knoll2014-01-031-1/+0
| | | | | | | | | | | | | 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 <simon.hausmann@digia.com>
* Move the vtable pointer from the object to the internal classLars Knoll2013-12-041-2/+2
| | | | | | | | 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-48/+48
| | | | | | | | | 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>