platform/upstream/qtdeclarative.git
10 years agoRemove QSGContext's precompilation step.
Gunnar Sletta [Mon, 30 Sep 2013 11:18:10 +0000 (13:18 +0200)]
Remove QSGContext's precompilation step.

Materials are managed solely inside the renderer now, so these
are just wasting time.

Task-number: QTBUG-33456
Change-Id: Ie320df20b7971633c257b1bd3a218e7d70e52c3d
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
10 years agoEnable profiling of materials and atlas textures
Gunnar Sletta [Mon, 30 Sep 2013 11:19:30 +0000 (13:19 +0200)]
Enable profiling of materials and atlas textures

Task-number: QTBUG-33459

Change-Id: Ie9ea176fbb7ee46a128b4bf66a8f4475a5d4c90b
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
10 years agoGet lookups working (somehow) on ARM
Petr Nejedly [Tue, 1 Oct 2013 06:23:25 +0000 (23:23 -0700)]
Get lookups working (somehow) on ARM

Edit(Simon): This is a workaround for the register clash on ARM. r0
(ReturnValueRegister) is also used to pass the first argument, therefore we
can't use it as "temporary" register for the duration of the parameter setup.
Temporarily allocate r8 for now until we have constraints like these properly
propagated into the register allocator.

Change-Id: Iae266672856dea247b720367b8e8393333622e4e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoTemporarily disable libunwind exception throwing on Mac
Simon Hausmann [Wed, 2 Oct 2013 18:43:25 +0000 (20:43 +0200)]
Temporarily disable libunwind exception throwing on Mac

The run-time appears to have a slightly different behaviour wrt exception
ownership. We don't strictly need this code path on Mac, so use regular C++
exceptions until I can figure out what happens there.

Change-Id: Idd540c8656d25ffdb4002843f398114881e33214
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix backtrace generation on Android/ARM/QNX
Simon Hausmann [Tue, 1 Oct 2013 14:34:21 +0000 (16:34 +0200)]
Fix backtrace generation on Android/ARM/QNX

Use a GCC extension to the common C++ ABI's called _Unwind_Backtrace, which
generate backtraces if possible. Its direct use will ensure we use the
statically linked unwind, which knows about our unwind tables. This also helps
for the setup when libc doesn't have the glibc specific backtrace() function we
used previously. The unwinder on Mac OS X with clang also implements the same
extension.

Change-Id: I0b780590c10c16e50ec570f7da1efae2e64c46dd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoCleanup exception handling
Simon Hausmann [Tue, 1 Oct 2013 14:19:28 +0000 (16:19 +0200)]
Cleanup exception handling

The code in the Exception class operates entirely on the engine's data,
so move it into ExecutionEngine instead. This eliminates the need for
a QV4::Exception class and catches and old code that tries to still do
catch (Exception &) instead of catch (...)

Change-Id: Ie608bec6af652038aca6c9423c225a4d7eb13b39
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoChange v4 exceptions to use the common C++ ABIs foreign exceptions
Simon Hausmann [Tue, 1 Oct 2013 13:10:33 +0000 (15:10 +0200)]
Change v4 exceptions to use the common C++ ABIs foreign exceptions

On platforms where we use the common C++ ABI, throw the exception not using a
dummy C++ exception structure and the throw keyboard, but instead use the
lower-level _Unwind_RaiseException to throw a foreign exception.  It is caught
with the existing "catch (...)" and re-throw is implemented similarly, by
grabbing the current exception from the globals (a standardized data structure)
and re-throwing it.

On platforms such as ARM that lack hooks for supplying our unwind tables to the
system run-time, this patch will make it possible to link the unwinder
statically into libQtQml (libgcc or libunwind) and thus force it to use our
unwind tables, because throwing or re-throwing will always go through our
statically linked code through direct calls to _Unwind_RaiseException (instead
of libstdc++).

Change-Id: Ic2ac056fc7ed9e93fb51e30ab45f35b260487c5f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix warnings in tst_qquickaccessible.
Friedemann Kleint [Mon, 30 Sep 2013 13:58:05 +0000 (15:58 +0200)]
Fix warnings in tst_qquickaccessible.

tst_qquickaccessible.cpp: In function 'int verifyHierarchy(QAccessibleInterface*)':
tst_qquickaccessible.cpp:70:27: warning: variable 'middleChild' set but not used
tst_qquickaccessible.cpp: In function 'QAccessibleInterface*
topLevelChildAt(QAccessibleInterface*, int, int)': tst_qquickaccessible.cpp:325:46:
warning: suggest parentheses around assignment used as truth value.

