L1Instruction Writer
An instance of this class can be used to construct a compiled code object without detailed knowledge of the level one nybblecode instruction set.
Author
Mark van Gulik
Parameters
The module containing this code.
Where this code starts in the module.
The phrase that should be captured for this raw function. nil is also valid, but less informative.
Constructors
Create a new L1InstructionWriter Level One instruction writer.
Functions
Locate or record the specified literal object. Answer its 1-based index.
Set the array of types of the arguments.
Specify the types of the arguments that the resulting compiled code object will accept.
Produce the compiled code object which we have just incrementally specified.
Declare a local variable with the specified type. Answer its index. The index is relative to the start of the arguments.
Declare an outer (lexically captured) variable, specifying its type.
Write an L1 instruction to the nybblecode stream. Some opcodes (automatically) write an extension nybble (0xF). Also write any operands. Validate that the right number of operands are provided.
Properties
The primitive of the compiled code being generated.
The return type of the FunctionDescriptor under construction.