9.3.6.11 Inlined Scheme Instructions

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.

Instruction: notx

Instruction: not-notx

Instruction: eq?x y

Instruction: not-eq?x y

Instruction: null?

Instruction: not-null?

Instruction: eqv?x y

Instruction: equal?x y

Instruction: pair?x y

Instruction: list?x

Instruction: set-car!pair x

Instruction: set-cdr!pair x

Instruction: consx y

Instruction: carx

Instruction: cdrx

Instruction: vector-refx y

Instruction: vector-setx n y

Instruction: struct?x

Instruction: struct-refx n

Instruction: struct-setx n v

Instruction: struct-vtablex

Instruction: class-ofx

Instruction: slot-refstruct n

Instruction: slot-setstruct n x

Inlined implementations of their Scheme equivalents.

Note that caddr and friends compile to a series of car
and cdr instructions.