Frame

class Frame(    val outerFrame: Frame?,     val code: A_RawFunction,     val debugName: String)

An abstract representation of an invocation. Note that this is not itself an L2SemanticValue, but is used by some specific kinds of semantic values. The outermost Frame has an outerFrame of null, and all other frames have a non-null outer frame. Frames compare by identity.

Parameters

outerFrame

The frame that was active at the point where an invocation of this frame occurred, or null if this is the outermost frame.

code

The actual A_RawFunction that has the L1 code for this frame.

debugName

What to name this frame.

Constructors

Link copied to clipboard
fun Frame(    outerFrame: Frame?,     code: A_RawFunction,     debugName: String)

Construct a new Frame representing a call within the given frame.

Functions

Link copied to clipboard
fun depth(): Int

Answer the depth of this frame, which is how many invocations deep it is relative to the outermost frame represented by an L2Chunk. Note that frames compare by identity, so two frames with the same depth are not necessarily equal.

Link copied to clipboard
fun function(): L2SemanticValue

Answer the L2SemanticValue representing this frame's function.

Link copied to clipboard
fun label(): L2SemanticValue

Answer the L2SemanticValue representing this frame's label.

Link copied to clipboard
fun outer(outerIndex: Int, optionalName: String?): L2SemanticValue

Answer the L2SemanticValue representing one of this frame's function's captured outer values.

Link copied to clipboard
fun reifiedCaller(): L2SemanticValue

Answer an L2SemanticValue that represents the reified caller continuation.

Link copied to clipboard
fun result(): L2SemanticValue

Answer the L2SemanticValue representing the return result from this frame.

Link copied to clipboard
fun slot(    slotIndex: Int,     afterPc: Int,     optionalName: String?): L2SemanticValue

Answer the L2SemanticValue representing one of this frame's slots, as of just after the particular nybblecode that wrote it.

Link copied to clipboard
fun temp(uniqueId: Int): L2SemanticValue

Answer the semantic value representing a new temporary value.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun transform(topFrameReplacement: Frame, frameTransformer: (Frame) -> Frame): Frame

Transform the receiver via the given Function.

Properties

Link copied to clipboard
val code: A_RawFunction

The actual raw function that's associated with semantic values tied to this frame.

Link copied to clipboard
val debugName: String

The symbolic name to use to describe this frame. Note that it does not affect the identity of the frame, which is what's used for comparing and hashing.

Link copied to clipboard
val outerFrame: Frame?

The frame that was active at the site of the invocation that this frame represents.