Change-Id: I80f9a1e5438279add3671828a3145af2b1f2abf8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
10 years agoForward-declare QV4::String in qqmlmetatype_p.h.
Friedemann Kleint [Mon, 30 Sep 2013 13:52:38 +0000 (15:52 +0200)]
Forward-declare QV4::String in qqmlmetatype_p.h.

Required for follow-up changes reordering inline functions for
MinGW as otherwise QV4::Value::isString() is reported as
used but not defined.

Change-Id: Ib07caa9eee667295ecc88f94ab8960b100cd084b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix warnings in tst_qquickaccessible.
Friedemann Kleint [Mon, 30 Sep 2013 13:58:05 +0000 (15:58 +0200)]
Fix warnings in tst_qquickaccessible.

tst_qquickaccessible.cpp: In function 'int verifyHierarchy(QAccessibleInterface*)':
tst_qquickaccessible.cpp:70:27: warning: variable 'middleChild' set but not used
tst_qquickaccessible.cpp: In function 'QAccessibleInterface*
topLevelChildAt(QAccessibleInterface*, int, int)': tst_qquickaccessible.cpp:325:46:
warning: suggest parentheses around assignment used as truth value.

Change-Id: I80f9a1e5438279add3671828a3145af2b1f2abf8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
10 years agoForward-declare QV4::String in qqmlmetatype_p.h.
Friedemann Kleint [Mon, 30 Sep 2013 13:52:38 +0000 (15:52 +0200)]
Forward-declare QV4::String in qqmlmetatype_p.h.

Required for follow-up changes reordering inline functions for
MinGW as otherwise QV4::Value::isString() is reported as
used but not defined.

Change-Id: Ib07caa9eee667295ecc88f94ab8960b100cd084b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMark DirtySubtreeBlocked correctly from OpacityNode
Gunnar Sletta [Tue, 1 Oct 2013 07:11:54 +0000 (09:11 +0200)]
Mark DirtySubtreeBlocked correctly from OpacityNode

In the edgecase where the opacity was exactly the OPACITY_THRESHOLD
we would fail to mark the tree as dirty. This led to a crash
in the renderer.

Change-Id: I618910d0c792a215133598b6a87217be1f8729bc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoForward-declare QV4::String in qqmlmetatype_p.h.
Friedemann Kleint [Mon, 30 Sep 2013 13:52:38 +0000 (15:52 +0200)]
Forward-declare QV4::String in qqmlmetatype_p.h.

Required for follow-up changes reordering inline functions for
MinGW as otherwise QV4::Value::isString() is reported as
used but not defined.

Change-Id: Ib07caa9eee667295ecc88f94ab8960b100cd084b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMark DirtySubtreeBlocked correctly from OpacityNode
Gunnar Sletta [Tue, 1 Oct 2013 07:11:54 +0000 (09:11 +0200)]
Mark DirtySubtreeBlocked correctly from OpacityNode

In the edgecase where the opacity was exactly the OPACITY_THRESHOLD
we would fail to mark the tree as dirty. This led to a crash
in the renderer.

Change-Id: I618910d0c792a215133598b6a87217be1f8729bc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoRespect Qt.vector2d as input to ShaderEffect uniforms.
Gunnar Sletta [Tue, 1 Oct 2013 18:15:46 +0000 (20:15 +0200)]
Respect Qt.vector2d as input to ShaderEffect uniforms.

Change-Id: I7c24f822424d36cf16648d17df161f15083b0da5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoUse a QVector instead of a QList
Lars Knoll [Wed, 2 Oct 2013 13:14:45 +0000 (15:14 +0200)]
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>
10 years agoV4 JIT: implement convertUInt32ToDouble on ARMv7.
Erik Verbruggen [Tue, 1 Oct 2013 12:53:05 +0000 (14:53 +0200)]
V4 JIT: implement convertUInt32ToDouble on ARMv7.

Change-Id: I11caf07a8776bb2c6527639f22d47103f4ca1cef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: fix dead-code elimination.
Erik Verbruggen [Tue, 1 Oct 2013 11:12:52 +0000 (13:12 +0200)]
V4 IR: fix dead-code elimination.

