Fix PathView stealing mouse grab from its child items.

Apply the improvements that have been applied to Flickables handling of
child items over time to PathView to bring its behavior back in line.

Task-number: QTBUG-33699
Change-Id: I76a412d75c48f9cf2f12f5f6f1aa01ff62d06364
Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
V4: fix ArrayPrototype::method_isArray() build break

With a recent Clang in C++11 mode:
error: incompatible operand types ('QV4::ArrayObject *' and 'bool')

Task-number: QTBUG-33706
Change-Id: I7bd4fe01176745fb6f8dbdf8f271edb7121eb35e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix compilation on Android with 4.8 toolchain

Change-Id: I1ce4ec8c9c671f0130c1530c772c1dd74f1fb1f4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Add fine-grained QML / QtQuick performance benchmarks

This commit adds a series of benchmarks to test the performance of
fundamental areas of the QML engine (compilation, instantiation, binding
evaluation, positioning) using types provided by the QtQuick QML module.

Change-Id: Iecec058c45aea0bd728f03123fa2aa79d6af8efa
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
qdoc: no longer recognizes the version nr in QML refs

All QML references of the form
<QML-module-name><QML-module-version>::<QML-type>::<member-name> have
had the <QML-module-version> removed i.

Task-number: QTBUG-33776
Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Stabilize tst_qqmlprofilerservice

Change-Id: Ia381d51561f1c183ec7f2e3fcfe49810bfbfcc61
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Don't delete scene-graph atlas manager if it hasn't been created yet

QSGContext::invalidate() is called from the QSGContext destructor,
but the atlas manager is only created if QSGContext::initialize()
is called, which may not always happen.

The result was a bunch of "QCoreApplication::postEvent: Unexpected
null receiver" messages during testing.

Change-Id: I11a294d48c06d687a9f82cf1ce825063cda8ecf6
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
V4 IR: fix type inference.

When a phi-node couldn't be fully typed (e.g., when one of the temps
was not yet typed), VarType was assumed. When a circular dependency
between two phi-nodes occurred, like with a condition inside a loop,
then depending on the ordering of the work-list, the two phi-nodes
could start oscillating between VarType and the correct type.

The fix is to check if one of the temps is not fully typed, and if so,
assume whatever we currently have as the result and have the statement
re-scheduled. Full typing will occur when the temp with the missing
type information is typed.

Change-Id: I950d81fe7fa8272cb37f7eea5b88092d1eb4817e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Always call callCompleted in QQmlDataBlob::tryDone

We need this since it could happen that in QQmlComponentPrivate::loadUrl we did
  QQmlTypeData *data = QQmlEnginePrivate::get(engine)->typeLoader.getType(url, loaderMode);
and got a sync QQmlTypeData even if we asked for async, and thus the async loader was never notified
when it finished and we were never loaded.

Situation in which this can happen is:
 * ListView with an async Loader as delegate
 * Loader loads two items A and B, while A is a B
 * Item 0 of the ListView triggers an async loading of A that triggers the sync loading of B
 * Item 1 of the ListView triggers an async loading of B
 * Since B is already being loaded (though in sync), we just add ourselves to the people that want to be notified
 * sync loading of B is done and QQmlDataBlob::tryDone does not call the callbacks because it's sync
 * Item 1 is never finished loading

Change-Id: I52a0979a1d3cfcfe73a71196bf24f491d6cf8e9a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Don't create a ValueRef to a temporary

Change-Id: I6d7fbcee594298517b880e4b0fac9df1f9e54d61
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix ObjectIterator API to be GC safe

Change-Id: I3a9c48d53d8dbadcb9b32c00fcef1f89447c4b8c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove more uses of Value

Change-Id: I889e760f75b485a28e1f2a2c26b2337ae9bfafac
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove some more uses of QV4::Value

All remaining uses should be GC safe now.

Change-Id: I05c962de6ab896f108f70caa1bf937a24e67bfe1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Use SafeValue instead of Value in ScopedValue methods

Change-Id: Ie463efe600d498ce77d4b9e8b48abcfd61c1ab78
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Cleanup API of Safe<T>

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>
Change exception handling API

This patch changes the exception handling API in the engine slightly, encapsulating
any use of direct throw statements and catch blocks with concrete types. In the future
we need to be able to change the way these are implemented, in order to ensure that
the correct stack unwinding code is triggered for throw and re-throw.

This patch separates the C++ exception object thrown from the V4 exception
(that includes value, throwing context pointer) and stores the latter inside
the engine.

In order for that to compile, ExecutionEngine::StackTrace and StackFrame had to
move into the QV4 namespace directly.

In addition the syntax for catching exceptions changes from

try {
    ...
} catch (QV4::Exception &ex) {
    ex.accept(context);
    QV4::ScopedValue exceptionValue(scope, ex.value());
}

to

try {
    ...
} catch (...) {
    QV4::ScopedValue exception(scope, context->catchException());
}

Context::catchException() checks if there's a "current" exception in the engine,
and if not assumes that we caught an unrelated exception and consequently re-throws.

partiallyUnwind() is also gone and replaced with rethrowException(), in order to
encapsulate the re-throw.

Lastly, in the future nesting try/catch blocks isn't going to be possible due to
limitations in the common C++ ABI with regards to foreign exceptions.

Change-Id: Ic81c75b057a2147e3176d8e0b4d326c14278b47d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4: invert conditions when the true block follows the test.

Change-Id: I5044acd4263b71734e4eb5d7e74b1a4a8414741e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 IR: fix dead-code elimination.

Change-Id: If00a108fb107d331478dd36ad7feae4c4521c2ae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 JIT: implement convertUInt32ToDouble on ARMv7.

Change-Id: I11caf07a8776bb2c6527639f22d47103f4ca1cef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Use a QVector instead of a QList

This makes the code go quite a bit faster (saves ~7-8% of the
total amount of instructions executed when running crypto.js

Change-Id: I6b3bd08eca98b45593262e2fc6e0ce5056257e76
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>