diff options
-rw-r--r-- | docs/paper.tex | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/paper.tex b/docs/paper.tex index 82b99336..4aba3e5f 100644 --- a/docs/paper.tex +++ b/docs/paper.tex @@ -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} |