platform/upstream/qtdeclarative.git
9 years agoRemove the remaining uses of Returned<T>
Simon Hausmann [Tue, 11 Nov 2014 22:30:54 +0000 (23:30 +0100)]
Remove the remaining uses of Returned<T>

Change-Id: I493b75365d3c6fbf6965986d73e7aa0b659ded67
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoChanged MemoryManager::alloc<T> to return Heap::T* instead of T*
Simon Hausmann [Tue, 11 Nov 2014 17:08:20 +0000 (18:08 +0100)]
Changed MemoryManager::alloc<T> to return Heap::T* instead of T*

Change-Id: Iede1ba624d1313fbe2f8e5e979e936f1f32efdc9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoPorted the WebSQL module to the new V4 heap layout
Simon Hausmann [Tue, 11 Nov 2014 17:05:33 +0000 (18:05 +0100)]
Ported the WebSQL module to the new V4 heap layout

Change-Id: I5c6e36f80ebab29c86fed51bac3d4fd9b0126fb0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoReplaced more usages of Returned<T> with Heap::T*
Simon Hausmann [Tue, 11 Nov 2014 16:27:49 +0000 (17:27 +0100)]
Replaced more usages of Returned<T> with Heap::T*

Change-Id: I451128ee71610bfeb71139c28da89a00a8209ec6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoPorted ExecutionEngine::newString and newIdentifier to Heap::String
Simon Hausmann [Tue, 11 Nov 2014 14:08:30 +0000 (15:08 +0100)]
Ported ExecutionEngine::newString and newIdentifier to Heap::String

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>
9 years agoPorted most ExecutionEnginew::new* factory methods away from Returned<T>
Simon Hausmann [Tue, 11 Nov 2014 12:34:18 +0000 (13:34 +0100)]
Ported most ExecutionEnginew::new* factory methods away from Returned<T>

We don't need Returned<T> anymore with the QV4:: vs. Heap:: separation.
Eliminating Returned<T> simplifies also some code.

Change-Id: Ic2a9cd3c1a94f2ea37b539d3984d63997121c2b9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoChange signature or runtime methods to take an engine pointer
Lars Knoll [Tue, 11 Nov 2014 15:07:54 +0000 (16:07 +0100)]
Change signature or runtime methods to take an engine pointer

This makes a lot more sense in the long term and is the
more maintainable solution, once the GC starts moving
objects around in memory

Change-Id: I8f327c0f5b5b0af38c5fe1a217852ee8c4a5c2fc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUse heap objects in the remaining managed objects
Lars Knoll [Mon, 10 Nov 2014 20:27:52 +0000 (21:27 +0100)]
Use heap objects in the remaining managed objects

Change-Id: Id6dc6e34113a287a40e0122dfbdf977f0fc1f3b3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUse Heap objects inside argumentsobject, arraybuffer and errorobject
Lars Knoll [Mon, 10 Nov 2014 15:21:38 +0000 (16:21 +0100)]
Use Heap objects inside argumentsobject, arraybuffer and errorobject

Change-Id: Iad76a1351dcca1fd46303a1072540c23a8ef6722
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoStore Heap objects in the qml binding wrapper
Lars Knoll [Mon, 10 Nov 2014 15:06:43 +0000 (16:06 +0100)]
Store Heap objects in the qml binding wrapper

Change-Id: I7fae0710d148a2b07ec5f36a7fb96c2b645e564e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanups
Lars Knoll [Fri, 7 Nov 2014 18:07:54 +0000 (19:07 +0100)]
Cleanups

Remove a few reinterpret_cast's

Change-Id: I800b8c41123eaa22cf879571c747b4de0375e8cb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoConvert methods in RuntimeHelpers to take an engine pointer
Lars Knoll [Fri, 7 Nov 2014 17:51:19 +0000 (18:51 +0100)]
Convert methods in RuntimeHelpers to take an engine pointer

This is safer and cleaner than to use a context pointer.

Change-Id: Id5ef4e6667571897cd029125a0bdc18ce299da6d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanup debugger to be safe for the new GC
Lars Knoll [Mon, 10 Nov 2014 09:50:37 +0000 (10:50 +0100)]
Cleanup debugger to be safe for the new GC

Added a bit of convenience to PersistentValue as well.

Change-Id: I5a858079543b41ce1ef48a84e9350a7d6fa64501
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoStore all data members in FunctionObject as heap data
Lars Knoll [Fri, 7 Nov 2014 17:10:30 +0000 (18:10 +0100)]
Store all data members in FunctionObject as heap data

Change-Id: Ic061baaf7f5ff08c5e6e7130abd6a650148d3d2d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove unused method
Lars Knoll [Fri, 7 Nov 2014 05:00:07 +0000 (06:00 +0100)]
Remove unused method

Change-Id: I3ec2f9b70d5285ff088f4fc498ccb14de7f8838c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoConvert ExecutionContext::parent/outer to use a heap object
Lars Knoll [Fri, 7 Nov 2014 04:46:20 +0000 (05:46 +0100)]
Convert ExecutionContext::parent/outer to use a heap object

Change-Id: I1b8ee831cfcdd5b1904ce24a341f5a796dce41cf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix regression in handling of arguments objects
Lars Knoll [Tue, 11 Nov 2014 17:47:17 +0000 (18:47 +0100)]
Fix regression in handling of arguments objects

Make sure the mappedArguments object gets properly created and is
large enough before using it.

Change-Id: Icb3c937483b49a7856d8d075d53fc10a11044840
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMerge QQmlAccessible into QAccessibleQuickItem
Frederik Gladhorn [Mon, 27 Oct 2014 14:21:32 +0000 (15:21 +0100)]
Merge QQmlAccessible into QAccessibleQuickItem

The idea of the separation was to keep Qt Quick 1 and 2 accessibilty in
sync. This is not going to happen because Qt Quick 1 accessibility was
never supported and will not be in the future either, so instead remove
code duplication and merge the two classes.

Change-Id: I508eb0ae20ab22ee92806a4c648c39b35259b6b9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoUse Heap object for CallData::function member
Lars Knoll [Fri, 7 Nov 2014 04:24:24 +0000 (05:24 +0100)]
Use Heap object for CallData::function member

Change-Id: I5cae1b16c68751da9481a1cdae2601efa2a500a2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUse Heap objects as members
Lars Knoll [Fri, 7 Nov 2014 02:37:02 +0000 (03:37 +0100)]
Use Heap objects as members

Change-Id: I4f447747480fb7e15975b810e2a8623acc9cde61
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove data for objects in QtQuick into the Heap namespace
Lars Knoll [Fri, 7 Nov 2014 02:13:29 +0000 (03:13 +0100)]
Move data for objects in QtQuick into the Heap namespace

Change-Id: Ic9d5946a8e60d235b8442b964dd1478363626441
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove data for remaining objects in QtQml into the Heap namespace
Lars Knoll [Fri, 7 Nov 2014 01:57:01 +0000 (02:57 +0100)]
Move data for remaining objects in QtQml into the Heap namespace

Change-Id: Iefef658dc246b5087d5061d964f08378b56c6cef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove XHR object data to Heap namespace
Lars Knoll [Fri, 7 Nov 2014 01:56:33 +0000 (02:56 +0100)]
Move XHR object data to Heap namespace

Change-Id: I6c18132917f4609fda80813c6e2b696b1146efa7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove data of more Qml related objects into Heap namespace.
Lars Knoll [Fri, 7 Nov 2014 01:06:42 +0000 (02:06 +0100)]
Move data of more Qml related objects into Heap namespace.

Change-Id: Ifb3a7093351474d6feb2f64498b531c36fdf669b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove data of some Qml related objects into Heap namespace.
Lars Knoll [Fri, 7 Nov 2014 00:34:29 +0000 (01:34 +0100)]
Move data of some Qml related objects into Heap namespace.

Change-Id: I6e6b24466de1e49efd5f3eaa67db82873170445b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data for typedarrays into Heap namespace
Lars Knoll [Thu, 6 Nov 2014 16:40:48 +0000 (17:40 +0100)]
Move Data for typedarrays into Heap namespace

Change-Id: I1737423c22e0c68c9eaa14f6d4f5b1e48aea4a77
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove more Data objects into the Heap namespace
Lars Knoll [Thu, 6 Nov 2014 16:17:34 +0000 (17:17 +0100)]
Move more Data objects into the Heap namespace

Change-Id: I87866f8dcbaac1087da7bbd2902aa5b062afca53
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data of error objects into the Heap namespace
Lars Knoll [Thu, 6 Nov 2014 16:04:39 +0000 (17:04 +0100)]
Move Data of error objects into the Heap namespace

Change-Id: I893095107eaadf38959a4e489d92ef66b2f9e81d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data of the builtin functions to the Heap namespace
Lars Knoll [Tue, 4 Nov 2014 14:34:56 +0000 (15:34 +0100)]
Move Data of the builtin functions to the Heap namespace

Change-Id: I8a77fe3fa9b6538cf6c75817eae7dc34df8ab329
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data of Variant and ArgumentsObject into Heap namespace
Lars Knoll [Tue, 4 Nov 2014 14:25:09 +0000 (15:25 +0100)]
Move Data of Variant and ArgumentsObject into Heap namespace

Change-Id: Id2092a15c9fb5341d9b5cf4a9ac7a978308e4174
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUse Heap namespace for data of QObjectWrapper related classes
Lars Knoll [Mon, 3 Nov 2014 19:46:55 +0000 (20:46 +0100)]
Use Heap namespace for data of QObjectWrapper related classes

Change-Id: Id6c3af9e4f995972ae3bec465b2fd293be05de4c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove more Data members over to the Heap namespace
Lars Knoll [Mon, 3 Nov 2014 19:41:17 +0000 (20:41 +0100)]
Move more Data members over to the Heap namespace

