Commit Graph

9569 Commits

Author SHA1 Message Date
Lars Knoll 3c1041cbfd Move more Data objects into the Heap namespace
Change-Id: I87866f8dcbaac1087da7bbd2902aa5b062afca53
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-09 08:39:33 +01:00
Lars Knoll 34fa0f8fec Move Data of error objects into the Heap namespace
Change-Id: I893095107eaadf38959a4e489d92ef66b2f9e81d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 23:26:50 +01:00
Lars Knoll 04bf728d7d Move Data of the builtin functions to the Heap namespace
Change-Id: I8a77fe3fa9b6538cf6c75817eae7dc34df8ab329
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 19:48:10 +01:00
Lars Knoll 980e7fae0a Move Data of Variant and ArgumentsObject into Heap namespace
Change-Id: Id2092a15c9fb5341d9b5cf4a9ac7a978308e4174
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 19:48:00 +01:00
Lars Knoll f3f86c5eae Use Heap namespace for data of QObjectWrapper related classes
Change-Id: Id6c3af9e4f995972ae3bec465b2fd293be05de4c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 19:47:51 +01:00
Lars Knoll 5117c8e79c Move more Data members over to the Heap namespace
Change-Id: I74347da3f0f47220bb1f8cf13b872b547fd18a4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 19:47:43 +01:00
Lars Knoll ef8ad8234b Move Data of FunctionObject and related classes into Heap
Change-Id: Iadf74f953798c1884e0ec704ccb7c70d971e3273
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 19:47:34 +01:00
Lars Knoll aeb7d3ebbb Move Data for String into the Heap namespace
Change-Id: Iefa231106b77db6d4c9d4ded2b028d21eb94ab03
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 16:39:58 +01:00
Lars Knoll a7ffd048cc Move Data for Number/Boolean/ArrayObject into the Heap
Change-Id: Ifc1c38b00f1b6b11e69caeb195429e2dd4c05d4f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 16:39:45 +01:00
Lars Knoll c2da8abde5 Move Object::Data into the Heap namespace
Change-Id: I9d30081f71b83bc86f5e5714e23396b18c4d54c5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 16:39:32 +01:00
Lars Knoll da2396478f Cleanup RegExp
Move it's Data into the Heap namespace.

Change-Id: I4ed6ea481376ae1d0c1fb08b56feee4764083231
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 16:39:22 +01:00
Lars Knoll 84aae25c0b Refactor ExecutionContexts
Move the Data class out into the Heap namespace.

Change-Id: I2b798deb53812a08155c92a0e6ef2dcd2ea137b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-08 16:39:15 +01:00
Lars Knoll ec8f1f68d6 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>
2014-11-08 16:39:07 +01:00
Robin Burchell 9d1cd3098a QQuickRepeater::clear: Remove items from the end backwards.
This way, the indices for itemRemoved will make sense consistently.

This was broken with 5f5aba5b6e, dated November
2011.

Task-number: QTBUG-42243
Change-Id: I5fecfd4174049f51e0cec90e40e6332de5d5bf01
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-11-07 18:39:15 +01:00
Lars Knoll b340caa0d3 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>
2014-11-07 02:00:05 +01:00
Frederik Gladhorn e22fc141c3 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>
2014-11-06 14:05:47 +01:00
Simon Hausmann 4876c2aa95 Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	src/qml/jsruntime/qv4errorobject_p.h

Change-Id: I7fc1211295738a9fae32b783a9f001f1613785e4
2014-11-04 22:04:19 -08:00
Lars Knoll 878b11e0a9 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>
2014-11-04 20:18:18 +01:00
Lars Knoll 486948817b 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>
2014-11-04 20:17:54 +01:00
Lars Knoll 6f6b350976 Cleanup header file dependencies
Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-04 20:17:23 +01:00
Lars Knoll 43296bb5fb Remove some unneeded reinterpret_cast's
Change-Id: I29ebc1f06bb3f0d20e6e21840c7fe326a0f4546d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-04 20:16:58 +01:00
Lars Knoll 6b7c3ea49c Remove most calls to Value::managed()
Change-Id: Id5b1cca542421d749711eff68520a4138ec95531
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-04 20:16:37 +01:00
Fawzi Mohamed 25b6fae1eb 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>
2014-11-04 17:02:14 +01:00
Simon Hausmann 3f1d0b27a1 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>
2014-11-04 14:58:30 +01:00
Liang Jian 6cbb84d24f 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>
2014-11-04 13:40:32 +01:00
Eskil Abrahamsen Blomfeldt 326c4d80f2 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>
2014-11-04 09:12:16 +01:00
Simon Hausmann 8daace55a2 Cleanup: Get rid of String and Object pointers in Value
Change-Id: I4f007d0437c9a5cc79fe35d960d40557366d46fe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-11-04 06:03:28 +01:00
Liang Jian c748f51fb4 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>
2014-11-04 01:56:22 +01:00
Simon Hausmann 62fa701eeb 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>
2014-11-03 14:59:53 +01:00
Leena Miettinen efca42358f 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>
2014-11-03 10:49:28 +01:00
Simon Hausmann 96a2e639d2 Remove unused file
Change-Id: I16ae59257040594ce9921d29ddb13e2cefaf1075
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-11-03 06:35:07 +01:00
Jian Liang 1e775d2a67 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>
2014-11-02 12:08:31 +01:00
Gunnar Sletta d252ba67da 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>
2014-11-02 11:27:55 +01:00
J-P Nurmi d1b39ca5c9 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>
2014-11-01 11:44:06 +01:00
J-P Nurmi 492c611d2b 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>
2014-11-01 11:43:57 +01:00
Gunnar Sletta 890b02a6f1 Fix typo in Q_ASSERT_X warning.
Change-Id: I1415de93af35177fd643c21bcae2492a79187e50
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-11-01 10:39:41 +01:00
Gunnar Sletta c5a4c661fb 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>
2014-11-01 10:39:39 +01:00
Simon Hausmann 473ef83dba Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I30f9c925631991ceb22339d1333936faecffbaf4
2014-10-31 20:21:09 +01:00
Thiago Macieira be9c969b13 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>
2014-10-31 19:16:47 +01:00
Lars Knoll 0704d2be63 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>
2014-10-31 15:42:42 +01:00
Lars Knoll e67948823d 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>
2014-10-31 15:42:17 +01:00
Eskil Abrahamsen Blomfeldt 87755d0437 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>
2014-10-31 09:50:57 +01:00
Thiago Macieira bd3a4ff1d0 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>
2014-10-30 22:49:05 +01:00
Ulf Hermann beb6667d4e Comment parameters to PageAllocation::allocate()
Change-Id: I8966fbc5f89ce470a0a16fe29086fa6e13ef408e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-30 13:19:51 +01:00
Ulf Hermann 2fb59fe64b 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>
2014-10-30 13:19:45 +01:00
Ulf Hermann 78ac7ecbd4 Implement guard pages for windows page allocator
Change-Id: Ia54a259bbf05cca7dc1ed868a75931efa95851b3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-10-30 13:19:41 +01:00
Ulf Hermann 2ffb01b45d 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>
2014-10-30 13:19:37 +01:00
Ulf Hermann 625dae4424 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>
2014-10-30 13:19:33 +01:00
Mitch Curtis 7ce2c0c9ac 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>
2014-10-30 12:22:56 +01:00
Richard Moe Gustavsen 02de9d7b6c 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>
2014-10-30 10:32:53 +01:00