aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4dateobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Convert Boolean, Number and DateObjectLars Knoll2014-07-221-53/+53
| | | | | Change-Id: I8815578422fe1af87eb5f02899f35131fea70b76 Reviewed-by: Simon Hausmann <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* Use Q_ASSERT instead of assertLars Knoll2014-03-191-2/+1
| | | | | Change-Id: I6185b59a7dfd6977ce82581ab4385e07d78f13f6 Reviewed-by: Simon Hausmann <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* Generalize check for localtime_rKai Koehne2013-11-081-6/+6
| | | | | | | | | | | | | | | Use the _POSIX_THREAD_SAFE_FUNCTIONS define to decide whether localtime_r is available, instead of guessing by Mingw-w64 version. This copies the logic of qdatetime.cpp in qtbase, and should fix compilations with older Mingw-w64 versions. It replaces ce3e8f93c. Task-number: QTBUG-34038 Change-Id: Iee8a9aa61d2af3e069e6365c40f81007c479d147 Reviewed-by: Mark Brand <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* Fix various compiler warnings in order to remove warn_off in the near futureErik Verbruggen2013-11-041-8/+8
| | | | | Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a Reviewed-by: Simon Hausmann <[email protected]>
* Fix compilation with Mingw.org headersKai Koehne2013-10-311-0/+7
| | | | | | | | | | Mingw.org (gcc 4.7.2) does not provide an implementation of localtime_r. Anyhow, the localtime() in the Windows runtime is thread safe, so we can use localtime() instead. Change-Id: I387e0dcc22e519777fa9ceb9ad6a8b030d0438c1 Task-number: QTBUG-34038 Reviewed-by: Simon Hausmann <[email protected]>
* Avoid side effects when en exception has been thrown.Lars Knoll2013-10-291-20/+20
| | | | | | | | | | | | | | 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 API for Object::define*PropertyLars Knoll2013-09-281-7/+9
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <[email protected]>
* Remove Value::fromString()Lars Knoll2013-09-281-10/+10
| | | | | | | | replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <[email protected]>
* Move Value::toInteger(double) and related to PrimitiveLars Knoll2013-09-281-3/+3
| | | | | | | Also clean up a few other direct uses of Value Change-Id: Ie27d42c1b31b9e6d16d0a60071cb5e4e1c5b9e8b Reviewed-by: Simon Hausmann <[email protected]>
* Move Value::fromBool, ... to a new Primitive classLars Knoll2013-09-281-2/+2
| | | | | | | | This will simplify finding the remaining direct usages of QV4::Value that need fixing. Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed Reviewed-by: Simon Hausmann <[email protected]>
* Fix CallContext to not hold arguments on the C stack anymoreLars Knoll2013-09-281-66/+66
| | | | | Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b Reviewed-by: Simon Hausmann <[email protected]>
* 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 <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* Use a StringRef for Managed::get()Lars Knoll2013-09-221-3/+4
| | | | | | | | | 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-54/+54
| | | | | Change-Id: I99125908a9bc1d41a2642c409af9704def7a0832 Reviewed-by: Simon Hausmann <[email protected]>
* Further work towards an exact GCLars Knoll2013-09-221-44/+49
| | | | | | | | | | | 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]>
* Correctly convert an invalid QDateTime to JSLars Knoll2013-09-181-1/+1
| | | | | | | Task-number: QTBUG-33539 Change-Id: I645db2e12e3b46731c0bef04e2d48abb71650974 Reviewed-by: Simon Hausmann <[email protected]>
* Convert a few more methods in ExecutionEngine to use protected pointersLars Knoll2013-09-181-2/+4
| | | | | Change-Id: I2e6b1b9dff52bbd16f35a00152c9ac557f8346eb Reviewed-by: Simon Hausmann <[email protected]>
* Convert builtin methods to return a ReturnedValueLars Knoll2013-09-181-99/+99
| | | | | Change-Id: I6b75adbf53a5be0deab023d2eed98ce2a7915551 Reviewed-by: Simon Hausmann <[email protected]>
* Use ReturnedValue for Managed::get().Lars Knoll2013-09-181-1/+2
| | | | | Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca Reviewed-by: Simon Hausmann <[email protected]>
* Use ReturnedValue for Managed::construct()Lars Knoll2013-09-181-2/+2
| | | | | Change-Id: I9e702d60c4e1b7ba19a699ff7a8d53876d6cd5f7 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-1/+1
| | | | | | | | 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-3/+3
| | | | | Change-Id: Ief2d75e9789dd367c603d90dc0fe5316a0d055e3 Reviewed-by: Simon Hausmann <[email protected]>
* Continue conversion to using scoped valuesLars Knoll2013-09-111-9/+11
| | | | | | | | | | | 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]>
* Change signature of call/construct() to take a pointer to a CallDataLars Knoll2013-09-111-12/+12
| | | | | Change-Id: I5467aadba083e4b01fb0a7170946695207033680 Reviewed-by: Simon Hausmann <[email protected]>
* Move CallData onto the JS stackLars Knoll2013-09-111-9/+4
| | | | | Change-Id: I22e853acfd2da337344b581bb0412c5f9930c510 Reviewed-by: Simon Hausmann <[email protected]>
* Cleanup calls to Object::setPrototype()Lars Knoll2013-09-021-1/+1
| | | | | | | | Rather use the correct internalClass directly when constructing the objects. Change-Id: I8e916f1ce8f83d291c08ca6332fe85b1f57b90b5 Reviewed-by: Simon Hausmann <[email protected]>
* change calling convention for JS function callsLars Knoll2013-09-021-16/+18
| | | | | | | | | | | | 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]>
* wince: Build fix, disable the assembler when JIT is disabled.Sérgio Martins2013-08-291-1/+0
| | | | | Change-Id: Ibd22f27401c3751bc64749c6f1eea3aba57d66eb Reviewed-by: Simon Hausmann <[email protected]>
* Restructure source codeLars Knoll2013-08-081-0/+1316
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]>