L2Simple_AbstractInvokerInstruction

abstract class L2Simple_AbstractInvokerInstruction(    val stackp: Int,     val pc: Int,     val nextOffset: Int,     val liveIndices: IntArray,     val expectedType: A_Type,     val mustCheck: Boolean) : L2Simple_AbstractReifiableInstruction

An abstract class for instructions whose primary purpose is to invoke some other function. The expectedType indicates what type should be pushed on the stack if reification happens. If mustCheck is true, the expectedType is also used to check that the eventually returned value is of the correct type.

Constructors

Link copied to clipboard
fun L2Simple_AbstractInvokerInstruction(    stackp: Int,     pc: Int,     nextOffset: Int,     liveIndices: IntArray,     expectedType: A_Type,     mustCheck: Boolean)

Functions

Link copied to clipboard
fun fieldValueToString(value: Any?): String

Generate a suitable print representation of the value.

Link copied to clipboard
fun handleVariableGetException(    e: VariableGetException,     interpreter: Interpreter,     registers: Array<AvailObject>): StackReifier

A VariableGetException has occurred. Invoke the READ_UNASSIGNED_VARIABLE hook function, which, because it is ⊥-valued, can only reify. Eventually answer that StackReifier.

Link copied to clipboard
fun handleVariableSetException(    e: VariableSetException,     variable: A_Variable,     value: AvailObject,     interpreter: Interpreter,     registers: Array<AvailObject>): StackReifier?

A VariableSetException has occurred. Run the implicit-observe handler, and answer null if it completes, or a suitable StackReifier if it eventually reifies.

Link copied to clipboard
open override fun reenter(registers: Array<AvailObject>, interpreter: Interpreter): StackReifier?

This is called when the invocation for this step had to reify, and now we've finished the actual Avail call and we're attempting to continue where we left off. We have to check the returned value and either capture it on the stack or invoke the result check failure function.

Link copied to clipboard
abstract fun step(registers: Array<AvailObject>, interpreter: Interpreter): StackReifier?

Perform this instruction, a single step of an L2SimpleChunk. The mutable Array of AvailObjects acts as a simple set of registers. Element 0 is the current function, and the remaining elements correspond with the continuation slots, should one need to be constructed.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val expectedType: A_Type
Link copied to clipboard
val liveIndices: IntArray
Link copied to clipboard
val mustCheck: Boolean
Link copied to clipboard
val nextOffset: Int
Link copied to clipboard
val pc: Int
Link copied to clipboard
val stackp: Int

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard