L2Simple_CloseFunctionN

class L2Simple_CloseFunctionN(val code: A_RawFunction, val to: Int) : L2SimpleInstruction

Create a function from the constant raw function code and the required number of captured (outer) values, as indicated in the code. The outer values are found at registers[to], registers[to-1],..registers[to-N+1]. Write the function back to registers[to].

Constructors

Link copied to clipboard
fun L2Simple_CloseFunctionN(code: A_RawFunction, to: Int)

Functions

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

Generate a suitable print representation of the value.

Link copied to clipboard
open 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
open override 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 code: A_RawFunction
Link copied to clipboard
val outerCount: Int
Link copied to clipboard
val to: Int