Change-Id: I74347da3f0f47220bb1f8cf13b872b547fd18a4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data of FunctionObject and related classes into Heap
Lars Knoll [Mon, 3 Nov 2014 02:17:57 +0000 (03:17 +0100)]
Move Data of FunctionObject and related classes into Heap

Change-Id: Iadf74f953798c1884e0ec704ccb7c70d971e3273
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data for String into the Heap namespace
Lars Knoll [Mon, 3 Nov 2014 01:29:08 +0000 (02:29 +0100)]
Move Data for String into the Heap namespace

Change-Id: Iefa231106b77db6d4c9d4ded2b028d21eb94ab03
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Data for Number/Boolean/ArrayObject into the Heap
Lars Knoll [Sat, 1 Nov 2014 22:59:06 +0000 (23:59 +0100)]
Move Data for Number/Boolean/ArrayObject into the Heap

Change-Id: Ifc1c38b00f1b6b11e69caeb195429e2dd4c05d4f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove Object::Data into the Heap namespace
Lars Knoll [Sat, 1 Nov 2014 22:50:32 +0000 (23:50 +0100)]
Move Object::Data into the Heap namespace

Change-Id: I9d30081f71b83bc86f5e5714e23396b18c4d54c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanup RegExp
Lars Knoll [Sat, 1 Nov 2014 22:29:21 +0000 (23:29 +0100)]
Cleanup RegExp

Move it's Data into the Heap namespace.

Change-Id: I4ed6ea481376ae1d0c1fb08b56feee4764083231
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRefactor ExecutionContexts
Lars Knoll [Sat, 1 Nov 2014 22:24:13 +0000 (23:24 +0100)]
Refactor ExecutionContexts

Move the Data class out into the Heap namespace.

Change-Id: I2b798deb53812a08155c92a0e6ef2dcd2ea137b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoBegin moving the data out of Managed objects
Lars Knoll [Sat, 1 Nov 2014 22:04:20 +0000 (23:04 +0100)]
Begin moving the data out of Managed objects

We need to move the Data objects out of the Managed
objects, to avoid lots of trouble because inner classes
can't be forward declared in C++.

Instead move them all into a Heap namespace.

Change-Id: I736af60702b68a1759f4643aa16d64108693dea2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoQQuickRepeater::clear: Remove items from the end backwards.
Robin Burchell [Wed, 5 Nov 2014 02:23:45 +0000 (18:23 -0800)]
QQuickRepeater::clear: Remove items from the end backwards.

This way, the indices for itemRemoved will make sense consistently.

This was broken with 5f5aba5b6e690ca54e66f41b93474f7e67e83c8b, dated November
2011.

Task-number: QTBUG-42243
Change-Id: I5fecfd4174049f51e0cec90e40e6332de5d5bf01
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoGet rid of Members and directly store MemberData::Data pointers
Lars Knoll [Sat, 1 Nov 2014 20:44:57 +0000 (21:44 +0100)]
Get rid of Members and directly store MemberData::Data pointers

And do the same change for ArrayData.

Change-Id: Ia1ae56bd0ff586c9b987e15af7a53f395a37054a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdd scroll and page accessible actions
Frederik Gladhorn [Mon, 27 Oct 2014 15:31:47 +0000 (16:31 +0100)]
Add scroll and page accessible actions

Task-number: QTBUG-39189
Task-number: QTBUG-41980
Change-Id: I135c1b4fcf609a65b3895177385d236b50dfac6f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Simon Hausmann [Wed, 5 Nov 2014 06:04:07 +0000 (22:04 -0800)]
Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
src/qml/jsruntime/qv4errorobject_p.h

Change-Id: I7fc1211295738a9fae32b783a9f001f1613785e4

9 years agoLet markObjects() operate directly on HeapObjects
Lars Knoll [Sat, 1 Nov 2014 19:56:47 +0000 (20:56 +0100)]
Let markObjects() operate directly on HeapObjects

This decouples things a bit better and helps moving
over to directly store heapobject pointers in other
objects.

Change-Id: I798f922e018b0a3ca6f8768e4a810187f34d82f6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove the throw methods from ExecutionContext to ExecutionEngine
Lars Knoll [Mon, 28 Jul 2014 08:07:57 +0000 (10:07 +0200)]
Move the throw methods from ExecutionContext to ExecutionEngine

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>
9 years agoCleanup header file dependencies
Lars Knoll [Fri, 25 Jul 2014 15:44:14 +0000 (17:44 +0200)]
Cleanup header file dependencies

Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove some unneeded reinterpret_cast's
Lars Knoll [Thu, 24 Jul 2014 20:32:38 +0000 (22:32 +0200)]
Remove some unneeded reinterpret_cast's

Change-Id: I29ebc1f06bb3f0d20e6e21840c7fe326a0f4546d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove most calls to Value::managed()
Lars Knoll [Thu, 24 Jul 2014 09:53:59 +0000 (11:53 +0200)]
Remove most calls to Value::managed()

Change-Id: Id5b1cca542421d749711eff68520a4138ec95531
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoqv4: assign split edges to the correct loop group
Fawzi Mohamed [Tue, 4 Nov 2014 13:55:26 +0000 (14:55 +0100)]
qv4: assign split edges to the correct loop group

edge splitting had a strange logic to assign the inserted statement to a loop,
which would go wrong for example for the statement just after the loop header.
I guess that was done to increase the likelihood that the goto removed from the
final instructions.
Given that we are talking about critical edges it is always possible to emit
them in a bad order, and I do not think that the old logic was really better
than simply always use the loop group of the target which is always correct.
It might be worthwhile to ensure that the block it is emitted just before the
target block, or improve the handling of empty gotos in the backend, but in this
patch we go for the simplest solution.
If one would notice worse code, either one of the provious improvements could be
done, or the old logic could be kept, changing just the if (container == 0) to
container = toBB->containingGroup();

Change-Id: I26a488e9e2cb2b692fa8187ee658fb4dd98bfa8b
Task-number: QTBUG-41766
Reviewed-by: Bernd Lamecker <bernd.lamecker@basyskom.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoChanged Value to store Managed::Data pointers directly
Simon Hausmann [Wed, 23 Jul 2014 11:56:43 +0000 (13:56 +0200)]
Changed Value to store Managed::Data pointers directly

This is a step towards storing direct heap object pointers for the values
on the JS stack, to avoid the costly indirection for data access.

Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix memory leak in QQmlLocaleData
Liang Jian [Tue, 4 Nov 2014 09:18:15 +0000 (17:18 +0800)]
Fix memory leak in QQmlLocaleData

Call the correct destructor in QQmlLocaleData::destroy() to prevent memory
leak.

Change-Id: Id5b7657443521fbb46486bfbc5575d914c7c7b71
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix disappearing nodes when adding in two levels of batch root
Eskil Abrahamsen Blomfeldt [Thu, 30 Oct 2014 08:08:00 +0000 (09:08 +0100)]
Fix disappearing nodes when adding in two levels of batch root

When having e.g. a clip node inside another clip node and adding
children to the innermost, we would get into the situation where
we did a partial rebuild for the outermost root, but its available
render order count would not be updated to reflect the change
deeper down in the tree. Since the z range would be based on the
outermost batch root's knowledge of the maximum render order in
the tree, what would happen is that the z of the rendered nodes
would increase steadily until they went outside of the viewing
volume and disappeared.

When decreasing the available order count of a batch root, we need
to also decrease the available order count of its parents. If any
of them drop below zero, we need to rebuild the render lists.

[ChangeLog][QtQuick] Fixed nodes sometimes disappearing when
adding many new nodes to the tree.

Change-Id: I39c34acf0e1e0e87601f0fcd983f8da38cee029f
Task-number: QTBUG-42096
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoCleanup: Get rid of String and Object pointers in Value
Simon Hausmann [Wed, 23 Jul 2014 10:37:17 +0000 (12:37 +0200)]
Cleanup: Get rid of String and Object pointers in Value

Change-Id: I4f007d0437c9a5cc79fe35d960d40557366d46fe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix memory leak in QV4::QQmlSequence
Liang Jian [Tue, 4 Nov 2014 00:32:28 +0000 (08:32 +0800)]
Fix memory leak in QV4::QQmlSequence

Use the correct destructor in QV4::QQmlSequence::destroy() to prevent
memory leak

Change-Id: If9531f731abe5cd9aecfb9642ebf4f5108978f99
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoCleanup: Remove duplicated code
Simon Hausmann [Mon, 3 Nov 2014 02:23:29 +0000 (18:23 -0800)]
Cleanup: Remove duplicated code

arrayFromStringList is identical to ExecutionEngine's newArrayObject
overload that takes a QStringList

Change-Id: I17fed4703d0d6647d6ca44a0069834ce0da8d22c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoDoc: Qt Quick Designer UI forms
Leena Miettinen [Tue, 28 Oct 2014 13:41:13 +0000 (14:41 +0100)]
Doc: Qt Quick Designer UI forms

Since Qt Creator 3.3 and Qt 5.4, Qt Quick Designer
handles .ui.qml files that are similar to the .ui
files of Qt Designer.

Change-Id: I147e82a111ca7d3b806c4c6c94cc73b35a67785b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
9 years agoRemove unused file
Simon Hausmann [Sun, 2 Nov 2014 11:24:44 +0000 (03:24 -0800)]
Remove unused file

Change-Id: I16ae59257040594ce9921d29ddb13e2cefaf1075
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoFix memory leak caused by QV4::ErrorObject
Jian Liang [Sun, 2 Nov 2014 11:01:23 +0000 (19:01 +0800)]
Fix memory leak caused by QV4::ErrorObject

We should destruct QV4::ErrorObject::Data instead of QV4::ErrorObject in
QV4::ErrorObject::destroy() since all the members is stored in
QV4::ErrorObject::Data.

