|
@@ -4683,10 +4683,12 @@ Recall from Section~\ref{sec:x86} that the stack is also used for
|
|
|
local variables and for storing the values of callee-save registers
|
|
|
(we shall refer to all of these collectively as ``locals''), and that
|
|
|
at the beginning of a function we move the stack pointer \code{rsp}
|
|
|
-down to make room for them. We recommend storing the local variables
|
|
|
-first and then the callee-save registers, so that the local variables
|
|
|
-can be accessed using \code{rbp} the same as before the addition of
|
|
|
-functions. To make additional room for passing arguments, we shall
|
|
|
+down to make room for them.
|
|
|
+%% We recommend storing the local variables
|
|
|
+%% first and then the callee-save registers, so that the local variables
|
|
|
+%% can be accessed using \code{rbp} the same as before the addition of
|
|
|
+%% functions.
|
|
|
+To make additional room for passing arguments, we shall
|
|
|
move the stack pointer even further down. We count how many stack
|
|
|
arguments are needed for each function call that occurs inside the
|
|
|
body of the function and find their maximum. Adding this number to the
|