|
@@ -5140,8 +5140,8 @@ if_end33134:
|
|
|
|
|
|
\path[->,bend left=15] (R3) edge [above] node {\ttfamily\footnotesize\color{red} typecheck} (R3-2);
|
|
\path[->,bend left=15] (R3) edge [above] node {\ttfamily\footnotesize\color{red} typecheck} (R3-2);
|
|
\path[->,bend left=15] (R3-2) edge [above] node {\ttfamily\footnotesize uniquify} (R3-3);
|
|
\path[->,bend left=15] (R3-2) edge [above] node {\ttfamily\footnotesize uniquify} (R3-3);
|
|
-\path[->,bend left=15] (R3-3) edge [right] node {\ttfamily\footnotesize\color{red} flatten} (C2-1);
|
|
|
|
-\path[->,bend right=15] (C2-1) edge [above] node {\ttfamily\footnotesize\color{red} expose-alloc.} (C2-3);
|
|
|
|
|
|
+\path[->,bend left=15] (R3-3) edge [right] node {\ttfamily\footnotesize\color{red} expose-alloc.} (C2-1);
|
|
|
|
+\path[->,bend right=15] (C2-1) edge [above] node {\ttfamily\footnotesize\color{red} flatten} (C2-3);
|
|
\path[->,bend right=15] (C2-3) edge [left] node {\ttfamily\footnotesize\color{red} select-instr.} (x86-2);
|
|
\path[->,bend right=15] (C2-3) edge [left] node {\ttfamily\footnotesize\color{red} select-instr.} (x86-2);
|
|
\path[->,bend left=15] (x86-2) edge [right] node {\ttfamily\footnotesize uncover-live} (x86-2-1);
|
|
\path[->,bend left=15] (x86-2) edge [right] node {\ttfamily\footnotesize uncover-live} (x86-2-1);
|
|
\path[->,bend right=15] (x86-2-1) edge [below] node {\ttfamily\footnotesize \color{red}build-inter.} (x86-2-2);
|
|
\path[->,bend right=15] (x86-2-1) edge [below] node {\ttfamily\footnotesize \color{red}build-inter.} (x86-2-2);
|
|
@@ -5761,6 +5761,43 @@ compiler on these new programs and all of your previously created test
|
|
programs.
|
|
programs.
|
|
\end{exercise}
|
|
\end{exercise}
|
|
|
|
|
|
|
|
+\begin{figure}[p]
|
|
|
|
+\begin{tikzpicture}[baseline=(current bounding box.center)]
|
|
|
|
+\node (R3) at (0,2) {\large $R_4$};
|
|
|
|
+\node (R3-2) at (3,2) {\large $R_4$};
|
|
|
|
+\node (R3-3) at (6,2) {\large $R_4$};
|
|
|
|
+\node (R3-4) at (9,2) {\large $R_3$};
|
|
|
|
+\node (C2-1) at (6,0) {\large $C_2$};
|
|
|
|
+\node (C2-3) at (3,0) {\large $C_2$};
|
|
|
|
+
|
|
|
|
+\node (x86-2) at (3,-2) {\large $\text{x86}^{*}$};
|
|
|
|
+\node (x86-3) at (6,-2) {\large $\text{x86}^{*}$};
|
|
|
|
+\node (x86-4) at (9,-2) {\large $\text{x86}^{*}$};
|
|
|
|
+\node (x86-5) at (12,-2) {\large $\text{x86}$};
|
|
|
|
+\node (x86-6) at (12,-4) {\large $\text{x86}^{\dagger}$};
|
|
|
|
+
|
|
|
|
+\node (x86-2-1) at (3,-4) {\large $\text{x86}^{*}$};
|
|
|
|
+\node (x86-2-2) at (6,-4) {\large $\text{x86}^{*}$};
|
|
|
|
+
|
|
|
|
+\path[->,bend left=15] (R3) edge [above] node {\ttfamily\footnotesize\color{red} typecheck} (R3-2);
|
|
|
|
+\path[->,bend left=15] (R3-2) edge [above] node {\ttfamily\footnotesize uniquify} (R3-3);
|
|
|
|
+\path[->,bend left=15] (R3-3) edge [above] node {\ttfamily\footnotesize\color{red} reveal-functions} (R3-4);
|
|
|
|
+\path[->,bend left=15] (R3-4) edge [right] node {\ttfamily\footnotesize expose-alloc.} (C2-1);
|
|
|
|
+\path[->,bend right=15] (C2-1) edge [above] node {\ttfamily\footnotesize flatten} (C2-3);
|
|
|
|
+\path[->,bend right=15] (C2-3) edge [left] node {\ttfamily\footnotesize\color{red} select-instr.} (x86-2);
|
|
|
|
+\path[->,bend left=15] (x86-2) edge [right] node {\ttfamily\footnotesize\color{red} uncover-live} (x86-2-1);
|
|
|
|
+\path[->,bend right=15] (x86-2-1) edge [below] node {\ttfamily\footnotesize \color{red}build-inter.} (x86-2-2);
|
|
|
|
+\path[->,bend right=15] (x86-2-2) edge [right] node {\ttfamily\footnotesize\color{red} allocate-reg.} (x86-3);
|
|
|
|
+\path[->,bend left=15] (x86-3) edge [above] node {\ttfamily\footnotesize lower-cond.} (x86-4);
|
|
|
|
+\path[->,bend left=15] (x86-4) edge [above] node {\ttfamily\footnotesize patch-instr.} (x86-5);
|
|
|
|
+\path[->,bend right=15] (x86-5) edge [left] node {\ttfamily\footnotesize\color{red} print-x86} (x86-6);
|
|
|
|
+\end{tikzpicture}
|
|
|
|
+\caption{Diagram of the passes for $R_4$, a language with functions.}
|
|
|
|
+\label{fig:R4-passes}
|
|
|
|
+\end{figure}
|
|
|
|
+
|
|
|
|
+Figure~\ref{fig:R4-passes} gives an overview of all the passes needed
|
|
|
|
+for the compilation of $R_4$.
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
\chapter{Lexically Scoped Functions}
|
|
\chapter{Lexically Scoped Functions}
|