Change-Id: If00a108fb107d331478dd36ad7feae4c4521c2ae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: invert conditions when the true block follows the test.
Erik Verbruggen [Wed, 2 Oct 2013 12:41:35 +0000 (14:41 +0200)]
V4: invert conditions when the true block follows the test.

Change-Id: I5044acd4263b71734e4eb5d7e74b1a4a8414741e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoChange exception handling API
Simon Hausmann [Wed, 11 Sep 2013 11:23:21 +0000 (13:23 +0200)]
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>
10 years agoCleanup API of Safe<T>
Lars Knoll [Tue, 1 Oct 2013 14:11:55 +0000 (16:11 +0200)]
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>
10 years agoUse SafeValue instead of Value in ScopedValue methods
Lars Knoll [Mon, 30 Sep 2013 20:41:12 +0000 (22:41 +0200)]
Use SafeValue instead of Value in ScopedValue methods

Change-Id: Ie463efe600d498ce77d4b9e8b48abcfd61c1ab78
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove some more uses of QV4::Value
Lars Knoll [Mon, 30 Sep 2013 18:57:57 +0000 (20:57 +0200)]
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>
10 years agoRemove more uses of Value
Lars Knoll [Mon, 30 Sep 2013 13:41:24 +0000 (15:41 +0200)]
Remove more uses of Value

Change-Id: I889e760f75b485a28e1f2a2c26b2337ae9bfafac
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix ObjectIterator API to be GC safe
Lars Knoll [Mon, 30 Sep 2013 11:48:05 +0000 (13:48 +0200)]
Fix ObjectIterator API to be GC safe

Change-Id: I3a9c48d53d8dbadcb9b32c00fcef1f89447c4b8c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDon't create a ValueRef to a temporary
Lars Knoll [Wed, 2 Oct 2013 06:13:58 +0000 (08:13 +0200)]
Don't create a ValueRef to a temporary

Change-Id: I6d7fbcee594298517b880e4b0fac9df1f9e54d61
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAlways call callCompleted in QQmlDataBlob::tryDone
Albert Astals Cid [Thu, 26 Sep 2013 08:56:03 +0000 (10:56 +0200)]
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>
10 years agoV4 IR: fix type inference.
Erik Verbruggen [Tue, 1 Oct 2013 15:44:54 +0000 (17:44 +0200)]
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>
10 years agoDon't delete scene-graph atlas manager if it hasn't been created yet
Tor Arne Vestbø [Tue, 1 Oct 2013 13:35:16 +0000 (15:35 +0200)]
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>
10 years agoStabilize tst_qqmlprofilerservice
Gunnar Sletta [Tue, 1 Oct 2013 10:08:39 +0000 (12:08 +0200)]
Stabilize tst_qqmlprofilerservice

Change-Id: Ia381d51561f1c183ec7f2e3fcfe49810bfbfcc61
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoqdoc: no longer recognizes the version nr in QML refs
Martin Smith [Tue, 1 Oct 2013 11:03:28 +0000 (13:03 +0200)]
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>
10 years agoAdd fine-grained QML / QtQuick performance benchmarks
Chris Adams [Wed, 17 Apr 2013 01:27:17 +0000 (11:27 +1000)]
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>
10 years agoFix compilation on Android with 4.8 toolchain
Laszlo Agocs [Tue, 1 Oct 2013 08:14:54 +0000 (10:14 +0200)]
Fix compilation on Android with 4.8 toolchain

Change-Id: I1ce4ec8c9c671f0130c1530c772c1dd74f1fb1f4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoV4: fix ArrayPrototype::method_isArray() build break
J-P Nurmi [Tue, 1 Oct 2013 07:55:50 +0000 (09:55 +0200)]
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>
10 years agoFix PathView stealing mouse grab from its child items.
Andrew den Exter [Fri, 27 Sep 2013 04:26:48 +0000 (14:26 +1000)]
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>
10 years agoFix invalid alias error reporting in new compiler
Simon Hausmann [Mon, 30 Sep 2013 07:41:35 +0000 (09:41 +0200)]
Fix invalid alias error reporting in new compiler

Match exactly the VME code path by reporting the right type of error
as well as the right hand side of the alias binding if necessary.

Change-Id: I35d192a20641e0acbf25d20f3dc5fb53cc7cbae5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoImprove error location reporting for invalid aliases in old VME
Simon Hausmann [Mon, 30 Sep 2013 06:56:29 +0000 (08:56 +0200)]
Improve error location reporting for invalid aliases in old VME

When an alias declaration is missing a location, report the error with the
location of the alias declaration, not the object declaration.  This matches
the code patch in the new compiler, which also reports it accurately.

Change-Id: I709dbddb3273f4e05cc4d63079da52d7224466bd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix error message for group property definitions on signals in new compiler
Simon Hausmann [Mon, 30 Sep 2013 06:46:45 +0000 (08:46 +0200)]
Fix error message for group property definitions on signals in new compiler

It may happen that people forget the colon after the handler name in

    onSomeSignal { code here }

and we have to print out the correct error message. It looks like a
group property, but we can identify this binding due to its reserved
use of starting with "on".

Change-Id: I7c502c1a2a5f2a6c613879468a60bc57a7d20fe8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoImprove component boundary detect in new compiler
Simon Hausmann [Mon, 30 Sep 2013 06:38:55 +0000 (08:38 +0200)]
Improve component boundary detect in new compiler

Instead of going through the property cache and the potential creation
of a dynamic meta object to determine inequality with QQmlComponent::staticMetaObject,
we can simply use the QQmlType and its know metaObject directly to perform
the check. That's faster and more reliably.

Change-Id: If6484b059ec2bed234009755adf2fa3aa19b2b9f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix error messages when assigning to non-existent properties in new compiler
Simon Hausmann [Mon, 30 Sep 2013 06:37:37 +0000 (08:37 +0200)]
Fix error messages when assigning to non-existent properties in new compiler

Introduce a simple valdator pass early on to catch those assignments. Also
fix storing the correct line/col for default property object bindings and
remember the minor/major version of an import in the final type reference.

Change-Id: Ib2a93dfe1a30fcd9c09b5443fb8199ad11b19769
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix line/column in import related error messages with the new compiler
Simon Hausmann [Mon, 30 Sep 2013 04:36:35 +0000 (06:36 +0200)]
Fix line/column in import related error messages with the new compiler

Grab the line/column from the import token, not the import id token,
as the latter is not always present in all import statements.

Change-Id: Iaa0c2f1d60422fb779fa7a6c4fd1c895fa3f777b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix composite type registration in the new compiler
Simon Hausmann [Mon, 30 Sep 2013 03:52:31 +0000 (05:52 +0200)]
Fix composite type registration in the new compiler

When setting a property of a composite type like this

    property MyType foo: MyType {}

and MyType.qml defines the new type, we test for assignability of MyType to the
property foo. This test happens before MyType is instantiated and it relies on
the meta-type in the CompiledData being set. Therefore this patch makes sure
that the meta-type and the list meta-type are set accordingly at type
compilation time, not instantiation time, similar to how it's done in the VME.

Change-Id: Id7231e0a0113fa63ba6508bfbb1565dd554c5e56
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix JS script imports with namespaces
Simon Hausmann [Mon, 30 Sep 2013 03:11:47 +0000 (05:11 +0200)]
Fix JS script imports with namespaces

Make sure to add the resolved namespaces to the import cache, before later
adding scripts into it.

Change-Id: I41537230c49248c2e6c60623bc5a1fe3d50d76cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix support for JS imports in QML files in the new compiler
Simon Hausmann [Mon, 30 Sep 2013 01:28:47 +0000 (03:28 +0200)]
Fix support for JS imports in QML files in the new compiler

