瀏覽代碼

root stack

clarification how root stack is managed.
Peter Thiemann 3 年之前
父節點
當前提交
c23489132f
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      book.tex

+ 9 - 7
book.tex

@@ -12177,12 +12177,12 @@ changes to also record the number of spills to the root stack.
 
 
 Figure~\ref{fig:print-x86-output-gc} shows the output of the
 Figure~\ref{fig:print-x86-output-gc} shows the output of the
 \code{prelude\_and\_conclusion} pass on the running example. In the
 \code{prelude\_and\_conclusion} pass on the running example. In the
-prelude and conclusion of the \code{main} function, we treat the root
-stack very much like the regular stack in that we move the root stack
-pointer (\code{r15}) to make room for the spills to the root stack,
-except that the root stack grows up instead of down.  For the running
+prelude and conclusion of the \code{main} function, we allocate space
+on the root stack to make room for the spills of tuple-typed
+variables. We do so by bumping the root stack
+pointer (\code{r15}) taking care that the root stack grows up instead of down.  For the running
 example, there was just one spill so we increment \code{r15} by 8
 example, there was just one spill so we increment \code{r15} by 8
-bytes. In the conclusion we decrement \code{r15} by 8 bytes.
+bytes. In the conclusion we decrement \code{r15} by 8 bytes. 
 
 
 One issue that deserves special care is that there may be a call to
 One issue that deserves special care is that there may be a call to
 \code{collect} prior to the initializing assignments for all the
 \code{collect} prior to the initializing assignments for all the
@@ -12194,8 +12194,10 @@ Figure~\ref{fig:print-x86-output-gc}, the instruction
 %
 %
 \lstinline{movq $0, 0(%r15)}
 \lstinline{movq $0, 0(%r15)}
 %
 %
-accomplishes this task. The garbage collector tests each root to see
-if it is null prior to dereferencing it.
+is sufficient to accomplish this task because there is only one spill.
+In general, we have to clear as many words as there are spills of
+tuple-typed variables. The garbage collector tests each root to see
+if it is null prior to dereferencing it. 
 
 
 \begin{figure}[htbp]
 \begin{figure}[htbp]
   % TODO: Python Version -Jeremy
   % TODO: Python Version -Jeremy