From aae957a512d2760fe17df85e02d688b69e3ea564 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 9 Jul 2011 11:05:59 -0700 Subject: paper update --- docs/paper.tex | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs') 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} -- cgit v1.2.3-18-g5258