Task-number: QTBUG-42340
Change-Id: Ifff6413c0726591c335a421a5f289c1886f80980
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoUse an allocator for QSGBatchRenderer::Node and Element instances.
Gunnar Sletta [Wed, 22 Oct 2014 11:32:27 +0000 (13:32 +0200)]
Use an allocator for QSGBatchRenderer::Node and Element instances.

Cuts down quite a bit on the time spent on the render thread during
the sync phase.

Change-Id: Ide8c4348141c84ed8abd9a869607a022652c2828
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoQQuickTextEdit: don't ifdef out properties
J-P Nurmi [Tue, 9 Sep 2014 15:35:38 +0000 (17:35 +0200)]
QQuickTextEdit: don't ifdef out properties

Take out the implementation body instead. These conditional properties
are causing trouble for controls (invalid alias location).

Change-Id: I509c6a156b8f6c6fa12488bfc5e301f60346f8a5
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
9 years agoQQuickTextInput: don't ifdef out properties
J-P Nurmi [Tue, 9 Sep 2014 15:35:33 +0000 (17:35 +0200)]
QQuickTextInput: don't ifdef out properties

Take out the implementation body instead. These conditional properties
are causing trouble for controls (invalid alias location).

Change-Id: I055e149a4fe2d4d5d0c62d21e5f5368e9973c512
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
9 years agoFix typo in Q_ASSERT_X warning.
Gunnar Sletta [Sat, 1 Nov 2014 09:33:24 +0000 (10:33 +0100)]
Fix typo in Q_ASSERT_X warning.

Change-Id: I1415de93af35177fd643c21bcae2492a79187e50
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoFix beforePaint node calculation further.
Gunnar Sletta [Sat, 1 Nov 2014 09:24:28 +0000 (10:24 +0100)]
Fix beforePaint node calculation further.

Aborting when the extra wasn't allocated was just wrong. In addition
we didn't check for visibility/effectRefs which brought this
implementation out of sync with the children we added/removed in
the ChildUpdateMask block up above.

Change-Id: Ie174a683bb3712e392fece1636844e30574a1406
Task-number: QTBUG-42207
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Simon Hausmann [Fri, 31 Oct 2014 19:20:43 +0000 (20:20 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev

Change-Id: I30f9c925631991ceb22339d1333936faecffbaf4

9 years agoDon't use qDebug and qWarning for formatted output
Thiago Macieira [Tue, 2 Sep 2014 19:21:04 +0000 (12:21 -0700)]
Don't use qDebug and qWarning for formatted output

They are not meant to be used like that. If you want formatted output to
the console, use stdio.h functions or std::cout. Otherwise, you get
something like:

 $ qmlscene -h
 [233103.196] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?): Usage: qmlscene [options] <filename>
 [233103.197] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?):
 [233103.197] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?):  Options:
 [233103.198] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?):   --maximized ............................... Run maximized
 [...]

I've replaced all qDebug with puts/printf and most qWarning with fprintf
to stderr. In my opinion, some of the qWarnings aren't errors, so I
replaced those with puts/printf too.

Change-Id: I3e493950bc4a588059fec6c7441b010c2780dffd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoGet rid of !this and similar constructs
Lars Knoll [Thu, 30 Oct 2014 21:30:01 +0000 (22:30 +0100)]
Get rid of !this and similar constructs

The C++ standard doesn't allow calling member functions
on a mull object. Fix all such places, by moving the checks
to the caller where required.

Change-Id: I10fb22acaf0324d8ffd3a6d8e19152e5d32f56bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoDon't allocate less memory than required
Lars Knoll [Fri, 31 Oct 2014 09:40:14 +0000 (10:40 +0100)]
Don't allocate less memory than required

When switching from a simple to a sparse array,
keep the previously allocated size, to not corrupt
memory.

Change-Id: I33f0fb049a2ad6f24ee3703f2c333855830fe9d2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoBorderImage: Fix white area when size changes after first paint
Eskil Abrahamsen Blomfeldt [Mon, 27 Oct 2014 11:55:54 +0000 (12:55 +0100)]
BorderImage: Fix white area when size changes after first paint

When e.g. growing the size of the border image in an animation,
we would not get updates of the paint nodes when the size was
so small that the bounded target rect and source rect did not
change (when the size was smaller than the sum of the borders).
Since this can happen, we also need to detect when the size
changes and update the node for this case.

Task-number: QTBUG-42022
Change-Id: I0849d740f363e66a3a4fd6de23fc9d7399ab0779
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoFix ICC-on-Mac warning about unknown #pragma
Thiago Macieira [Thu, 30 Oct 2014 21:10:34 +0000 (14:10 -0700)]
Fix ICC-on-Mac warning about unknown #pragma

qqml.h(506): warning #161: unrecognized #pragma

