Procházet zdrojové kódy

fix description of precoloring

Andrew Tolmach před 4 roky
rodič
revize
7da482561b
1 změnil soubory, kde provedl 9 přidání a 3 odebrání
  1. 9 3
      book.tex

+ 9 - 3
book.tex

@@ -4741,9 +4741,15 @@ Implement the compiler pass \code{allocate-registers}.
   where \code{coloring} is a \code{Map} whose keys are vertices
   and whose values are integer colors. The \code{color}
   function takes a graph and an initial precoloring, which should be
-  used to pre-set negative colors for vertices that already represent
-  registers, including \code{rax}, \code{rsp}, and the
-  caller-save registers. It then colors the remaining
+  used to pre-set colors for vertices that already represent
+  registers. (The registers you never want to used for storing variables
+  should be given negative numbers: these include \code{rax} and  \code{rsp}.
+  The other registers that might appear in the graph are the caller-save
+  registers---if you have constructed the graph correctly, there will be
+  vertices for all the caller-save registers \emph{if} there are one or
+  more \code{callq} instructions in the function. These caller-save registers
+  should be pre-assigned colors $0,1,2,3,\ldots$. Can you see why?)
+  It then colors the remaining
   vertices with colors 0,1,$\ldots$, trying to assign the smallest
   possible color to each vertex.  (The implementation of \code{color}
   follows the general approach described in the book, but dispenses