Compile imported scripts in the loader thread
authorSimon Hausmann <simon.hausmann@digia.com>
Sun, 29 Sep 2013 19:20:09 +0000 (21:20 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 30 Sep 2013 16:21:26 +0000 (18:21 +0200)
commitc48d727e25f0a07d709a81765af6196bc0ddb4c5
tree1ad34d61bf20e8756d52f44fd17956844a793d84
parent2b6dfcf23b8e9d672dff0a083ed4e7adc28115eb
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>
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4codegen_p.h
src/qml/jsruntime/qv4script.cpp
src/qml/jsruntime/qv4script_p.h
src/qml/qml/qqmltypeloader.cpp
src/qml/qml/qqmltypeloader_p.h
src/qml/qml/qqmlvme.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp