Up: The IR1 Interpreter   [Contents]


37.1 Use of %PRIMITIVE

Note: %PRIMITIVE can only be used in compiled code. It is a trapdoor into the compiler, not a general syntax for accessing “sub-primitives”. It’s main use is in implementation-dependent compiler transforms. It saves us the effort of defining a “phony function” (that is not really defined), and also allows direct communication with the code generator through codegen-info arguments.

Some primitives may be exported from the VM so that %PRIMITIVE can be used to make it explicit that an escape routine or interpreter stub is assuming an operation is implemented by the compiler.