Change-Id: I089007db4c4d0701eff32ce0b1c2fff1f65d5c48
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoComment parameters to PageAllocation::allocate()
Ulf Hermann [Wed, 22 Oct 2014 10:34:47 +0000 (12:34 +0200)]
Comment parameters to PageAllocation::allocate()

Change-Id: I8966fbc5f89ce470a0a16fe29086fa6e13ef408e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove guard pages option from uncommitted page reservations
Ulf Hermann [Tue, 21 Oct 2014 15:21:56 +0000 (17:21 +0200)]
Remove guard pages option from uncommitted page reservations

It's only implemented for non-linux unix-like systems and it's quite
challenging to get it right everywhere else. So, instead of giving the
user the illusion that guard pages might be available we just drop
them.

Change-Id: I7ec74c84f6215f22bd10758728b18bbecc0adf59
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement guard pages for windows page allocator
Ulf Hermann [Tue, 21 Oct 2014 14:51:56 +0000 (16:51 +0200)]
Implement guard pages for windows page allocator

Change-Id: Ia54a259bbf05cca7dc1ed868a75931efa95851b3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAdd guard pages around JavaScript stack
Ulf Hermann [Tue, 21 Oct 2014 14:50:59 +0000 (16:50 +0200)]
Add guard pages around JavaScript stack

Like this we avoid writing to random memory if the stack overflows.

Change-Id: I0e0962daae69904a9ce21b047f3d8c0811c1d09f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoAllow page allocations to include guard pages
Ulf Hermann [Tue, 21 Oct 2014 14:47:53 +0000 (16:47 +0200)]
Allow page allocations to include guard pages

The PageAllocator is in principle capable of using guard pages. We can
expose that functionality to its clients.

Change-Id: I919f6f76310feb160d2b26ac1fc64db4e91804bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix Canvas documentation.
Mitch Curtis [Tue, 28 Oct 2014 09:04:08 +0000 (10:04 +0100)]
Fix Canvas documentation.

getContext documentation wasn't showing up due to a syntax error:

"any ..."

Also fixed some small issues here and there.

Change-Id: I3c0444d25bd0fea72fb4fcbf07b3e00794ff1414
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
9 years agotext input: always let cursor rect have a width == 1
Richard Moe Gustavsen [Tue, 14 Oct 2014 08:44:47 +0000 (10:44 +0200)]
text input: always let cursor rect have a width == 1

Instead of using a cursor width of null when a cursor
delegate is set, we should to use a value of 1.
Otherwise the rect we e.g return from cursorRect() will
be invalid. An alternative would be to use the width of
the delegate, but that was found to be controversial.

On iOS we saw a bug with this when telling iOS to position
text spelling popups underneath the cursor. Since the
cursor rect we got was invalid (zero-width), no popup
would show.

Change-Id: Ice51b9a1bd33f331183e3acec61b7d9c0f5163cd
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
9 years agoMerge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Lars Knoll [Thu, 30 Oct 2014 08:13:04 +0000 (09:13 +0100)]
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev

9 years agoMove from a count of cursors, to storing whether or not a subtree has a cursor.
Robin Burchell [Wed, 15 Oct 2014 12:13:53 +0000 (14:13 +0200)]
Move from a count of cursors, to storing whether or not a subtree has a cursor.

Calculation of this is going to be slower (of course) as we have to recurse the
children, but this only happens when unsetting a cursor or removing a child item
from a tree that had a cursor.

On the other hand, wasting 4 bytes per ExtraData plus padding is quite a large
concern, and it was also forcing allocation of ExtraData for an entire tree that
had a cursor set.

This also reduces the size of ExtraData from 152 down to 144 bytes through
reordering of members on x86_64.

Change-Id: Iab14ee71c762285bf4448fc86399070263eb118d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoRepeater & itemviews: fix setModel() JS array handling
J-P Nurmi [Wed, 29 Oct 2014 12:59:46 +0000 (13:59 +0100)]
Repeater & itemviews: fix setModel() JS array handling

QVariant comparison in setModel() started failing because
JS arrays are now passed as a QJSValue. Re-assigning the
same array content should not trigger a model change.

This change restores the old behavior it had before, when
JS arrays were passed as QVariantLists.

Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRemove mouse grabber if touch used for mouse emulation has been grabbed
Daniel d'Andrada [Fri, 10 Oct 2014 19:54:39 +0000 (16:54 -0300)]
Remove mouse grabber if touch used for mouse emulation has been grabbed

If an item grabs a touch that is currently being used for mouse pointer
emulation, the current mouse grabber should lose the mouse as mouse
events will no longer be generated from that touch point.

Example of what happens without this patch:
-User touches a MouseArea. It gets pressed.
-Some other item grabs that touch.
-This touch eventually ends.
-The MouseArea would still be pressed.
And what will happens instead after this patch:
-User touches a MouseArea. It gets pressed.
-Some other item grabs that touch.
-The MouseArea gets canceled and released
-This touch eventually ends.

