Make it possible to supply an external JS unit generator to the isel

This is needed for QML unit generation, when we share the JS generator
for QML types/strings and JS code.

Change-Id: I50f0c1fa6721d6e3e59417c6c256c82aec124e8f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Merge branch 'dev' of qtdeclarative into wip/v4

Change-Id: I561b5ed920839430d7dd32e9ca4a5192b8537667
Remove unused script parser options

Change-Id: Ie3aafe924011466ce2677e10cc69ece61a563db3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Beginning of a new qml parser

The goal is to parse QML and JavaScript binding expressions/functions in one
go and generate data structures that allow for the parsing to happen in a thread
and the instantiation of the object tree in another thread, just reading from
the generated data structures. This will replace qqmlcompiler and the VME.

This new way of loading QML is currently hidden behind the QML_NEW_COMPILER=1
environment variable. There's lots of work left to fill in the gaps in object
construction, Component support, Component.onComplete, error messages, etc. etc.

Change-Id: I5e40643cff169f469f0b6ce151584ffee5ca5e90
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Free the parsed QML data structure when we're done compiling the type

The QQmlTypeData is going to stick around (and keep the important stuff
in its m_compiledData member), but the rest of the data we can
free.

Change-Id: If331504055960145911fef566b309f812dca5337
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix error reporting in the new object creator

Propagate error conditions from createVMEMetaObjectAndPropertyCache to the caller
and properly clean up refcounts (using QQmlRefPointer)

Also fixed qmlscene to report errors if create() failed.

Change-Id: I75d984798a197c102078e5d5638ed92f167ab49f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix error reporting for wrong signal parameter declarations

Record the line/column in the signal and report it together with the url
if there was an error in declaring the signals.

Change-Id: Idbbee9be271b0ca55709ffc1791637595d7ebd89
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix type name cache creation

Re-use the QQmlImports object created already in the type loader, which will
take care of importing scripts and others. This gets rid of the "###" in
qqmlobjectcreator and also delegates the type name cache population back
to the loader thread. (And will allow for passing to the JS code gen, for
type resolution and propagation in the future)

Change-Id: I21b0dfc853166200b3bc864f6c0644b2f87a4586
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Merge branch 'dev' of qtdeclarative into wip/v4

Conflicts:
	src/qml/jsruntime/qv4script.cpp

Change-Id: I20136cab29d86862b5bd9208003200bc24bcdacf
Fix -Werror build

Change-Id: Ib184ad5e0c99050df227e2c8413b466fccb69236
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix error reporting timing

Errors for example in signal declarations are usually reported in the loader
thread, during property cache construction. This patch separates out the
property cache population into QQmlPropertyCacheCreator, runs it from the
loader thread and reduces the QQmlObjectCreator to merely set the properties/bindings/
functions on the object.

This also enables location tracking for signal declarations and their error reporting.

Change-Id: Ief1ffbb3113f8279a50d1a12dab8dbe096702a60
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Improve error reporting

Re-enable COMPILE_EXCEPTION calls that were commented out due to missing
location information (that this patch also adds).

Change-Id: I0d584f474cc7e879350c8aae2869a9603ba415aa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Implement name sanity checking for properties, signals and functions

Change-Id: I58c442dc56075c449ebd2534ab6b9f90e7da8eae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Implement plain simple locking in the executable memory allocator

Memory allocations may now also happen to come from a separate thread, the QML
loader thread where we also compile the JavaScript code and (likely) use the
JIT. Commonly that will be the only place where the allocator will be used. The
main thread uses the allocator only when an exception is thrown (to look up
platform unwind info) or when the garbage collector runs and decides to delete
objects that also hold the last reference to executable memory.

Change-Id: I8bb710184164cd8d32168449f48d09f7ee828e6e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Implement proper type resolution

Collect all references to unknown types after parsing, re-use the existing code
in QQmlTypeLoader to resolve them and finally use the resolved references map
in the QQmlObjectCreator instead of the type name cache directly.

Change-Id: I8b83af4f8852e79c33985457081c024358bb9622
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into HEAD

Conflicts:
	src/qml/compiler/qv4isel_masm.cpp
	src/qml/jsruntime/qv4script.cpp
	src/qml/qml/qml.pri
	src/qml/qml/qqmltypeloader_p.h

Change-Id: Ia784d855a2131e3289454f12d841ca2c65be15c1
[new compiler] Initial support for group properties

This implements support for "font.pixelSize: 24" for example. The representation
in the compile data structure is so that font.pixelSize is short-hand for

font {
    pixelSize: 24
}

which means that inside the braces is a complete object initializer. For that
initializer we create a dedicated CompiledData::Object, which however has its
type name empty. When populating the outer instance then, the "font" property
is read as QQmlValueType (a QObject) and instead of creating a new QObject we
use that value type as instance to run the rest of the QML object initializer
(everything in braces).

Change-Id: Ic0a37ac77ab88f582546b9c09a3d06a07726420b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Add support for id properties

Change-Id: Idb4a0ad06f6cbe5d040da075a8f43d067a27ebc4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Cleanup: Fold CompiledData::Value into CompiledData::Binding

Value isn't needed anywhere else

Change-Id: Ib12d85332a6096e6232a790a7e6fd63961329e3b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
[new compiler] Fix function and binding expression setup

Binding expressions and QML used to be set up so that they were written
as function closure:

    (function(...) {
      expression here
    })

and then evaluated inside qml scope. With the new setup we do that closure
setup manually now.

For that we have to define a dummy outter "context scope" function in the
codegen, that will later be used to look up the context ids.

Change-Id: I0656419d67a1728451fcd46f402b03979f118b0b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>