Remove the v4 value initialization for imported scripts code out of the VME
(the method didn't even need any members of the VME class) and into ScriptData,
for re-use on the QmlObjectCreator side.

Also add the script index setup for the import cache (used by qml context
wrapper) to the type loader.

Change-Id: Idc3953a48f6fb66d008008e88a2b9b556c775537
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoCompile imported scripts in the loader thread
Simon Hausmann [Sun, 29 Sep 2013 19:20:09 +0000 (21:20 +0200)]
Compile imported scripts in the loader thread

This has the benefit of blocking the GUI thread less and speeding up type
creation in the GUI thread (for types that import js libraries).

This patch also brings one behavioral change: Due to the parsing at type
instantiation type, things like syntax errors for script imports would only
generate a run-time warning and the code in the QML file would just see
"undefined". Errors in the script now generate real errors at component
compilation time, meaning the errors come out earlier and as real errors.

This patch implements the separation for the VME only (to keep the size
of this patch small).

Change-Id: I82f7f3a2d3d4524ea12a7ab62abd8640aba6a47f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 IR: do type inference/propagation before optimization.
Erik Verbruggen [Fri, 27 Sep 2013 16:44:09 +0000 (18:44 +0200)]
V4 IR: do type inference/propagation before optimization.

This gives slightly better results for inplace increment/decrement,
where the operand has to be converted to a number. When that operand is
known to be a number, this conversion can be removed. By doing the
optimizations after typing, these conversions will not only turn into
assignments, but they will be propagated through the IR. That saves
a copy/move, which, in turn, will lighten the work for the register
allocator and the instruction selection.

Change-Id: If76575a71fbcb2d810b94060e61b4364bdaaa065
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: remove inplace operations
Erik Verbruggen [Thu, 26 Sep 2013 12:49:44 +0000 (14:49 +0200)]
V4: remove inplace operations

Inplace operations are expanded when building the IR, so the neither the
IR, nor the instruction selection backends or runtime need to handle
them.

Change-Id: Id01f9544e137dd52364cf2ed2c10931c31ddfff3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4: changed environment variable SHOW_CODE.
Erik Verbruggen [Thu, 26 Sep 2013 08:25:22 +0000 (10:25 +0200)]
V4: changed environment variable SHOW_CODE.

Use QV4_SHOW_ASM for the generated assembly from the JIT, and use
QV4_SHOW_IR to get dumps of the IR.

Change-Id: Id85d3d6c87b47088c312475a7c737d54c58c7791
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix license headers of QtQuick sources.
Gunnar Sletta [Mon, 30 Sep 2013 05:28:31 +0000 (07:28 +0200)]
Fix license headers of QtQuick sources.

Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove debug output from tst_qqmlprofilerservice.
Gunnar Sletta [Mon, 30 Sep 2013 05:50:33 +0000 (07:50 +0200)]
Remove debug output from tst_qqmlprofilerservice.

I suspect this got snuck in accidentally.

Change-Id: I4684bf333a19e6c760ea499b751d51be34f51c6f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoRemove some uses of raw Object pointers
Lars Knoll [Fri, 27 Sep 2013 15:04:42 +0000 (17:04 +0200)]
Remove some uses of raw Object pointers

Change-Id: I7c715f33d197ebbf6f0c00040099b27ed7221d42
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoremove more uses of QV4::Value
Lars Knoll [Fri, 27 Sep 2013 14:15:38 +0000 (16:15 +0200)]
remove more uses of QV4::Value

Change-Id: I11b0b2b7626297e2c98dc77784574da4b59ba8cf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove most uses of Value from qml/qml
Lars Knoll [Fri, 27 Sep 2013 07:45:55 +0000 (09:45 +0200)]
Remove most uses of Value from qml/qml

Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove some more QV4::Value usages
Lars Knoll [Fri, 27 Sep 2013 06:32:44 +0000 (08:32 +0200)]
Remove some more QV4::Value usages

Change-Id: Ic146a964f2ff6b90eeceda90bf1834d7212386a5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove more occurrences of QV4::Value
Lars Knoll [Thu, 26 Sep 2013 20:07:27 +0000 (22:07 +0200)]
Remove more occurrences of QV4::Value

Change-Id: I66c370680d7e6bee2e73a7a940aa96ab4009ec57
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix colorization of native rendered text...
Gunnar Sletta [Fri, 27 Sep 2013 13:31:12 +0000 (15:31 +0200)]
Fix colorization of native rendered text...

Task-number: QTBUG-33633

Change-Id: Ic7fabe36887fc19e28286ae6f4eb2f22b4211b4f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoV4 regalloc: fix the case where too few regs are available.
Erik Verbruggen [Wed, 25 Sep 2013 10:11:14 +0000 (12:11 +0200)]
V4 regalloc: fix the case where too few regs are available.

When all registers are allocated, and a new range gets active, some
other range will have to be split and spilled to the stack. This gets
slightly more complicated when the temporary is defined by a phi-node,
so in that case, the temporary is immediately spilled.

Change-Id: Iaab8b8e88849866e5841ae752377796e8540e30f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 JIT: optimize constant-to-register loading.
Erik Verbruggen [Wed, 25 Sep 2013 09:58:03 +0000 (11:58 +0200)]
V4 JIT: optimize constant-to-register loading.

Change-Id: I02e3cdd5f9a68fbf6bfd7805c385d807b344155b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 JIT: optimize mem2mem copies.
Erik Verbruggen [Tue, 24 Sep 2013 09:42:03 +0000 (11:42 +0200)]
V4 JIT: optimize mem2mem copies.

Instead of loading and decoding a value and then encoding and storing
it, we can just as well fold that into a load+store.

Change-Id: I84c8eb310510a91cefe2cbc0d4bb01856b41663d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoStabilize and speed up test
Lars Knoll [Fri, 27 Sep 2013 12:03:36 +0000 (14:03 +0200)]
Stabilize and speed up test

Added lots of missing qWaitForWindowExposed(), and
sped up animations.

Change-Id: Ie3c5e53dc9e9770baa05fb1da3eedce80ac52d31
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix crash in tst_qmltest with the new animators.
Gunnar Sletta [Sat, 28 Sep 2013 13:37:43 +0000 (15:37 +0200)]
Fix crash in tst_qmltest with the new animators.

If the target of a job was deleted while it was running we need
to avoid any operations on that job.

Task-number: QTBUG-33723
Change-Id: Ia86856e7f32465f58e25c87f9c74c99b7cb0caea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoqmlimportscanner: Fix braces.
Friedemann Kleint [Wed, 25 Sep 2013 14:26:42 +0000 (16:26 +0200)]
qmlimportscanner: Fix braces.

Change-Id: I1361bc1f10b04d0001a1d02b45033ca2c82f8105
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoqmlimportscanner: Use iostream for output consistently.
Friedemann Kleint [Wed, 25 Sep 2013 14:21:38 +0000 (16:21 +0200)]
qmlimportscanner: Use iostream for output consistently.

host-built tools should not use <QDebug>.

Change-Id: I2c69c79c138689d22f4979e268313fb461a8053a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoqmlimportcanner: Compile with QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII.
Friedemann Kleint [Wed, 25 Sep 2013 14:13:27 +0000 (16:13 +0200)]
qmlimportcanner: Compile with QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII.

Clean up single character string constants and string usage.

Change-Id: I242110d57beeb100155757bda170ade479fcb242
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
10 years agoMark qmltest as insignificant to get CI to pass again
Lars Knoll [Sat, 28 Sep 2013 08:46:33 +0000 (10:46 +0200)]
Mark qmltest as insignificant to get CI to pass again

The animator tests keep crashing randomly.

Change-Id: I0d4b177238fc915931c3503b03e29f433ebf4950
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoTry to stabilize the multipleTransitions test
Lars Knoll [Sat, 28 Sep 2013 08:37:10 +0000 (10:37 +0200)]
Try to stabilize the multipleTransitions test

Change-Id: Ifeb53d6a1334623106428410aa2756935d7ba6e1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix compilation of the auto test
Lars Knoll [Fri, 27 Sep 2013 20:19:27 +0000 (22:19 +0200)]
Fix compilation of the auto test

Change-Id: I8c10463aa064a25c0170e6b7f294f48501b42319
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix a few more uses of Value
Lars Knoll [Thu, 26 Sep 2013 14:45:27 +0000 (16:45 +0200)]
Fix a few more uses of Value

Change-Id: Ib34a348d6091cc5f0a624a3f80569a08c7c78989
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove some uses of Value
Lars Knoll [Thu, 26 Sep 2013 14:38:22 +0000 (16:38 +0200)]
Remove some uses of Value

Change-Id: I63ac7485b92c96df8520f0d40b148d807e13eccb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoOptimize storeReturnValue for double arguments
Lars Knoll [Thu, 26 Sep 2013 14:17:38 +0000 (16:17 +0200)]
Optimize storeReturnValue for double arguments

Change-Id: Icfe2ad49f6e12322b4d33fefc3c6de21cc3b6141
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix API for Object::define*Property
Lars Knoll [Thu, 26 Sep 2013 11:05:25 +0000 (13:05 +0200)]
Fix API for Object::define*Property

use ValueRef instead of const Value &.

Change-Id: I3fd0ca829870db27f036825d713c53dc0600be07
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoLess QV4::Value usage
Lars Knoll [Thu, 26 Sep 2013 10:34:53 +0000 (12:34 +0200)]
Less QV4::Value usage

Fix some usages in qv4engine, and fix return types
in methods in qqmlxmlhttprequest.

Change-Id: I3d6225ca01bf7ea77fcc424914c8392bb6c3a454
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix API for evalCall()
Lars Knoll [Thu, 26 Sep 2013 10:08:03 +0000 (12:08 +0200)]
Fix API for evalCall()

Change-Id: Ib80b18348e18eb93044a73358f0c4e266b988f63
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove Value::fromString()
Lars Knoll [Thu, 26 Sep 2013 10:04:52 +0000 (12:04 +0200)]
Remove Value::fromString()

replaced with call to the GC safe ExceutionEngine::newString()
method.

Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix Value usage in ErrorObjects
Lars Knoll [Wed, 25 Sep 2013 20:42:58 +0000 (22:42 +0200)]
Fix Value usage in ErrorObjects

Change-Id: Iaa14ad5a8d3f085843e49195f8f4bb7bb020b9b6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRemove more direct QV4::Value usage
Lars Knoll [Wed, 25 Sep 2013 13:24:50 +0000 (15:24 +0200)]
Remove more direct QV4::Value usage

Remove Value::fromString(String *), and make
Encode safe against encoding raw Managed * pointers.

Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMake Encode not inherit from Value
Lars Knoll [Wed, 25 Sep 2013 12:03:52 +0000 (14:03 +0200)]
Make Encode not inherit from Value

This allows Encoding of Returned<> pointers, and directly
assigning them to a Value.

Change-Id: I0f22b9921ca5712538f22029fa5449242649e01c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove Value::toInteger(double) and related to Primitive
Lars Knoll [Wed, 25 Sep 2013 11:52:15 +0000 (13:52 +0200)]
Move Value::toInteger(double) and related to Primitive

Also clean up a few other direct uses of Value

Change-Id: Ie27d42c1b31b9e6d16d0a60071cb5e4e1c5b9e8b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMake API of QV4::JsonObject GC clean
Lars Knoll [Wed, 25 Sep 2013 11:34:23 +0000 (13:34 +0200)]
Make API of QV4::JsonObject GC clean

Change-Id: Ie7f2d63402c9486b30caf5866af8c747026c091d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove Value::fromBool, ... to a new Primitive class
Lars Knoll [Wed, 25 Sep 2013 10:24:36 +0000 (12:24 +0200)]
Move Value::fromBool, ... to a new Primitive class

This will simplify finding the remaining direct usages of
QV4::Value that need fixing.

Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoUse SafeValue in more places
Lars Knoll [Wed, 25 Sep 2013 09:53:03 +0000 (11:53 +0200)]
Use SafeValue in more places

Change-Id: Ic15c1419c74f22bd7639ce8746ff11b15240b718
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoClean up QV4::ExecutionContext
Lars Knoll [Wed, 25 Sep 2013 08:33:35 +0000 (10:33 +0200)]
Clean up QV4::ExecutionContext

Remove an unused variable, and don't copy runtimeStrings

Change-Id: I2197a7eb82ab3dbefea83cc917567390266f9673
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix CallContext to not hold arguments on the C stack anymore
Lars Knoll [Wed, 25 Sep 2013 08:09:26 +0000 (10:09 +0200)]
Fix CallContext to not hold arguments on the C stack anymore

Change-Id: I35f46cce4f243d4b8b2bac9244f8fc26836f413b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDoc: Updated imports, \qmlmodule, and \inqmlmodule versions in src/qml.
Jerome Pasion [Tue, 24 Sep 2013 14:58:35 +0000 (16:58 +0200)]
Doc: Updated imports, \qmlmodule, and \inqmlmodule versions in src/qml.

-QDoc ignores the version in \inqmlmodule so its better to remove them
to avoid confusion.
-Qt QML import version is 2.2 for 5.2 release
-Qt Quick import version is 2.2 for 5.2 release

Task-number: QTBUG-32172
Change-Id: I15df270f1fb4df0476a9ddd854fb9ddf58e9fc7c
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoUpdate after changes to QTestResult API in qtbase
Tor Arne Vestbø [Thu, 26 Sep 2013 11:59:46 +0000 (13:59 +0200)]
Update after changes to QTestResult API in qtbase

Change-Id: I8a28418753a21c700a365dd369d7befa8ab14f76
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
10 years agoAllow animators to work properly with multiple windows
Gunnar Sletta [Tue, 24 Sep 2013 10:51:36 +0000 (12:51 +0200)]
Allow animators to work properly with multiple windows

Change-Id: I5ba663ba0fa089ea786cf43cb4dfa40cbc955342
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoQSGRenderLoop: don't dereference gl pointer if it has been deleted
Dmitry Shachnev [Wed, 11 Sep 2013 07:58:14 +0000 (11:58 +0400)]
QSGRenderLoop: don't dereference gl pointer if it has been deleted

Change-Id: Icd612b243cdfe1248d1b94964c53f5102f9558d2
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
10 years agoSupport looping for "uncontrolled animations".
Gunnar Sletta [Fri, 20 Sep 2013 13:26:03 +0000 (15:26 +0200)]
Support looping for "uncontrolled animations".

The render thread animations rely heavily on uncontrolled
animations, meaning animations with duration=-1. We support
this by adding a m_currentLoopStartTime and incrementally
counting the finish time of each uncontrolled animation.

Change-Id: I1f2ccea09aff4c51b1a7f98a2ddb58636af50557
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
10 years agoSkip two tests that don't work reliably with a conservative GC
Lars Knoll [Wed, 25 Sep 2013 19:40:54 +0000 (21:40 +0200)]
Skip two tests that don't work reliably with a conservative GC

Change-Id: I5619d533b6e48c88fda063bc7cdcc62d6838bcdf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoConvert more methods in QV8Engine
Lars Knoll [Tue, 24 Sep 2013 13:46:11 +0000 (15:46 +0200)]
Convert more methods in QV8Engine

Change-Id: I5b059b41842b4a6d9541525b3955d2b64c0011c3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMove more API over to use ValueRef
Lars Knoll [Tue, 24 Sep 2013 13:25:10 +0000 (15:25 +0200)]
Move more API over to use ValueRef

Change-Id: I372f1f3e3e78d45912a913f437e622e0acfc9646
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoMake parts of qv8engine_p.h GC safe
Lars Knoll [Tue, 24 Sep 2013 12:28:02 +0000 (14:28 +0200)]
Make parts of qv8engine_p.h GC safe

Change-Id: Iaa15423cedc307a09b3cd7287272d93d7a604caf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix QQmlV4Function API to be GC safe
Lars Knoll [Tue, 24 Sep 2013 11:53:54 +0000 (13:53 +0200)]
Fix QQmlV4Function API to be GC safe

Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix API of QQmlV4Handle
Lars Knoll [Tue, 24 Sep 2013 10:13:42 +0000 (12:13 +0200)]
Fix API of QQmlV4Handle

Change-Id: Iac4a3fefebd33a5990408598486231a5add8e639
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix Persistent/WeakValue API
Lars Knoll [Mon, 23 Sep 2013 13:52:10 +0000 (15:52 +0200)]
Fix Persistent/WeakValue API

Don't use unprotected Values in the API anymore.

Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoCleanups in qv4stringobject
Lars Knoll [Sun, 22 Sep 2013 19:06:34 +0000 (21:06 +0200)]
Cleanups in qv4stringobject

Make the methods GC clean, and simplify some logic

Change-Id: I02df8cb571f27d640c6effc871ea7c24b23b8368
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix WinCE build.
Sérgio Martins [Wed, 25 Sep 2013 16:11:34 +0000 (17:11 +0100)]
Fix WinCE build.

Change-Id: Ie0536ad94f88efe1e54226ed7f1d9e1042ffcc19
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoqmlimportscanner: Print usage when no arguments are passed.
Friedemann Kleint [Wed, 25 Sep 2013 13:55:12 +0000 (15:55 +0200)]
qmlimportscanner: Print usage when no arguments are passed.

Change-Id: I2ba5e18fff635705b1f5e8e19c104ba078c8e3a1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoImport QtQml instead of QtQuick now that Locale is available there.
Mitch Curtis [Fri, 20 Sep 2013 10:31:30 +0000 (12:31 +0200)]
Import QtQml instead of QtQuick now that Locale is available there.

97feace2aaaf08075c17ea175a5ed0c12aa40a0d made it available.

Change-Id: I4a263a26c1db164f410c49fe0fca776aed53f7e8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoDoc: Fix documentation of qmlProtectModule
Topi Reinio [Wed, 25 Sep 2013 13:09:00 +0000 (15:09 +0200)]
Doc: Fix documentation of qmlProtectModule

Fix the function signature used in \fn command and
document the parameters.

Change-Id: Ieda9b2b402886b81691195dbad17663fd454f282
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>