emacs.d/clones/www.sbcl.org/sbcl-internals/Full-Calls.html
2023-01-18 20:30:47 +01:00

71 lines
3.4 KiB
HTML

<html lang="en">
<head>
<title>Full Calls - SBCL Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="SBCL Internals">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Calling-Convention.html#Calling-Convention" title="Calling Convention">
<link rel="prev" href="Local-Calls.html#Local-Calls" title="Local Calls">
<link rel="next" href="Unknown_002dValues-Returns.html#Unknown_002dValues-Returns" title="Unknown-Values Returns">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual is part of the SBCL software system. See the `README'
file for more information.
This manual is in the public domain and is provided with
absolutely no warranty. See the `COPYING' and `CREDITS' files for
more information.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Full-Calls"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Unknown_002dValues-Returns.html#Unknown_002dValues-Returns">Unknown-Values Returns</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Local-Calls.html#Local-Calls">Local Calls</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Calling-Convention.html#Calling-Convention">Calling Convention</a>
<hr>
</div>
<!-- node-name, next, previous, up -->
<h3 class="section">2.3 Full Calls</h3>
<pre class="example"> ;;; There is something of a cross-product effect with full calls.
;;; Different versions are used depending on whether we know the
;;; number of arguments or the name of the called function, and
;;; whether we want fixed values, unknown values, or a tail call.
;;;
;;; In full call, the arguments are passed creating a partial frame on
;;; the stack top and storing stack arguments into that frame. On
;;; entry to the callee, this partial frame is pointed to by FP.
</pre>
<p>Basically, we use caller-allocated frames, pass an fdefinition,
function, or closure in <code>EAX</code>,
argcount in <code>ECX</code>, and first three args in <code>EDX</code>, <code>EDI</code>,
and <code>ESI</code>. <code>EBP</code> points to just past the start of the frame
(the first frame slot is at <code>[EBP-4]</code>, not the traditional <code>[EBP]</code>,
due in part to how the frame allocation works). The caller stores the
link for the old frame at <code>[EBP-4]</code> and reserved space for a
return address at <code>[EBP-8]</code>. <code>[EBP-12]</code> appears to be an
empty slot available to the compiler within a function, it
may-or-may-not be used by some of the call/return junk. The first stack
argument is at <code>[EBP-16]</code>. The callee then reallocates the
frame to include sufficient space for its local variables, after
possibly converting any <code>&amp;rest</code> arguments to a proper list.
</body></html>