aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-07-09 11:05:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-07-09 11:05:59 -0700
commitaae957a512d2760fe17df85e02d688b69e3ea564 (patch)
tree8c83f75a63af041f3d3aa08053fef70fb6e17ad7 /docs
parentc79828f6b89cc64cb21ebfa00454b8ce26718cf8 (diff)
paper update
Diffstat (limited to 'docs')
-rw-r--r--docs/paper.tex11
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}