Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.
Next: Inlined Mathematical Instructions, Previous: Miscellaneous Instructions, Up: Instruction Set [Contents][Index]
The Scheme compiler can recognize the application of standard Scheme procedures. It tries to inline these small operations to avoid the overhead of creating new stack frames.
Since most of these operations are historically implemented as C primitives, not inlining them would entail constantly calling out from the VM to the interpreter, which has some costs—registers must be saved, the interpreter has to dispatch, called procedures have to do much type checking, etc. It’s much more efficient to inline these operations in the virtual machine itself.
All of these instructions pop their arguments from the stack and push their results, and take no parameters from the instruction stream. Thus, unlike in the previous sections, these instruction definitions show stack parameters instead of parameters from the instruction stream.
Inlined implementations of their Scheme equivalents.
Note that caddr
and friends compile to a series of car
and cdr
instructions.
Next: Inlined Mathematical Instructions, Previous: Miscellaneous Instructions, Up: Instruction Set [Contents][Index]