aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8
Commit message (Collapse)AuthorAgeFilesLines
* QtDeclarative fixes and workarounds for NaClwip/naclMorten Johan Sørvig2016-05-131-0/+3
| | | | | | | | | | | Make QtDeclarative run on Native Client. Some of these should be looked at more closely at a later point in time, but will do as workarounds from now. Change-Id: Ifddcb45b190c3a80c6137772a05ababb5466ea22 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Document default argument behavior of Qt.createComponent()Mitch Curtis2015-11-161-2/+15
| | | | | | | | | It's not currently clear how to get the default mode when also passing a parent, though lots of Qt code simply omits the argument. Change-Id: I35db7cf57991a2a3fafe4d00df2879b98037e93c Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Introduce a more sane "default constructor" for Qt.matrix4x4()Sean Harmer2015-11-111-0/+5
| | | | | | | | | | If no arguments are specified, create an identity matrix. This is by far the most common use case. This change avoids having to type in the 16 arguments of the identity matrix. Change-Id: I9e0d71897c5368d19ae87cff936df4b9e5e9b84a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Load component synchronously in method_createQmlObjectUlf Hermann2015-11-031-1/+6
| | | | | | | | | | | setData() is not guaranteed to synchronously load the type. In fact, most of the time, it doesn't. However, by adding a private Synchronous mode to QQmlTypeLoader we can prefetch the type synchronously and then inject it into the component. Task-number: QTBUG-45418 Change-Id: I640f12ad20c01b778b5bc41f43574d8aea504195 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-2/+2
| | | | | | | Use character literals where applicable. Change-Id: I294fc4cb5cbbd23df9735ba2b398118f37cbe08a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Add extension API to QJSEngineMitch Curtis2015-09-253-25/+43
| | | | | | | | | | | | | | | | | | | | | | This allows users in a JavaScript-only environment to install extensions including: - Translation functions (qsTr(), etc.) - The console object (console.log(), print(), etc.) - Garbage collection functions (gc()) This deprecates installTranslatorFunctions(). This API results in less clutter in the API, as we'd otherwise need to have several functions for each type of extension. [ChangeLog][QJSEngine] Introduced an extension API that allows installing various function and object extensions (qsTr(), console.log(), etc.) to QJSEngine. [ChangeLog][QJSEngine] installTranslatorFunctions() was deprecated in favor of the new extension API (see installExtensions()). Change-Id: I4d6eb2097c3eda6810e967b2e8f6441c28c91a16 Task-number: QTBUG-40772 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Speed up QQmlEngine constructorLars Knoll2015-09-252-30/+34
| | | | | | | | | | | | | | | | Freezing the global object using a script is pretty slow, esp. given that the script needs to be compiled as well. Rather do it programmatically. The old code actually had a bug that would only cause the global object to be frozen, not it's children. The new code fixes this, but doesn't completely freeze the objects. Instead it makes all the existing properties of the global object and it's children readonly, but still allows extending existing objects with new properties. Change-Id: I0d7331cdc89a0ac717b8ed3b1a490b2a3742de02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move remaining objects to new constructor syntaxLars Knoll2015-09-222-13/+11
| | | | | | | Also disable the old way of constructing objects. Change-Id: Ib4e69087cd563ae1481da116d6caf97876239798 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Convert FunctionObjects to new allocation syntaxLars Knoll2015-09-221-1/+1
| | | | | Change-Id: I269c20abdc7f9eb0d71a2d2d485d622b65405762 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Store the stack of executioncontext's on the JS stackLars Knoll2015-09-151-4/+4
| | | | | | | | | | | | | | | | This saves one pointer per allocated execution context. Now every execution context that is pushed, allocates two Values on the js stack. One contains the context itself, the other one the offset to the parent context. Things are a bit tricky for with and catch scopes, as those are called from the generated code, and can't open a Scope anymore. In addition, all methods iterating over the js stack frames need to work with ExecutionContext pointers, not ScopedContext's. Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove qml context related methods from QQmlV4FunctionLars Knoll2015-09-151-2/+0
| | | | | | | | They were only used in one place, where we can directly call the right method on the ExecutionEngine instead. Change-Id: I02bb16b07ef55ef66bbebb5a572cfbe27bcfcf7f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use the QmlContext as the scope for QQmlV4Function callsLars Knoll2015-08-201-7/+6
| | | | | | | | This further reduces our dependency on the QQmlContextWrapper and reduces storage requirements in the QObjectMethod. Change-Id: I2c12d0a8818d81d45139f482caac8510ad8dfddc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.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>
* Retrieve services from debug connector, not via static instance()Ulf Hermann2015-08-041-5/+7
| | | | | | | | | This will allow us to remove the instance() methods and create the services from factories in plugins. Also, it allows us to remove the isDebugging member from QQmlEnginePrivate. Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Extract minimal abstract interfaces from debug services.Ulf Hermann2015-08-041-2/+2
| | | | | | | | We will access the services' functionality through those interfaces once they live in their own plugins. Change-Id: I0a0d7e73c07cb874b3b507cc4a9d304588c87bca Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Extract minimal interface from QQmlDebugServer and use it.Ulf Hermann2015-07-301-3/+3
| | | | | | | | | | This will allow us to move QQmlDebugServer into a plugin. The new QQmlDebugServer is the interface exposed to connection plugins. The interface exposed to services is renamed to QQmlDebugConnector, as technically it doesn't have to be a "server". Change-Id: Id508b8c0a6960228e889f45a437b73060392db39 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove static proxy methods from QQmlDebugServiceUlf Hermann2015-07-291-2/+3
| | | | | | | | | They all internally map to one-liners and just add to binary size and complexity. Especially, the most used one, isDebuggingEnabled(), simply checks if there is a QQmlDebugServer::instance(). Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove type punning from QV4::Value.Erik Verbruggen2015-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The union in QV4::Value is used to do type punning. In C++, this is compiler-defined behavior. For example, Clang and GCC will try to detect it and try to do the proper thing. However, it can play havoc with Alias Analysis, and it is not guaranteed that some Undefined Behavior (or Compiler depenedent behavior) might occur. The really problematic part is the struct inside the union: depending on the calling convention and the register size, it results in some exciting code. For example, the AMD64 ABI specifies that a struct of two values of INTEGER class can be passed in separate registers when doing a function call. Now, if the AA in the compiler looses track of the fact that the tag overlaps with the double, you might get: ecx := someTag ... conditional jumps double_case: rdx := xorredDoubleValue callq someWhere If the someWhere function checks for the tag first, mayhem ensues: the double value in rdx does not overwrite the tag that is passed in ecx. Changing the code to do reinterpret_cast<>s might also give problems on 32bit architectures, because there is a double, whose size is not the same as the size of the tag, which could confuse AA. So, to fix this, the following is changed: - only have a quint64 field in the QV4::Value, which has the added benefit that it's very clear for the compiler that it's a POD - as memcpy is the only approved way to ensure bit-by-bit "conversion" between types (esp. FP<->non-FP types), change all conversions to use memcpy. Use bitops (shift/and/or) for anything else. - only use accessor functions for non-quint64 values As any modern compiler has memcpy as an intrinsic, the call will be replaced with one or a few move instructions. The accessor functions also get inlined, the bitops get optimized, so in all cases the compiler can generate the most compact code possible. This patch obsoletes f558bc48585c69de36151248c969a484a969ebb4 (which had the exact aliassing problem of the double and the tag as described above). Change-Id: I60a39d8564be5ce6106403a56a8de90943217006 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Cleanup retrieval of scope and context objectsLars Knoll2015-06-183-18/+10
| | | | | Change-Id: I9c6174181f950bc4f829727dc6acdfe82fa4e894 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix docs and remove an invalid ###Lars Knoll2015-06-171-4/+4
| | | | | Change-Id: I702529114d3637e48d0159a6b540134b3117b0d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove unused typedefLars Knoll2015-06-151-2/+0
| | | | | Change-Id: I19b077334705d00a2c8b2800f89962f04eb37212 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>
* Move exceptionValue and globalObject from the Engine onto the JS stackLars Knoll2015-04-243-11/+9
| | | | | | | | | We'll need to move all GC'ed objects currently stored in ExecutionEngine onto the JS stack for easier management in a new garbage collection scheme. This is the start of that change. Change-Id: Ib3ad8e846875dade8a807ea79f063173d40e4aad Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use Heap::Pointer in more placesLars Knoll2015-04-241-1/+1
| | | | | Change-Id: I2a64aadcd47ed05ad7d08a70a5d765d898a671fd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of qv4value_inl_p.h and replace it by qv4typedvalue_p.hLars Knoll2015-04-242-2/+2
| | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-3/+10
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlbinding.cpp src/qml/jsruntime/qv4arraybuffer.cpp src/qml/jsruntime/qv4functionobject.cpp Change-Id: Ic752e9dfd69b282093651c9234c110a49762f06d
| * Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Liang Qi2015-04-161-2/+9
| |\
| | * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-04-161-2/+9
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qml/debugger/qv4profilerservice/qv4profilerservice.pro tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro Change-Id: I76d87e3df97ebdba902ca3d7488c1582eca2a83c
| | | * Add note clarifying return value of Qt.openUrlExternally()Aaron McCarthy2015-04-021-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some platforms (notably wayland and xcb) the Qt.openUrlExternally() call returns as soon as the request is passed to the underlying system. The call may still fail, but this status is not reported to the application. Change-Id: I66936440f162154f08ab5abcf5b449844930a81b Reviewed-by: Valerio Valerio <valerio.valerio@jollamobile.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| * | | Speed up object creationSimon Hausmann2015-04-161-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | Avoid copying url and file name twice into the context every time we instantiate an object. Change-Id: I1c76b80b9c44f95512af5899d760151f6dcd7bb5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Get rid of asFunctionObject()Lars Knoll2015-04-212-3/+3
| | | | | | | | | | | | | | | Change-Id: Ib4858376dc0ec57fa473c80696abc66a570c90ec Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | More cleanupsLars Knoll2015-04-212-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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-1/+2
| | | | | | | | | | | | | | | Change-Id: I71816a784b5175f600c5a870318b16c0d84c42fb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Further cleanupsLars Knoll2015-04-161-1/+1
|/ / | | | | | | | | | | | | | | | | The get and getIndexed vtable methods should take a const Managed pointer. Start cleaning up the asFoo() methods in Value and Managed by removing asArrayObject() and asErrorObject(). Change-Id: Ibd49bf20773ef84c15785b7ac37a7bc9fd4745d5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix warningAleix Pol2015-03-161-1/+1
| | | | | | | | | | | | | | | | If the arguments of console.timeEnd are wrong, say it's timeEnd instead of time. Change-Id: Ida8a76cd452cf3aecc03e5064bbf213333d93a03 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add Qt.hsva() functionSean Harmer2015-02-182-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | This is more convenient than the alternative hsla() function in many cases as color pickers in other applications default to the HSV color space e.g. GIMP, kcolorchooser. [ChangeLog][QtQml] Added Qt.hsva() function Change-Id: Id5c1a78173757bf9842b164d90b31682e9a41749 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update copyright headersJani Heikkinen2015-02-128-56/+56
| | | | | | | | | | | | | | | | | | 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-174/+174
| | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | Change-Id: Icd76d3d03fac2e57530e55f8ec15b97109dcdcbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of most uses of ValueRefLars Knoll2015-01-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Rework QJSValue internalsLars Knoll2015-01-211-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Use a flagged pointer to either store a pointer to a QV4::Value (from the persistent storage) or a pointer to a QVariant in QJSValue::d. Like this we don't need to malloc to create a QJSValue for most use cases. Significantly reduces the memory consumption of QJSValue and speeds it up a lot. Change-Id: I10902cc4b6cc3f43d3f816875dc6c4bbb6b4490f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of all uses of Managed::engine()Lars Knoll2015-01-211-1/+1
| | | | | | | | | | Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Remove all the setVTable() calls that aren't required anymoreLars Knoll2015-01-211-3/+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>
* | Move vtable out of internalClassLars Knoll2015-01-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can move the internalClass to Object later on, and such save having the internalClass on lots of Heap objects. This commit basically adds and starts making use of a new vtable pointer in Heap::Base. In addition, the construction methods in the memory manager now automatically setup the correct vtable. Removing the vtable code from InternalClass and moving it into Object will come in a separate commit Change-Id: If49e8d73c769bf65bf47fe4dbf8b9546c8019dbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Expose QStyleHints as Qt.styleHintsJ-P Nurmi2015-01-172-0/+8
| | | | | | | | | | Change-Id: I0fc94e680b011963e645bdbf51110820751e53aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix Qt.inputMethod ownershipJ-P Nurmi2015-01-171-1/+0
| | | | | | | | | | Change-Id: Ic51f9daf17742a421a810d95b2a510caf657e08f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Refactor persistent valuesLars Knoll2015-01-161-3/+6
| | | | | | | | | | | | | | | | | | | | Use a page wise allocation mechanism for persistent values. This significantly reduces memory consumption of persistent values and also improves their performance a lot. Change-Id: I8499d2ca5bdd871e029f643ae605a94544558bb5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Redirect console.info to new QtInfoMsgKai Koehne2015-01-152-2/+12
| | | | | | | | | | Change-Id: I6f4560a3baae16dd6db090d51a577060689825ef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Make sure we always have an engine when assigning to a PersistentLars Knoll2015-01-131-1/+1
| | | | | | | | | | | | | | This prepares things for a rewrite of the internals of Persistent. Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of the bindingKeyFlagLars Knoll2015-01-121-1/+0
| | | | | | | | | | | | | | | | | | Instead use the vtable to identify that we have a binding function. Change-Id: I794aebb6fb83f648ba36f2f15cad94d2af3cae91 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>