Change v4 exceptions to use the common C++ ABIs foreign exceptions
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 1 Oct 2013 13:10:33 +0000 (15:10 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 3 Oct 2013 07:24:32 +0000 (09:24 +0200)
commit8abf7f5876a48c0879bce628597533c7b6eca9a0
treef01dd867b10affb44cefbe050a1f4fcb1a9dfcd1
parenta8796a84fe45aa78123c661aab912f900f2ca0bc
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>
src/qml/jsruntime/jsruntime.pri
src/qml/jsruntime/qv4context.cpp
src/qml/jsruntime/qv4exception.cpp
src/qml/jsruntime/qv4exception_gcc.cpp
src/qml/jsruntime/qv4exception_p.h