Przeglądaj źródła

fixes to diagrams

Jeremy Siek 6 lat temu
rodzic
commit
b1749d041a
1 zmienionych plików z 56 dodań i 53 usunięć
  1. 56 53
      book.tex

+ 56 - 53
book.tex

@@ -5132,22 +5132,22 @@ if_end33134:
 \node (R3) at (0,2)  {\large $R_3$};
 \node (R3-2) at (3,2)  {\large $R_3$};
 \node (R3-3) at (6,2)  {\large $R_3$};
-\node (C2-1) at (6,0)  {\large $C_2$};
+\node (R3-4) at (9,2)  {\large $R_3$};
 \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) at (3,-2)  {\large $\text{x86}^{*}_2$};
+\node (x86-3) at (6,-2)  {\large $\text{x86}^{*}_2$};
+\node (x86-4) at (9,-2) {\large $\text{x86}^{*}_2$};
+\node (x86-5) at (12,-2) {\large $\text{x86}_2$};
+\node (x86-6) at (12,-4) {\large $\text{x86}^{\dagger}_2$};
 
-\node (x86-2-1) at (3,-4)  {\large $\text{x86}^{*}$};
-\node (x86-2-2) at (6,-4)  {\large $\text{x86}^{*}$};
+\node (x86-2-1) at (3,-4)  {\large $\text{x86}^{*}_2$};
+\node (x86-2-2) at (6,-4)  {\large $\text{x86}^{*}_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-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 left=15] (R3-3) edge [above] node {\ttfamily\footnotesize\color{red} expose-alloc.} (R3-4);
+\path[->,bend left=20] (R3-4) edge [right] 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 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);
@@ -5529,8 +5529,9 @@ language, whose syntax is defined in Figure~\ref{fig:x86-3}.
 \[
 \begin{array}{lcl}
 \Arg &::=&  \gray{  \INT{\Int} \mid \REG{\itm{register}}
-    \mid (\key{deref}\,\itm{register}\,\Int) \mid (\key{byte-reg}\; \itm{register})  } \\
-   &\mid& \gray{  (\key{global-value}\; \itm{name})  } \\
+    \mid (\key{deref}\,\itm{register}\,\Int) } \\
+   &\mid& \gray{ (\key{byte-reg}\; \itm{register}) 
+    \mid   (\key{global-value}\; \itm{name})  } \\
 \itm{cc} & ::= & \gray{  \key{e} \mid \key{l} \mid \key{le} \mid \key{g} \mid \key{ge}  } \\
 \Instr &::=& \gray{  (\key{addq} \; \Arg\; \Arg) \mid
              (\key{subq} \; \Arg\; \Arg) \mid
@@ -5772,28 +5773,28 @@ programs.
 \node (R4) at (0,2)  {\large $R_4$};
 \node (R4-2) at (3,2)  {\large $R_4$};
 \node (R4-3) at (6,2)  {\large $R_4$};
-\node (F1) at (9,2)  {\large $F_1$};
-\node (C3-1) at (6,0)  {\large $C_3$};
-\node (C3-3) at (3,0)  {\large $C_3$};
+\node (F1-1) at (6,0)  {\large $F_1$};
+\node (F1-2) at (3,0)  {\large $F_1$};
+\node (C3-3) at (3,-2)  {\large $C_3$};
 
-\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) at (3,-4)  {\large $\text{x86}^{*}_3$};
+\node (x86-3) at (6,-4)  {\large $\text{x86}^{*}_3$};
+\node (x86-4) at (9,-4) {\large $\text{x86}^{*}_3$};
+\node (x86-5) at (12,-4) {\large $\text{x86}_3$};
+\node (x86-6) at (12,-6) {\large $\text{x86}^{\dagger}_3$};
 
