This commit is contained in:
Alon Zakai 2011-07-09 11:05:59 -07:00
Родитель c79828f6b8
Коммит aae957a512
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -717,6 +717,17 @@ now give a summary of some of the limitations of Emscripten's approach.
using normal JavaScript loops.
\end{itemize}
After seeing these limitations, it is worth noting that some advanced LLVM instructions turn out to be
surprisingly easy to implement. For example, C++ exceptions are represented in
LLVM by \emph{invoke} and \emph{unwind}, where \emph{invoke} is a call to a function that will
potentially trigger an \emph{unwind}, and \emph{unwind} returns to the earliest invoke.
If one were to implement those
in a typical compiler, doing so would require careful work. In Emscripen, however,
it is possible to do so using JavaScript exceptions in a straightforward manner:
\emph{invoke} becomes a function call wrapped in a \emph{try} block, and \emph{unwind}
becomes \emph{throw}. This is a case where compiling to a high-level language turns
out to be quite convenient.
\section{Emscripten's Architecture}
\label{sec:emarch}