Fix build on Android with -developer-build

That configuration implies -Werror for some kind of warnings. This patch fixes

   * Mix of different types in conditional (qv4isel_masm.cpp)
   * Noreturn function returning instead of calling another noreturn function at the end (qv4engine_cxxabi.cpp)
   * An out-of-line function being declared inline

Task-Number: QTBUG-33998
Change-Id: I3ba58dcadeac6774c5de63e6bb551354a2f23332
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Optimise code generation for convertTypeToSInt32

Add 64 bit code patch and avoid some duplicated
calculation in 32 bit mode

Change-Id: I0e111de8ac4e733aa8802c49b4b15d785688d7ea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix the remaining objects against self destruction

This makes pretty much all test cases pass with exact
garbage collection.

Change-Id: Ia874e3c17c3984afb7cfe370f9bd3ad8fe46699a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Correctly set the vtbl for Boolean and NumberObject

Also accept a boolean primitive as input to
Boolean.prototype.valueOf()

Change-Id: I5b94d8d65b86e26860b9844eb4bf823577c8e924
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Android: Skip tools built for target architecture

Android apps require packaging to be usable, so they need to be
built individually, not as part of the subdirs build. The build would
fail during make install due to this.

Task-number: QTBUG-34023
Change-Id: Id68f5fbdd4eeb6f130d20a0f4b831c6c24639471
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Correct a small typo to QtQuick::Grid::horizontalItemAlignment

Change-Id: I09d56b69d9d958e7ad4bebd78dd66316a84a50b6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Fix possible crashes

This can (and does crash) when a gc gets triggered during the
linking stage of a compilation unit.

Change-Id: I06f1299adab68ff8e0a4755d02e246870797e7f2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix crash in duplicate labelled statement check

Testcase (part of parserstress in tests/auto/qml):

outer: {
   do {
      inner: {}
   } while (false)
}

The labelled statement visitor, when hitting the outter label, would call
enterLoop(), which sets _labelledStatement back to zero. That then gets added
to the Loop object the do-while loop creates, and the duplicate labelled
statement check then for inner would unconditionally dereference
loop->labelledStatement.

In all other places where we access loop->labelledStatement we have a null
pointer check, so let's have one here as well.

Change-Id: I9d5925a2abf4db691c49c0cdec3550938ee02efa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix determination of lookup mode in V4 code generator

In order to determine the type of lookup we need (name or directly in
environment members), we used Codegen::_mode, which is set to the currently
suitable mode depending on the function (parameter to defineFunction). However
that's not quite correct, the look-up mode depends on the function itself, not
where it was called from. This patch corrects that by moving the compilation
mode into the Environment itself.

This is needed by follow-up patches.

Additionally the "bool deletable" parameter to the builtin_declare_vars was
always set to false, because it used mode instead of _mode, which was never set
to Eval or QmlBinding. This will be cleaned up in a future patch.

Change-Id: I878f187945e5de091689ab5d70a0f33eb5a9e38f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix failing assertion (index != -1) when trying to re-declare a function parameter

Testcase: (covered in parserstress)

function foo(x) {
    var x = 42;
}

In variableDeclaration, the lookup for "x" with findMember will return -1, and
instead code for checking against arguments using indexOfArgument is needed.
The easiest fix is to simply use identifier(), which handles this accordingly.

Change-Id: I6a738d6196d4bff1fc987f111aebbaa83ed8f88f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Compile binding expressions in the QQmlCompiler

This is done by re-using the JS code generator from the new compiler. A few bugs were
fixed on the way:

 * The index into the compiledData->runtimeFunctions array is not the same as the function
   index when they are collected (from the AST), as for example binding expressions may create
   extra V4IR::Function objects that break the 1:1 mapping. Therefore the JS code gen will return
   a mapping from incoming function index to V4IR::Module::Function (and thus runtimeFunction)
 * Binding expressions in the old backend get usually unpacked from their ExpressionStatement node.
   The reference to that node is lost, and instead of trying to preserve it, we simply synthesize it
   again. This won't be necessary anymore with the new compiler in the future.
 * Commit 1c29d63d6045cf9d58cbc0f850de8fa50bf75d09 ensured to always look up locals by name, and so
   we have to do the same when initializing the closures of nested functions inside binding expressions
   (in qv4codegen.cpp)
 * Had to change the Qml debugger service auto-test, which does toString() on a function that is now compiled.
   Even if we implemented FunctionPrototype::toString() to do what v8 does by extracting the string from the
   file, it wouldn't help in this test, because it feeds the input from a string instead of a file.
 * In tst_parserstress we now end up compiling all JS code, which previously was only parsed. This triggers
   some bugs in the SSA handling. Those tests are skipped and tracked in QTBUG-34047

Change-Id: I44df51085510da0fd3d99eb5f1c7d4d17bcffdcf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Compile JS functions as part of the QQmlCompiler run in the loader thread

...instead of extracting the function body as a string and compiling it in the
GUI thread.

Change-Id: I3c3108f6e35464b5581a2d8b5799e7285858ce4d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Compile signal handler expressions in the loader thread

Handle them similar to function declarations, except that we need to synthesize
the expression into a function declaration that includes the signal parameter
names. This is done quite similar to the code path in the new compiler.

Change-Id: I751081f7f1052692da6e2ed60c7f5c017372d829
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Remove some unused flags from Managed

Change-Id: I94399489823d5b0d4d40f300e1999272dc2da5c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4 ARM: fix disassembler vmov

rt is on position 12. See A8.8.345.

Change-Id: Ibf380b9bda8d2edd603857935d6c92cd89d0f104
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 JIT: clean-up conversion functions and add toUInt32.

Change-Id: I7ac685145fa41db2a0e02c4d15d1d287d80621f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 JIT: fix register allocator after change to s/uint32 usage.

Now that shifts can take a signed int32, reflect it in the check if a
binop will generate a call.

Change-Id: I3cab436bace31cdda327cf6132aa873b6c5456b1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Implement >>> inline for the JIT backend

The unsigned right shift operations can use a signed int as input, unifying
the handling with the other shift operations. The only difference now is
in the type of the return value.

Change-Id: Ia9b83568951d1c1c77322d07cd734e2c37d34573
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Add classnames for QML import plugins.

Needed for static builds. qmlimportscanner will
read the "plugin" and "classname" entries.

Change-Id: I31939451366ad3e771d516ac426525c8bcdba57d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make qmlimportscanner report plugin classnames.

Change-Id: Ifbe72e6dcc569c8cb311d46e4f265da348b353ea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>