|
@@ -10502,10 +10502,10 @@ generate better code by taking this fact into account.
|
|
|
|
|
|
The output language of \code{explicate\_control} is \LangCLoop{}
|
|
|
(Figure~\ref{fig:c7-syntax}), which is nearly identical to
|
|
|
-\LangCIf{}. The only syntactic difference is that
|
|
|
-\code{read} may also appear as a statement. The most significant
|
|
|
-difference between programs in \LangCIf{} and programs in \LangCLoop{},
|
|
|
-generated by the passes of the compiler,
|
|
|
+\LangCIf{}. The only syntactic difference is that \code{read} may also
|
|
|
+appear as a statement. The most significant difference between the
|
|
|
+programs generated by \code{explicate\_control} in
|
|
|
+Chapter~\ref{ch:Lif} versus \code{explicate\_control} in this chapter
|
|
|
is that the control-flow graphs of the later may contain cycles.
|
|
|
|
|
|
\begin{figure}[tp]
|
|
@@ -11476,10 +11476,6 @@ succeed.
|
|
|
%% and ToSpace.
|
|
|
%% \end{exercise}
|
|
|
|
|
|
-
|
|
|
-%% \section{Compiler Passes}
|
|
|
-%% \label{sec:code-generation-gc}
|
|
|
-
|
|
|
The introduction of garbage collection has a non-trivial impact on our
|
|
|
compiler passes. We introduce a new compiler pass named
|
|
|
\code{expose\_allocation}. We make significant changes to
|
|
@@ -14246,10 +14242,12 @@ include all the caller-saved registers. Recall that the reason for
|
|
|
that is to force variables that are live across a function call to be assigned to callee-saved
|
|
|
registers or to be spilled to the stack.
|
|
|
|
|
|
-Regarding the set of read locations $R$ the arity field of
|
|
|
+Regarding the set of read locations $R$, the arity field of
|
|
|
\code{TailJmp} and \code{IndirectCallq} determines how many of the
|
|
|
argument-passing registers should be considered as read by those
|
|
|
-instructions.
|
|
|
+instructions. Also, the target field of \code{TailJmp} and
|
|
|
+\code{IndirectCallq} should be included in the set of read locations
|
|
|
+$R$.
|
|
|
|
|
|
\subsection{Build Interference Graph}
|
|
|
\label{sec:build-interference-r4}
|
|
@@ -15580,6 +15578,8 @@ def g(x_0 : int)-> int:
|
|
|
\label{sec:closure-conversion}
|
|
|
\index{subject}{closure conversion}
|
|
|
|
|
|
+[TODO: discuss conversion of \code{AnnAssign} to \code{Assign} -Jeremy]
|
|
|
+
|
|
|
The compiling of lexically-scoped functions into top-level function
|
|
|
definitions is accomplished in the pass \code{convert\_to\_closures}
|
|
|
that comes after \code{reveal\_functions} and before
|
|
@@ -15728,7 +15728,7 @@ application, we turn function references into closures.
|
|
|
\fi}
|
|
|
{\if\edition\pythonEd
|
|
|
\begin{lstlisting}
|
|
|
-FunRefArity(|$f$|, |$n$|)
|
|
|
+FunRef(|$f$|)
|
|
|
\end{lstlisting}
|
|
|
\fi}
|
|
|
\end{minipage}
|