A call frame for a function is opened. This is explained in more detail in the next chapter.
F must be an executable function, but is a function of 0 arguments. Thus, there is no need to collect arguments. The call frame is opened and activated in a single miscop.
Just like a Call miscop, but it marks the frame to indicate that multiple values will be accepted. See section Multi.
is called to handle the last argument of a function called by apply. All the other arguments will have been properly set up by this time. Set-up-apply-args places the values of the list passed as the last argument to apply in their proper locations, whether they belong in argument registers or on the stack. It updates the NArgs register with the actual count of the arguments being passed to the function. When Set-up-apply-args returns, all the arguments to the function being applied are in their correct locations, and the function can be invoked normally.
is called from the interpreter to start a function call. It accepts the number of arguments that are pushed on the stack in register A0. Just below the arguments is the function to call; just below the function is the area to store the preserved registers. This miscop sets up the argument registers correctly, moves any other arguments down on the stack to their proper place, and invokes the function.
is similar to Start-Call-Interpreter, but is simpler, since the Function is being called with only a single Argument.
is similar to Invoke1, but the Function being called is called for one value, rather than multiple ones.
is called when the compiler generates code for the form multiple-value-call. Register A0 contains the function to be called, A1 contains a 0 if the call if for a single value, and 1 otherwise, NArgs contains the number of arguments that are stored on the stack. The argument registers are set up correctly, and the excess values moved down on the stack if necessary. Finally, the function is actually invoked.
closes the currently open call frame, and initiates a function call.
Return from the current function call. After the current frame is popped off the stack, X is returned in register A0 as the result Being returned. See Return for more details.
is similar to Return, except it accepts the frame to return from as an additional argument.
is similar to return, except only one value is returned. Any number of bindings are undone during the return operation.
is similar to return, except multiple values may be returned, but the binding stack does not have to be popped.
finds the correct link table entry for Symbol with NArgs (NArgs specifies the fixed number of arguments and a flag if more may be passed). It smashes the Code-Vector at Offset to generate code to point at the absolute address of the link table entry.
smashes Code-Vector at Offset with the correct value for the miscop specified by Index in a transfer vector of all the miscops.
returns a new function object that is a copy of the function object fcn which has the env information stored at offset. Compiled lexical closures are now represented as real function objects rather than as lists. This miscop is necessary to support this change.
resets all the link table entries for function to the default action. This is necessary because Portable Commonloops updates generic function objects by copying new information into the function object. The link table must be updated to reflect this or the wrong function will be called.
gets the first indication that a Unix signal has occurred. This miscop does not follow the normal Lisp calling conventions at all. Instead it follows the standard IBM RT PC calling conventions for C or other algorithmic languages. On entry the registers are as follows:
Pointer to C data area for Interrupt-Handler. Currently this data area only holds a pointer to the entry point for Interrupt-Handler and nothing else.
Pointer to a C stack that contains information about the signal.
Contains the Signal number that caused the interrupt to happen.
Contains the Code that further specifies what caused the interrupt (if necessary).
Contains a pointer to the signal-context which contains information about where the interrupt occurred, the saved registers, etc.
Contain unknown values.
is the return PC which will return from the interrupt handler and restart the computation.
Interrupt-Handler determines whether it is safe to take the interrupt now, i.e., it is executing in Lisp code, C code, or an interruptible miscop. An interruptible miscop is one that has been specially written to make sure that it is safe to interrupt it at any point and is possible that it will never return of its own accord (e.g., length which could be passed a circular list, some of the system call miscops, etc.). If it is safe to take the interrupt, the signal-context is modified so that control will transfer to the miscop interrupt-routine when the interrupt-handler returns normally (i.e., after the kernel has done the necessary bookkeeping). If it is unsafe to take the interrupt (i.e., it is executing in an non-interruptible miscop), then the return PC of the miscop is modified to be interrupt-routine and interrupt-handler returns to the kernel. In either case interrupts are disabled and information is stored in a global Lisp data area, so that the interrupt-routine miscop can retrieve the important information about the interrupt.
gets control when it is safe to take an interrupt. It saves the current state of the computation on the appropriate stack (on the C stack if it was executing in C or on the Lisp stack if in Lisp) including all the registers, some control information specifying whether the computation was in C code, Lisp code, whether it should form a PC in register R15. When a PC has to be formed in R15, R14 will contain a pointer to the active function and R15 will contain an index into the code vector associated with the active function. Reforming the PC is necessary so it is possible to restart a computation even after a garbage collection may have moved the function. Once this information is stored, interrupt-routine invokes the Lisp function %sp-software-interrupt-routine which moves the processing of the interrupt to Lisp code.
returns from a function called by the interrupt-routine miscop. The only function that should ever do this is %sp-software-interrupt-routine. This miscop expects the stack to be in a format that is generated during an interrupt and should not be used for anything else.
builds a catch frame. Tag is the tag caught by this catch frame, PC is a saved-format PC (i.e., an index into the current code vector). See Catch for details.
builds a multiple-value catch frame. Tag is the tag caught by this catch frame, and PC is a saved-format PC. See Catch for details.
builds a catch frame whose tag is the special Catch-All object. PC is the saved-format PC, which is the address to branch to if this frame is thrown through. See Catch for details.
Tag is the throw-tag, normally a symbol. X is the value to be returned. See Catch for a description of how this miscop works.
are miscops that do the processing for a function at its &rest entry point. Rest-Entry-i are miscops that are invoked by functions that have 0, 1, or 2 arguments before the &rest argument. Rest-entry is invoked for all other cases, and is passed an additional argument in A3 which is the number of non-&rest arguments. These miscops form the &rest arg list and set up all the registers to have the appropriate values. In particular, the non-&rest arguments are copied into preserved registers, and the &rest arg list is built and stored in the appropriate preserved register or on the stack as appropriate.
establishes the C environment so that C code can be called correctly. C-Function is a pointer to the data area for a C function, the first word of which is a pointer to the entry point of the C function. Arguments is a block of storage that contains the NArgs arguments to be passed to the C function. The first four of these arguments are passed in registers R2 through R5 respectively, the rest are moved onto the C stack in the proper location. When the C function returns, Call-Foreign restores the Lisp environment and returns as its value the integer in R2.
is a Lisp miscop that gets control when a C function needs to call a Lisp function. Lisp provides a mechanism for setting up an object that looks like a C procedure pointer. The code pointer in this object always points at Call-Lisp. Additional data in this procedure pointer is the Lisp function to call and the number of arguments that it should be called with. Call-Lisp restores the Lisp environment, saves the state of the C computation, moves the C arguments into the correct places for a call to a Lisp function and then invokes the special Lisp function call-lisp-from-c. This Lisp function actually invokes the correct Lisp function. Call-Lisp never regains control.
is used in the function call-lisp-from-c to return control to C from a Lisp function called by C. C-Stack-Pointer is the C stack pointer when the call-lisp miscop got control. The C stack pointer argument is used to restore the C environment to what it was at the time the call to Lisp was made. Value is the value returned from Lisp and is passed back to C in register R2. Currently, it is not possible to return other than a single 32 bit quantity.
is invoked when a Lisp function called by C throws out past where it should return to C. Reset-C-Stack restores the C stack to what it was before the original call to C happened. This is so that in the future, the C stack will not contain any garbage that should not be there.
sets the I/2’th element of sap to be the data part of the statically allocated g-vector Proc. This is used to set up a C procedure argument in the argument block that is passed to call-foreign.