aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_def_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix compiler warnings with mingw64.Erik Verbruggen2013-11-181-24/+24
| | | | | | | Task-number: QTBUG-34152 Change-Id: Ibb93d1cac8c343a7ca34ce7d010f24fc56ba89df Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Move Primitive::emptyValue() to qv4value_def_p.h.Friedemann Kleint2013-11-091-0/+8
| | | | | | | | | | | | Silence MinGW-warnings: warning: 'static QV4::Primitive QV4::Primitive::emptyValue()' redeclared without dllimport attribute after being referenced with dll linkage Task-number: QTBUG-34152 Change-Id: Id6971a20f1901022ab0d1c8f1834b135c71510ae Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Refactor marking GC'ed objectsLars Knoll2013-11-051-2/+2
| | | | | | | | | | | Don't use recursive function calls anymore. Instead, push marked objects onto the JS stack, and then pop them off when their children are being marked. Should reduce stack memory usage, and improves performance by ~5%. Change-Id: I2d37d97579144fcba87ec8e9fd545dd220c01fbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimise code generation for convertTypeToSInt32Lars Knoll2013-10-111-1/+2
| | | | | | | | Add 64 bit code patch and avoid some duplicated calculation in 32 bit mode Change-Id: I0e111de8ac4e733aa8802c49b4b15d785688d7ea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build on Android with -developer-buildSimon Hausmann2013-10-111-1/+1
| | | | | | | | | | | | That configuration implies -Werror for some kind of warnings. This patch fixes * Mix of different types in conditional (qv4isel_masm.cpp) * Noreturn function returning instead of calling another noreturn function at the end (qv4engine_cxxabi.cpp) * An out-of-line function being declared inline Task-Number: QTBUG-33998 Change-Id: I3ba58dcadeac6774c5de63e6bb551354a2f23332 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Smaller cleanupsLars Knoll2013-10-111-1/+2
| | | | | Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Reshuffle inlined functions to fix MinGW-warnings.Friedemann Kleint2013-10-051-18/+58
| | | | | | | | | | | | | | | | | | | When compiling QtQuick: qv4value_p.h:80:17: warning: 'QV4::Managed* QV4::Value::asManaged() const' redeclared without dllimport attribute after being referenced with dll linkage ^ qv4value_p.h:180:14: warning: 'static QV4::Value QV4::Value::fromManaged(QV4::Managed*)' redeclared without dllimport attribute after being referenced with dll linkage ^ qv4value_p.h:285:16: warning: 'QV4::String* QV4::Value::asString() const' redeclared without dllimport attribute after being referenced with dll linkage Change-Id: I548a2f8049b8eca06ab1061f56416a332820dc01 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Cleanup API of Safe<T>Lars Knoll2013-10-021-4/+4
| | | | | | | | Don't have an implicit cast operator to Returned<T> anymore, and return a T* from the operator->() Change-Id: If4165071b986bfc84a157560d94d39c2dcfbc9e1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use SafeValue instead of Value in ScopedValue methodsLars Knoll2013-10-021-3/+15
| | | | | Change-Id: Ie463efe600d498ce77d4b9e8b48abcfd61c1ab78 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more uses of ValueLars Knoll2013-10-021-1/+1
| | | | | Change-Id: I889e760f75b485a28e1f2a2c26b2337ae9bfafac Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix ObjectIterator API to be GC safeLars Knoll2013-10-021-0/+2
| | | | | Change-Id: I3a9c48d53d8dbadcb9b32c00fcef1f89447c4b8c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix API for Object::define*PropertyLars Knoll2013-09-281-1/+1
| | | | | | | use ValueRef instead of const Value &. Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Less QV4::Value usageLars Knoll2013-09-281-0/+11
| | | | | | | | Fix some usages in qv4engine, and fix return types in methods in qqmlxmlhttprequest. Change-Id: I3d6225ca01bf7ea77fcc424914c8392bb6c3a454 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove Value::fromString()Lars Knoll2013-09-281-5/+2
| | | | | | | | replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove more direct QV4::Value usageLars Knoll2013-09-281-1/+0
| | | | | | | | 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-5/+6
| | | | | | | 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-6/+13
| | | | | | | | 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>
* Use SafeValue in more placesLars Knoll2013-09-281-1/+1
| | | | | Change-Id: Ic15c1419c74f22bd7639ce8746ff11b15240b718 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make parts of qv8engine_p.h GC safeLars Knoll2013-09-261-0/+1
| | | | | Change-Id: Iaa15423cedc307a09b3cd7287272d93d7a604caf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prevent objects from being collected while in their constructorLars Knoll2013-09-221-0/+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>
* Add a Safe<T> class and start using itLars Knoll2013-09-221-0/+16
| | | | | | | | | | 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 <simon.hausmann@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Further work towards an exact GCLars Knoll2013-09-221-0/+31
| | | | | | | | | | | 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 <simon.hausmann@digia.com>
* Refactor our NaN boxing to be more efficientLars Knoll2013-09-181-70/+131
| | | | | | | | | | | | | * Use a unified way to store all Managed objects inside a Value, instead of distinguishing between strings and other objects. * On 64 bit we store pointers as pointers, so accessing them through Scoped<> objects is cheap. This implies that doubles are now stored in a mangled form (xor'ed with a mask). Change-Id: I582e0fb167a62c0c527c6bfa3452550e37944069 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Optimize some runtime methodsLars Knoll2013-09-181-0/+1
| | | | | | | This prings performance up by ~25% again. Change-Id: I680466e11b722b2eac0edda0fe4199b717d23855 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use ReturnedValue for Managed::get().Lars Knoll2013-09-181-2/+0
| | | | | Change-Id: Ia8f35d227b69d32e1f6a041283abbbd083aa34ca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ReturnedValue into a primitive (typedef to quint64)Lars Knoll2013-09-121-0/+3
| | | | | | | | | | | ReturnedValue is used to return values from runtime methods The type has to be a primitive type (no struct or union), so that the compiler will return it in a register on all platforms. They will be returned in rax on x64, [eax,edx] on x86 and [r0,r1] on arm. Change-Id: I38433e6fad252370dda5dc335d9c5be8f22e8c76 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use a ReturnedValue when converting to String or ObjectLars Knoll2013-09-121-0/+1
| | | | | | | | Also rename Value::toQString() to Value::toQStringNoThrow(), and add a throwing toQString() method for JS use. Change-Id: I821b33fc61abb7d08839df965fd337685f61a545 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Start adapting function signatures in the qv4runtimeLars Knoll2013-09-111-2/+0
| | | | | | | | Move the signatures over to something that will enforce the exact GC later on. Change-Id: I2e1a472aea296cc1862c76c1e6dab5d0d2f5177c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add ValueRef classe and use it to make things GC safeLars Knoll2013-09-111-0/+2
| | | | | | | | | | | | The ValueRef class holds a reference to a Value that is already known to the GC. ValueRef's should be used to pass Value arguments to methods. As a first step us the class to make unary operations GC safe Change-Id: Ie13e332ed95b2908df9a201a3f757db864c05ca9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add Value::isNullOrUndefined()Lars Knoll2013-09-021-0/+2
| | | | | | | Allows for some smaller optimization in the call stack. Change-Id: Id5beeb04e9f9dbf9e61280cee7bf6758a4c02310 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Restructure source codeLars Knoll2013-08-081-0/+282
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 <simon.hausmann@digia.com>