-\node (x86-2-1) at (3,-4)  {\large $\text{x86}^{*}$};
-\node (x86-2-2) at (6,-4)  {\large $\text{x86}^{*}$};
+\node (x86-2-1) at (3,-6)  {\large $\text{x86}^{*}_3$};
+\node (x86-2-2) at (6,-6)  {\large $\text{x86}^{*}_3$};
 
 \path[->,bend left=15] (R4) edge [above] node {\ttfamily\footnotesize\color{red} typecheck} (R4-2);
 \path[->,bend left=15] (R4-2) edge [above] node {\ttfamily\footnotesize uniquify} (R4-3);
-\path[->,bend left=15] (R4-3) edge [above] node {\ttfamily\footnotesize\color{red} reveal-functions} (F1);
-\path[->,bend left=15] (F1) edge [right] node {\ttfamily\footnotesize expose-alloc.} (C3-1);
-\path[->,bend right=15] (C3-1) edge [above] node {\ttfamily\footnotesize flatten} (C3-3);
+\path[->,bend left=15] (R4-3) edge [right] node {\ttfamily\footnotesize\color{red} reveal-functions} (F1-1);
+\path[->,bend left=15] (F1-1) edge [below] node {\ttfamily\footnotesize expose-alloc.} (F1-2);
+\path[->,bend left=15] (F1-2) edge [left] node {\ttfamily\footnotesize flatten} (C3-3);
 \path[->,bend right=15] (C3-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 left=15] (x86-2) edge [left] 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 right=15] (x86-2-2) edge [left] 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);
@@ -6164,34 +6165,36 @@ $\Downarrow$
 
 \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);
+\node (R5) at (0,2)  {\large $R_5$};
+\node (R5-2) at (3,2)  {\large $R_5$};
+\node (R5-3) at (6,2)  {\large $R_5$};
+\node (F2) at (6,0)  {\large $F_2$};
+\node (F1-1) at (3,0)  {\large $F_1$};
+\node (F1-2) at (0,0)  {\large $F_1$};
+\node (C2-3) at (3,-2)  {\large $C_2$};
+
+\node (x86-2) at (3,-4)  {\large $\text{x86}^{*}_3$};
+\node (x86-3) at (6,-4)  {\large $\text{x86}^{*}_3$};
+\node (x86-4) at (9,-4) {\large $\text{x86}^{*}_3$};
+\node (x86-5) at (12,-4) {\large $\text{x86}_3$};
+\node (x86-6) at (12,-6) {\large $\text{x86}^{\dagger}_3$};
+
+\node (x86-2-1) at (3,-6)  {\large $\text{x86}^{*}_3$};
+\node (x86-2-2) at (6,-6)  {\large $\text{x86}^{*}_3$};
+
+\path[->,bend left=15] (R5) edge [above] node {\ttfamily\footnotesize\color{red} typecheck} (R5-2);
+\path[->,bend left=15] (R5-2) edge [above] node {\ttfamily\footnotesize uniquify} (R5-3);
+\path[->,bend left=15] (R5-3) edge [right] node {\ttfamily\footnotesize reveal-functions} (F2);
+\path[->,bend left=15] (F2) edge [below] node {\ttfamily\footnotesize\color{red} convert-to-clos.} (F1-1);
+\path[->,bend right=15] (F1-1) edge [above] node {\ttfamily\footnotesize expose-alloc.} (F1-2);
+\path[->,bend right=15] (F1-2) edge [left] node {\ttfamily\footnotesize flatten} (C2-3);
+\path[->,bend right=15] (C2-3) edge [left] node {\ttfamily\footnotesize select-instr.} (x86-2);
+\path[->,bend left=15] (x86-2) edge [left] node {\ttfamily\footnotesize uncover-live} (x86-2-1);
+\path[->,bend right=15] (x86-2-1) edge [below] node {\ttfamily\footnotesize build-inter.} (x86-2-2);
+\path[->,bend right=15] (x86-2-2) edge [left] node {\ttfamily\footnotesize 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);
+\path[->,bend right=15] (x86-5) edge [left] node {\ttfamily\footnotesize  print-x86} (x86-6);
 \end{tikzpicture}
 \caption{Diagram of the passes for $R_5$, a language with lexically-scoped
   functions.}