Each compiled function is represented in the machine as a Function Object. This is identical in form to a G-Vector of lisp objects, and is treated as such by the garbage collector, but it exists in a special function space. (There is no particular reason for this distinction. We may decide later to store these things in G-Vector space, if we become short on spaces or have some reason to believe that this would improve paging behavior.) Usually, the function objects and code vectors will be kept in read-only space, but nothing should depend on this; some applications may create, compile, and destroy functions often enough to make dynamic allocation of function objects worthwhile.
The function object contains a vector of header information needed by the function-calling mechanism: a pointer to the I-Vector that holds the actual code. Following this is the so-called “symbols and constants” area. The first few entries in this area are fixnums that give the offsets into the code vector for various numbers of supplied arguments. Following this begin the true symbols and constants used by the function. Any symbol used by the code as a special variable. Fixnum constants can be generated faster with in-line code than they can be accessed from the function-object, so they are not stored in the constants area.
The subtype of the G-Vector header indicates the type of the function:
Only the fexpr information has any real meaning to the system. The rest is there for the printer and anyone else who cares.
After the one-word G-Vector header, the entries of the function object are as follows:
0 Name of the innermost enclosing named function. 1 Pointer to the unboxed Code vector holding the instructions. 2 A fixnum with bit fields as follows: 24 - 31: The minimum legal number of args (0 to 255). 16 - 23: The maximum number of args, not counting &rest (0 to 255). The fixnum has a negative type code, if the function accepts a &rest arg and a positive one otherwise. 3 A string describing the source file from which the function was defined. See below for a description of the format. 4 A string containing a printed representation of the argument list, for documentation purposes. If the function is a defmacro macroexpansion function, the argument list will be the one originally given to defmacro rather than the actual arglist to the expansion function. 5 The symbols and constants area starts here. This word is entry 0 of the symbol/constant area. The first few entries in this area are fixnums representing the code-vector entry points for various numbers of optional arguments.