Package avail.compiler.instruction

Types

Link copied to clipboard
open class AvailCall(    var relevantTokens: A_Tuple,     messageIndex: Int,     verifyIndex: Int) : AvailInstructionWithIndex

This is a multi-method call instruction. The opcode is followed by the index of the message (a method), then the index of the literal that holds the return type for this call site.

Link copied to clipboard
class AvailCloseCode(    var relevantTokens: A_Tuple,     numCopiedVars: Int,     codeIndex: Int) : AvailInstructionWithIndex

This instruction build a function from compiled code and some pushed variables.

Link copied to clipboard
class AvailDuplicate(var relevantTokens: A_Tuple) : AvailInstruction

AvailDuplicate models the L1Ext_doDuplicate nybblecode.

Link copied to clipboard
class AvailGetLiteralVariable(var relevantTokens: A_Tuple, val index: Int) : AvailInstructionWithIndex

Push the value of a variable found in a literal.

Link copied to clipboard
class AvailGetLocalVariable(var relevantTokens: A_Tuple, variableIndex: Int) : AvailGetVariable

Push the value of a local variable.

Link copied to clipboard
class AvailGetOuterVariable(var relevantTokens: A_Tuple, outerIndex: Int) : AvailGetVariable

Push the value of an outer (lexically captured) variable.

Link copied to clipboard
abstract class AvailGetVariable(var relevantTokens: A_Tuple, variableIndex: Int) : AvailInstructionWithIndex

Push the value of a variable of some sort.

Link copied to clipboard
abstract class AvailInstruction(var relevantTokens: A_Tuple)

AvailInstruction implements an abstract instruction set that doesn't have to agree precisely with the actual implemented Level One nybblecode instruction set. The mapping is approximately one-to-one, however, other than providing the ability to defer certain analyses, such as last-use of variables, until after selection of AvailInstructions. This allows the analysis to simply mark the already abstractly-emitted instructions with information that affects the precise nybblecodes that will ultimately be emitted.

Link copied to clipboard
abstract class AvailInstructionWithIndex(var relevantTokens: A_Tuple, val index: Int) : AvailInstruction

This abstract subclass of AvailInstruction introduces a generic index whose interpretation is left to subclasses.

Link copied to clipboard
class AvailLabel(var relevantTokens: A_Tuple) : AvailInstruction

An AvailLabel is a pseudo-instruction in the Level One instruction set. It represents a label in the parse tree of a block. If a label declaration occurs at all in a block, it must be the first statement of the block.

Link copied to clipboard
class AvailMakeTuple(var relevantTokens: A_Tuple, val index: Int) : AvailInstructionWithIndex

Construct a tuple from some number of objects already pushed on the stack.

Link copied to clipboard
class AvailPermute(var relevantTokens: A_Tuple, permutationIndex: Int) : AvailInstructionWithIndex

Permute the top N stack items via a permutation found in a literal tuple.

Link copied to clipboard
class AvailPop(var relevantTokens: A_Tuple) : AvailInstruction

The AvailPop instruction represents the removal of one element from a continuation's stack of values.

Link copied to clipboard
class AvailPushLabel(var relevantTokens: A_Tuple) : AvailInstruction

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.

Link copied to clipboard
class AvailPushLiteral(var relevantTokens: A_Tuple, literalIndex: Int) : AvailInstructionWithIndex

AvailPushLiteral is an instruction that represents pushing a particular object (known at code generation time, undoubtedly earlier) onto a continuation's stack.

Link copied to clipboard
class AvailPushLocalVariable(var relevantTokens: A_Tuple, variableIndex: Int) : AvailPushVariable

Push either a local variable (the variable itself), a local constant, or an argument.

Link copied to clipboard
class AvailPushOuterVariable(var relevantTokens: A_Tuple, variableIndex: Int) : AvailPushVariable

Push an outer (lexically captured) variable. Not its value, but the variable itself.

Link copied to clipboard
abstract class AvailPushVariable(var relevantTokens: A_Tuple, variableIndex: Int) : AvailInstructionWithIndex

Push a variable of some sort.

Link copied to clipboard
class AvailSetLiteralVariable(var relevantTokens: A_Tuple, variableLiteralIndex: Int) : AvailInstructionWithIndex

Assign to a variable that's captured as a literal in the code.

Link copied to clipboard
class AvailSetLocalConstant(var relevantTokens: A_Tuple, val index: Int) : AvailInstructionWithIndex

Set a local constant to its computed value, popped from the stack.

Link copied to clipboard
class AvailSetLocalVariable(var relevantTokens: A_Tuple, val index: Int) : AvailInstructionWithIndex

Set a local variable.

Link copied to clipboard
class AvailSetOuterVariable(var relevantTokens: A_Tuple, outerIndex: Int) : AvailInstructionWithIndex

Set the value of a variable found in the function's list of captured outer variables.

Link copied to clipboard
class AvailSuperCall(    var relevantTokens: A_Tuple,     messageIndex: Int,     verifyIndex: Int,     superUnionIndex: Int) : AvailCall

This is a multi-method super-call instruction. The opcode is followed by:

Link copied to clipboard
class AvailVariableAccessNote

An AvailVariableAccessNote is a helper class used during data flow analysis. As it progresses forward through a block's AvailInstructions, it tracks, for a particular variable, the most recent instruction which pushes that variable itself on the stack. It also tracks the most recent instruction which pushes that variable's value on the stack.