Change-Id: I24114f18be564553a4a768243bb20379affe7a8f
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
9 years agoQQuickWindow: Add some more stuff under DBG_TOUCH.
Robin Burchell [Wed, 29 Oct 2014 17:59:27 +0000 (10:59 -0700)]
QQuickWindow: Add some more stuff under DBG_TOUCH.

This is useful for understanding when touch is actually delivered, and what it
goes to, which is useful for figuring out when something is incorrectly
filtering mouse events in the scene (for instance).

Change-Id: I9323629a42457b2b71e22ad489d8f1dc2d7b6fc5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoDon't constantly clear child node list on ChildrenUpdateMask
Robin Burchell [Fri, 17 Oct 2014 21:21:50 +0000 (23:21 +0200)]
Don't constantly clear child node list on ChildrenUpdateMask

This is pretty inefficient. We can do a better job with some effort,
incrementally. This should help cases like list panning quite a bit.

To accomplish this, we split the child update into two phases. First, we build a
list of desired nodes (this step is necessary for clarity's sake, thanks to the
need to insert an arbitrary painter node).

Second, we make sure that the current reality matches the desired state by
adding & removing nodes as necessary: no more full rebuild each time.

On extremetable, with logging on the ChildrenUpdateMask handling if time taken
was > 0ms, the time taken for me (on a recent rMBP) went from regularly hitting
7-10ms per frame to _occasionally_ (~5 times in a few seconds of panning)
spiking above 0, usually only hitting 1ms, and twice hitting 3 and 4ms.

