|
@@ -3939,15 +3939,13 @@ and is of type \code{(Vector $\Type_1 \ldots \Type_n$)}, then we put
|
|
it on the shadow stack instead of the normal procedure call stack.
|
|
it on the shadow stack instead of the normal procedure call stack.
|
|
Figure~\ref{fig:shadow-stack} reproduces the example from
|
|
Figure~\ref{fig:shadow-stack} reproduces the example from
|
|
Figure~\ref{fig:copying-collector} and contrasts it with the data
|
|
Figure~\ref{fig:copying-collector} and contrasts it with the data
|
|
-layout using a shadow stack. The shadow stack contains both pointers
|
|
|
|
-from the regular stack and also contains a copy of the pointer that
|
|
|
|
-was a in the second register. We shall implement the garbage collector
|
|
|
|
-in a separate function that will need to use registers, so prior to
|
|
|
|
-invoking the garbage collector (or any function call for that matter)
|
|
|
|
-we recommend pushing all pointers in registers to the shadow stack.
|
|
|
|
-After the call, the pointers have to be popped back into their
|
|
|
|
-original registers because the locations of the objects may have
|
|
|
|
-changed.
|
|
|
|
|
|
+layout using a shadow stack. The shadow stack contains the two
|
|
|
|
+pointers from the regular stack and also the pointer in the second
|
|
|
|
+register. Prior to invoking the garbage collector, we shall push all
|
|
|
|
+pointers in local variables (resident in registers or spilled to the
|
|
|
|
+stack) onto the shadow stack. After the collection, the pointers must
|
|
|
|
+be popped back into the local variables because the locations of the
|
|
|
|
+pointed-to objects will have changed.
|
|
|
|
|
|
\begin{figure}[tbp]
|
|
\begin{figure}[tbp]
|
|
\centering \includegraphics[width=0.7\textwidth]{shadow-stack}
|
|
\centering \includegraphics[width=0.7\textwidth]{shadow-stack}
|
|
@@ -3975,7 +3973,7 @@ simply change the value of bit 0 to 0. (Our objects are 8-byte
|
|
aligned, so the bottom 3 bits of a pointer are always 0.)
|
|
aligned, so the bottom 3 bits of a pointer are always 0.)
|
|
|
|
|
|
\begin{figure}[tbp]
|
|
\begin{figure}[tbp]
|
|
-\centering \includegraphics[width=0.9\textwidth]{tuple-rep}
|
|
|
|
|
|
+\centering \includegraphics[width=0.8\textwidth]{tuple-rep}
|
|
\caption{Representation for tuples in the heap.}
|
|
\caption{Representation for tuples in the heap.}
|
|
\label{fig:tuple-rep}
|
|
\label{fig:tuple-rep}
|
|
\end{figure}
|
|
\end{figure}
|