Extend the QML bootstrap library by the IR builders

This is among other things needed to fix the qml import scanner to detect
dependencies from .js files correctly.

The patch also fixes the use of Q_QML_EXPORT towards Q_QML_PRIVATE_EXPORT
where appropriate and corrects the wrong include path for the double conversion
code to actually be relative to the file it is included from. This worked by
accident because of other include paths present in the build.

Change-Id: I338583dad2f76300819af8ab0dae8e5724c84430
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix parsing of JS imports from JS files

If a .js file had an import of another .js file itself, like so:

    .import "otherFile.js" as Blah

then the import scanner would keep the quotes and store

    "\"otherFile.js\""

in the JSON as opposed to

    "otherFile.js"

This is fixed by making use of the same code for extracting the .import
statements from JS files that is also used by the engine itself.

Additionally this fixes the use of comments in .import lines (and other
whitespace characters not producing tokens).

Change-Id: I4dd4a5217308f6fc93b6b148cd8e13392f97d2a6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix crash when loading QML that tries to set non-existent group properties

This happens when trying to search for implicit component definitions,
which only makes sense if we have a property cache.

Task-number: QTBUG-38466
Change-Id: I788159453efc24bcda1b9709a1933b49fd54d6a7
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
V4 regalloc: fix register spill choice under high pressure.

When a register is needed for an input parameter of an operation, and
all registers are already in use, do not select a register for spilling
when it is also used in the current operation.

Task-number: QTBUG-38451
Change-Id: I4a8f28cbaadce2dbb9d0c450ccac0ed572936c24
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Getting the render window of an offscreen window

When using a QQuickWidget, the QQuickWindow is hidden and the contents
are displayed in another window. Some components need to query the actual
window, e.g. when positioning a popup.

Task-number: QTBUG-38116
Change-Id: I34452be2179ccc9e216e4d89264dc700e0cf42a0
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Follow QOpenGLContext API renaming

Task-number: QTBUG-38564
Change-Id: Ice1170339f7d650fcb6accfccf325471629343d6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Fix marking of prototype objects in internal class pool

As per reported bug, we have to protect ourselves against potential loops
and can mark the internal classes much simpler by just walking through
the memory pool they were allocated in.

Task-number: QTBUG-38299
Change-Id: I3ae96e8082e76d06f4321c5aa6d2e9645d2830a0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix packaging builds

In order to access the js parser in release builds, we need to export
these symbols (althoug they remain private API).

Change-Id: Id534bfc8027f9a6feab53b09e7397d920e59e3f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix translations in states causing failing assertions

This is a smaller fix suitable for the release branch, merely adding support
for translations to the bytearray compilation step for states and ensuring a
consistent error message when qsTr is used in list models.

The proper fix will be done in dev that eliminates the entire intermediate
QByteArray storage for custom compilers.

Task-number: QTBUG-38492
Change-Id: If5171f16eb742c718e48b8bbcb265b0c241cd5e7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix linking of qmlimportscanner in MSVC debug builds.

Qt5QmlDevToolsd.lib(qqmlirbuilder.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QmlIR::CompiledFunctionOrExpression::CompiledFunctionOrExpression(void)"

Use Q_QML_PRIVATE_EXPORT so that it does not have effect when building
qmldevtools.

Change-Id: I138fe9cba518829d7ec1d0bfe9d4a9d657446c7d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ensure RGB32 images are not converted on upload to atlas.

Fixes "Typo No.12" reported at http://www.viva64.com/en/b/0251/

Change-Id: Ifa4d57df68b9515c76a8fb94f87d0a70ba3b5faf
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Add dependency check for quickwidgets

If not, there will be an error when building with -no-opengl option:
"Project ERROR: Unknown module(s) in QT: quick-private"
The quickwidgets module depends on qt quick module, and qt quick
module depends on opengl.

Change-Id: If74b5582bdd96ed19ec10dbc534d02146717bc08
Reviewed-by: Liang Qi <liang.qi@digia.com>
V4 IR: replace QSets with QBitArray and QVector.

Change-Id: I565e0a22d4e94495eb427b85a59a62733a815527
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Eliminate a static global QString in qquickpath.cpp

Change-Id: Iad3838f1d215c02555be0acd5f313eaefd4f90a0
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Mark material as dirty after changing color's opacity in Rectangle.

Change-Id: I8037908bb2ba494001c516e2c7606c3bb54a14d8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
V4 IR: more copy removal.

Change-Id: Ie86bf5902328ad105fb07eb3e2809db21ff024d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
V4 regalloc: optimize fixed interval creation.

Instead of creating ranges for all caller saved registers one at a time,
create a single template for all of them. Then change the template for
a (all) specific registers. So, instead of building the ranges every
time for all registers, do it once, and re-use the array. We currently
treat all registers as caller saved, so the ranges can actually be
shared.

Change-Id: I39111ba88be5c49bbab8fe4f2f8c5ad1c89ef282
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix qmltest/animators/tst_on.qml

Change-Id: Ief27b20de100cc7517edab03d752e8eb4299a538
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
v4: assert when an unsupported double value is stored in a value

we assume that just few NaN values can be generated by the HW
(currently 0x7ff800..00 and 0x7ffc00..00), and we use the other values
to encode js values.
If uninitialized memory is interpreted as double or another NaN is
explicitly constructed and feed to the interpreter, it might crash
(later when actually accessing that value).
Adding an assertion to catch those values when assertions are active
for the 32 bit encoding (64 bit already has it).

Task-number: QTBUG-36859
Change-Id: I7ac7b2619f286ba19066729836af718014a515a6
Reviewed-by: Johannes Matokic <johannes.matokic@microchip.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Doc: Remove references to the unimplemented 'time' type

Task-number: QTBUG-32295
Change-Id: Iedd61d0494aeebd6d99a39f4eb81e7461c20a079
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>