V4: remove unnecessary spills and order them correctly.

When doing edge resolving, too many spills were generated, and the
dependency tracking of moves was not complete. Now we only insert spills
that are caused by phi-nodes (because any other spill would be generated
at the point a variable was defined). However, there can still be
multiple dependencies between the moves generated by the edge resolving.
Instead of only checking the first dependency, all of them are tracked.

The bug report was a case where an unneccesary spill was generated, that
got tracked, but "suppressed" the other (valid!) dependent move. The
randomness was caused by the hash seeding of QHash.

Task-number: QTBUG-35840

Change-Id: Ifbc3c8fc13de53c46a8b5859721b2497189921a3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Revert "Support batching of rotated antialiased elements."

This patch broke scaled text rendering

This reverts commit 6acaa1c42936f89d74324be9c0cce4873a9a565b.

Change-Id: I1f7a3ba0556f6d59bc1e28946631be2d9fc2b67d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Increase the timeout for QPacketProtocol tests

Recent failures when testing a completely unrelated one-line commit
(https://codereview.qt-project.org/74584) suggest that the timeout is
actually too small.

Change-Id: I9c3fd0b09c6be2d42f92485c3c223fe88bb8328e
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Make sure the test window has focus

Some setups like xvfb-run under Linux do not focus windows
after showing them, this means that any focus based test will
fail since the windows itself is unfocused. This makes sure
the test window will be shown and focused.

Change-Id: I1903b7cdf88b772e1ca15acd4899695b49615712
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4 IR: update immediate dominators when purging unreachable basic-blocks

The basic block scheduling uses this information to place loops. When
the immediate dominator information is invalid, the scheduling can be
sub-optimal, or will sometimes forget to schedule some blocks.

Change-Id: Iaeb45f2b757b676310be25a658ceadc07d5722ec
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4: lower memory allocator pressure.

Changes to datastructures and more re-using of locally used temporary
vectors. For the test regress-74474-002.js this lowers the total
allocated memory from 1.98GB to 158MB. Thse peak memory usage stays at
75MB. There is no functional change.

This should give a modest performance improvement which mainly depends
on the speed of malloc()/free().

Change-Id: I1877c1903e59a33ee79ff2b801ef6f2c1cee30a6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4 IR: do edge splitting after SSA transformation

This reduces the work for the dominator tree/frontier calculations,
because there are less blocks to consider. All blocks inserted by
splitting the critical edges, have (by definition) no effect on the
dominator calculations. However, the immediate dominators for all new
blocks needs to be added, because this information is used by the block
scheduling.

This change reduces memory/time usage during optimization passes,
especially when processing excessively big switch statements.

Change-Id: Ia69882e9dabdddffa1c98b1079012d8d988e1e8f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix failing context->next != 0x1 assertion

After commit bf173fe5da381c88343296ca33ef6b06389c6d20 context objects are
always on the GC heap and no more in that special linked list or stack
allocated, so the next pointer became dangling/uninitialized and asserting on
it was bound to fail randomly.

Since we no more allocate contexts on the stack, we can safely remove the
assertion.

Task-number: QTBUG-35917
Change-Id: I104bd129c6c32f46a6302052f563abdf926cb879
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
QtQuick.Dialogs FileDialog: don't go astray into qrc:/ on Android

Was due to string->URL conversion when setting FolderListModel.folder.

Task-number: QTBUG-36006
Change-Id: Ia768d8a5473b3d4c22ef9be7c8b3cf28d3956f6f
Reviewed-by: Liang Qi <liang.qi@digia.com>
Fix usage of FileDialog.folder property in QtQuick

The content of the FileDialog.folder property has not been applied
to the native QFileDialog, so it was not possible to pre-select a
folder for the file dialog.

Change-Id: Iaadd6aa71bc37739c16a2e7c5bff2d0050f15f3a
Task-number: QTBUG-35973
Reviewed-by: Tobias Koenig <tobias.koenig.qnx@kdab.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
V4: relieve more memory allocator pressure.

For _ZN13BenchmarkDemo11initPhysicsEv from the Octane testsuite, the
total allocated memory drops from 1.5GB to 51MB. Peak memory usage stays
at 29MB.

Again, slow implementations of malloc()/free() will see a performance
improvement.

Change-Id: I21bc2f0d3735de0980fc9b3745906016e2e48a61
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Re-enable mac tests

Task-number: QTBUG-35344
Change-Id: Ifc4d5420c95a615b35f02ec585c324b2cc93c5e0
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Bump MODULE_VERSION to 5.2.2

Change-Id: Id20a6043ba142c14cd2b1062181a399e93782179
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Merge remote-tracking branch 'origin/release' into stable

Change-Id: Id18709cb0a4d85ffdadffa28aef98323367292d4
Improve Mac OS X touch event enabling.

Previously, the Qt Quick touch interaction items would
enable touch events on window change. On app startup
this would typically happen before the platform window
was created, and the call to registerTouchWindow would
then create the platform window.

registerTouchWindow in QtBase has now been changed
to not create the platform window since this has
unwanted side effects. Calling it at window change
time will then have no effect for the initial window
change.

Enable and disable touch events on hoverEnter/Leave
instead. This is similar to what QtWidgets does and
has an additional benefit: touch events can now be
enabled when the mouse cursor is hovering over a touch
item, reducing the chances of it interfering with
scroll events for other items.

Task-number: QTBUG-32988
Change-Id: Ic48dbec910f52299d5068f5ca7508be73cdc6f36
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
QQmlInstructionData: fix warning 'code' {is,might be} used uninit'ed

This is a compile-error for -release -developer-build builds.

Change-Id: I7ea5363260ce35a013fbf6d1c538c763023a8dc0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4: fix range splitting when split is between intervals.

Also added some "white-box" unit tests and sprinkled in a bit of
documentation. The case that went wrong is covered by the test
rangeSplitting_1: before the fix, the new interval would have
two ranges: [66-64],[70-71]. The first range is invalid and should not
be there at all.

Change-Id: If0742f4e6a96d98ea5d696f95126886ba66f92bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Work around missing BGRA texture format on Samsung Galaxy Tab 3

The GL driver on the Galaxy Tab 3 reports support for the BGRA8888
texture format, but does not actually support it. For this particular
device we disable support for that format.

Task-number: QTBUG-34984
Change-Id: Ie26ef0e815c1622b3425c37237a3fc320543b92c
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Fix uninitialized variable in debug builds

Initialize size to zero in both constructors. This should fix UMRs.

Change-Id: I6888f667b3dc6b2e72e58b54288c3c88df3ced71
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
QQmlEngine - fix example in documentation

example_qjsvalue_singletontype_provider example code snippet
returns QJSValue instead of QJSValue*.

Change-Id: If4d5592fcee25ada9870602c8f92197980ef9b77
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>