Avail Push Label
I represent the use of a label. When a label is used, it causes the current continuation to be copied. The copy is then reset to the state that existed when the current function started running, resetting the program counter, stack pointer, and stack slots, and creating new local variables.
The new continuation can subsequently be restart, restarted with new arguments, or exited.
Author
Mark van Gulik
Parameters
Constructors
Properties
true iff this instruction is a use of an outer variable.
Answer which line number to say that this instruction occurs on. Use the relevantTokens as an approximation, but subclasses might be able to be more precise. Answer -1 if this instruction doesn't seem to have a location in the source associated with it.
The tuple of tokens that contributed to producing this instruction.
Functions
Push a label, which is a continuation. Since the label can be restarted (which constructs new locals while reusing the arguments), or exited (which has no static effect on optimizations), I only have an effect on arguments and outer variables. Scan all arguments and outer variables and ensure the most recent pushes are reset so that isLastAccess is false.
Write an entry to the encoded line number deltas for each L1 instruction generated. Most AvailInstructions write a single L1 instruction, so that implementation is here.
Write nybbles representing this instruction to the NybbleOutputStream.