L2Simple_AbstractReifiableInstruction

abstract class L2Simple_AbstractReifiableInstruction(val stackp: Int, val pc: Int, val nextOffset: Int, val liveIndices: IntArray) : L2SimpleInstruction

An abstraction for instructions that can trigger reification during their execution. This includes instructions that invoke functions, create a label, or read/write a variable (which may fail and invoke handler code that may reify).

Inheritors

Constructors

Link copied to clipboard
constructor(stackp: Int, pc: Int, nextOffset: Int, liveIndices: IntArray)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val pc: Int
Link copied to clipboard
val stackp: Int

Functions

Link copied to clipboard

Generate a suitable print representation of the value.

Link copied to clipboard

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

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?

A previously constructed continuation is being resumed in some way, and the instruction just before the continuation's L2 offset has been asked to do anything specific to reentering the continuation. For example, a method call might be forced to reify the stack, but at resumption time (i.e., when "returning" into it), it will still need to check the type of the "returned" value against the expected type.

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