|
@@ -5337,16 +5337,16 @@ described in \cite{Matz:2013aa}), uses a combination of registers and
|
|
stack locations for passing arguments. Up to six arguments may be
|
|
stack locations for passing arguments. Up to six arguments may be
|
|
passed in registers, using the registers \code{rdi}, \code{rsi},
|
|
passed in registers, using the registers \code{rdi}, \code{rsi},
|
|
\code{rdx}, \code{rcx}, \code{r8}, and \code{r9}, in that order. If
|
|
\code{rdx}, \code{rcx}, \code{r8}, and \code{r9}, in that order. If
|
|
-there are more than six arguments, then the rest must be placed on the
|
|
|
|
-stack, which we call \emph{stack arguments}. The register \code{rax}
|
|
|
|
-is for the return value of the function.
|
|
|
|
|
|
+there are more than six arguments, then the rest are placed on the
|
|
|
|
+stack. The register \code{rax} is for the return value of the
|
|
|
|
+function.
|
|
|
|
|
|
We will be using a modification of this convention. For reasons that
|
|
We will be using a modification of this convention. For reasons that
|
|
will be explained in subsequent paragraphs, we will not make use of
|
|
will be explained in subsequent paragraphs, we will not make use of
|
|
-stack arguments, and instead restrict functions to passing arguments
|
|
|
|
-exclusively in registers. To enforce this restriction, functions of
|
|
|
|
-too many arguments will be transformed to pass additional arguments in
|
|
|
|
-a vector.
|
|
|
|
|
|
+the stack for passing arguments, and instead use the heap when there
|
|
|
|
+are more than six arguments. In particular, functions of more than six
|
|
|
|
+arguments will be transformed to pass the additional arguments in a
|
|
|
|
+vector.
|
|
|
|
|
|
%% Recall from Section~\ref{sec:x86} that the stack is also used for
|
|
%% Recall from Section~\ref{sec:x86} that the stack is also used for
|
|
%% local variables and for storing the values of callee-saved registers
|
|
%% local variables and for storing the values of callee-saved registers
|