Task-number: QTBUG-34255
Change-Id: I9fb4fb4cf39ffff3b8035f0d6de3bd7da6fcc51c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
9 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Wed, 29 Oct 2014 09:48:54 +0000 (10:48 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev

Conflicts:
src/quick/items/qquickaccessibleattached_p.h
src/quick/items/qquickwindow.cpp
src/quick/scenegraph/qsgthreadedrenderloop.cpp

Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d

9 years agoBasic support for typed arrays
Lars Knoll [Thu, 11 Sep 2014 13:37:31 +0000 (15:37 +0200)]
Basic support for typed arrays

This implements most of the spec required for the
Khronos typed array specification.

It tries to follow ECMAScript 6 as closely as possible,
but currently only implements a subset of the ECMAScript
6 specification.

Addes a test script in tests/manual/v4 to test our
implementation.

Change-Id: I8ec63869500358e088b73240e1f37120ae3cf59a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement DataView
Lars Knoll [Wed, 10 Sep 2014 14:39:23 +0000 (16:39 +0200)]
Implement DataView

The second class that is required for typed
array support.

Change-Id: Idc2dcec7c1eee541f76dc5ab1aea6057ba03cb93
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoImplement ArrayBuffer
Lars Knoll [Wed, 10 Sep 2014 12:50:28 +0000 (14:50 +0200)]
Implement ArrayBuffer

This is the first class required to support typed
arrays in our JS engine.

Change-Id: I0fe1e1ca430769c171912dda207cfae772e9b9db
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRevert: use the new form of QTranslator::load() for more flexibility
Shawn Rutledge [Thu, 16 Oct 2014 08:10:04 +0000 (10:10 +0200)]
Revert: use the new form of QTranslator::load() for more flexibility

This reverts commit 427646b8d7c52e5b84240e07ffd391217ce3bfa8.
It seems that it should have been more correct, but we are still not
shipping English translations, and static QString find_translation()
in qtranslator.cpp will return any language which is in
QLocale::uiLanguages() for which the translation file is found.
That is a long list on OSX.

Reverting the patch means find_translation() is not called in
such cases.  This change can be re-done whenever we are more sure
that the attempt to find a translation will succeed in finding a
sensible one, or fall back to not translating, rather than choosing
a language that the user didn't intend.

Task-number: QTBUG-41977
Change-Id: I425946cc71cec96b4f38629eb2b7e80220c5236d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
9 years agoDo not crash QML apps on startup
Jan Arve Saether [Tue, 28 Oct 2014 08:59:23 +0000 (09:59 +0100)]
Do not crash QML apps on startup

This started crashing because of 8f6436f125faae91eb472ddddbbae06dba5da671

Task-number: QTBUG-42227
Change-Id: I9e4862f6008c6ad6ec54469f2b39dd6be583e422
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoDon't document Context2D's TextMetrics as its own QML type.
Mitch Curtis [Wed, 22 Oct 2014 10:43:42 +0000 (12:43 +0200)]
Don't document Context2D's TextMetrics as its own QML type.

It can't be instantiated like a QML type, so it's actually better to
just document measureText() (which is the only way to construct objects
of this type) as returning an object containing some metrics for the
current font. This should have no effect on user code.

This solves the issue of the new TextMetrics type's documentation not
showing up. TextMetrics is a type that *can* be instantiated and is
more feature complete. It provides a declarative API for the functions
that take arguments in QFontMetrics.

Change-Id: I46251e6f3aa7179ab569f5131307181f71043df4
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoReduce memory pressure on system malloc when allocating large items on the GC heap
Simon Hausmann [Mon, 27 Oct 2014 12:51:27 +0000 (13:51 +0100)]
Reduce memory pressure on system malloc when allocating large items on the GC heap

Try to free our large items for every 8 megabytes of additional large item
memory we allocate. This helps in particular on 32-bit builds and was noticable
in tst_qqmlecmascript::push_and_shift().

Change-Id: I4cc0b188e58ccaf32026e38c7aaf1cfadc83148b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
9 years agoDon't check the this pointer for 0 in member functions
Lars Knoll [Mon, 27 Oct 2014 07:54:26 +0000 (08:54 +0100)]
Don't check the this pointer for 0 in member functions

This actually violates the C++ standard that defines that
you aren't allowed to call member functions on an invalid
object.

Instead insert the 0 pointer checks on the caller side where
required.

Change-Id: I8be3c3831594bb6482e9ef6de6e590ec437ac0f8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoReduce size of ArrayData by one pointer
Lars Knoll [Wed, 22 Oct 2014 14:00:35 +0000 (16:00 +0200)]
Reduce size of ArrayData by one pointer

The pointer to the real data is not required anymore, as
it always follows the class itself. Like this we save one
pointer of overhead, and one indirection when doing reads
and writes of array data.

Change-Id: If6afdac8e97b57420b50e7b7eb8979f77e8dbbcf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoRework our simple array implementation
Lars Knoll [Tue, 21 Oct 2014 12:54:45 +0000 (14:54 +0200)]
Rework our simple array implementation

Implement the simple array as a circular buffer instead
of an array with head room. This fixes a couple of severe
issues with performance and memory management if the array
is being used as a queue.

Task-number: QTBUG-41421
Change-Id: I146ad8a874407c108aa8fe1eae68e9957e154847
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoFix QQmlTypeData object leak
Jian Liang [Sat, 25 Oct 2014 09:15:49 +0000 (17:15 +0800)]
Fix QQmlTypeData object leak

Drop the refcount added in QQmlTypeLoader::getType() to prevent object
leakage in resolveQmlType.

Change-Id: I8bd9c486294912cc00ce5feb350c3ff79c6aac09
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
9 years agoMove action handlers to the Accessible attached object
Jan Arve Saether [Wed, 15 Oct 2014 11:58:34 +0000 (13:58 +0200)]
Move action handlers to the Accessible attached object

With this change, instead of writing:

    function accessiblePressAction() { submit() }

You should write:

    Accessible.onPressAction: { submit() }

For the moment, only 4 actions are added:
press, toggle, increase and decrease.

The old style action handlers are deprecated, and removed from the
documentation. New style action handlers will be preferred in case an
item declares both styles.

Change-Id: I11919e631d8476d55540f94252757b911c44ade4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
9 years agoFix leaks in QQuickImageParticle
Jocelyn Turcotte [Thu, 23 Oct 2014 14:01:57 +0000 (16:01 +0200)]
Fix leaks in QQuickImageParticle

Make sure that ImageData instances, m_shadowData as well as the
QSGGeometry of particle nodes are destroyed together with their
QQuickImageParticle.

Also implement the assignment operator for QQuickParticleData to
avoid its v8Datum pointer to be copied over to the shadow datum
in getShadowDatum. This would cause a double delete of the
QQuickV4ParticleData when trying to call clearShadows() in the
destructor.

Task-number: QTBUG-36782
Change-Id: Ie03f2be0415daeb7f4f6e5f92295a3ab26a62155
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
9 years agoQML State Machine plugin: correct URL in Q_PLUGIN_METADATA
Shawn Rutledge [Fri, 17 Oct 2014 06:46:30 +0000 (08:46 +0200)]
QML State Machine plugin: correct URL in Q_PLUGIN_METADATA

org.qt-project.org is redundant

Change-Id: Id6a6794e1fc1e4403b3bfcdebbe06a487f904041
Reviewed-by: Sebastian Sauer <sebastian.sauer@kdab.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
9 years agoRemove logic that some accessible objects cannot have children
Frederik Gladhorn [Thu, 16 Oct 2014 12:18:19 +0000 (14:18 +0200)]
Remove logic that some accessible objects cannot have children

There are many places where this doesn't make sense (a button in a
search field, a line in a list represented as button with a child button
to remove the list item...).

Change-Id: Iab1d411adda696a01b1dcfdebb0a250066d6a7c2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
9 years agoExpose searchEdit accessible property to Qt Quick
Frederik Gladhorn [Thu, 16 Oct 2014 16:01:22 +0000 (18:01 +0200)]
Expose searchEdit accessible property to Qt Quick

Change-Id: I9230deaa75d1e9a9614f364d4adf92349c8a1901
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
9 years agoProperly handle negative years when printing JS Dates to strings.
Ulf Hermann [Fri, 24 Oct 2014 13:06:22 +0000 (15:06 +0200)]
Properly handle negative years when printing JS Dates to strings.

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>