@@ -13002,7 +13002,7 @@ \section{Expose Allocation}
1300213002expressions to temporary variables (see below).
1300313003
1300413004The output of \code{expose\_allocation} is a language \LangAlloc{}
13005- that replaces tuple creation with new lower-level forms that we use in the
13005+ that replaces tuple creation with new forms that we use in the
1300613006translation of tuple creation\index{subject}{Lalloc@\LangAlloc{}}.
1300713007%
1300813008{\if\edition\racketEd
@@ -13016,22 +13016,27 @@ \section{Expose Allocation}
1301613016\fi}
1301713017{\if\edition\pythonEd\pythonColor
1301813018\[
13019- \begin{array}{lcl}
13020- \Exp &::=& \key{collect}(\itm{int})
13021- \MID \key{allocate}(\itm{int},\itm{type})
13022- \MID \key{global\_value}(\itm{name}) \\
13023- \Stmt &::= & \CASSIGN{\CPUT{\Exp}{\itm{int}}}{\Exp}
13019+ %% \begin{array}{lcl}
13020+ %% \Exp &::=& \key{collect}(\itm{int})
13021+ %% \MID \key{allocate}(\itm{int},\itm{type})
13022+ %% \MID \key{global\_value}(\itm{name}) \\
13023+ %% \Stmt &::= & \CASSIGN{\CPUT{\Exp}{\itm{int}}}{\Exp}
13024+ %% \end{array}
13025+ \begin{array}{rcl}
13026+ \Exp &::=& \COLLECT{\Int} \MID \ALLOCATE{\Int}{\Type} \\
13027+ &\MID& \GLOBALVALUE{\Var} \MID \BEGIN{\Stmt^{*}}{\Exp}\\
13028+ \Stmt{} &::=& \ASSIGN{\PUT{\Exp}{\itm{int}}}{\Exp}
1302413029\end{array}
1302513030\]
1302613031\fi}
1302713032%
13028- The \CCOLLECT {$n$} form runs the garbage collector, requesting that
13033+ The \COLLECT {$n$} form runs the garbage collector, requesting that
1302913034there be $n$ bytes ready to be allocated. During instruction
13030- selection\index{subject}{instruction selection}, the \CCOLLECT {$n$}
13035+ selection\index{subject}{instruction selection}, the \COLLECT {$n$}
1303113036form will become a call to the \code{collect} function in
1303213037\code{runtime.c}.
1303313038%
13034- The \CALLOCATE {$n$}{$\itm{type}$} form obtains memory for $n$ elements (and
13039+ The \ALLOCATE {$n$}{$\itm{type}$} form obtains memory for $n$ elements (and
1303513040space at the front for the 64-bit tag), but the elements are not
1303613041initialized. \index{subject}{allocate} The $\itm{type}$ parameter is the type
1303713042of the tuple:
@@ -13040,11 +13045,14 @@ \section{Expose Allocation}
1304013045%
1304113046where $\Type_i$ is the type of the $i$th element.
1304213047%
13043- The \CGLOBALVALUE {\itm{name}} form reads the value of a global
13048+ The \GLOBALVALUE {\itm{name}} form reads the value of a global
1304413049variable, such as \code{free\_ptr}.
13050+ %
13051+ \python{We have already seen the \BEGIN{\itm{stmt}$^{*}$}{\itm{exp}} form
13052+ in section~\ref{sec:remove-complex-opera-Lif}.}
1304513053
1304613054\racket{
13047- The type information that you need for \CALLOCATE {$n$}{$\itm{type}$}
13055+ The type information that you need for \ALLOCATE {$n$}{$\itm{type}$}
1304813056 can be obtained by running the
1304913057 \code{type-check-Lvec-has-type} type checker immediately before the
1305013058 \code{expose\_allocation} pass. This version of the type checker
0 commit comments