Companion

object Companion

Functions

Link copied to clipboard
fun A_RawFunction.constantTypeAt(index: Int): A_Type

Answer the type of the index-th local constant.

Link copied to clipboard
fun A_RawFunction.countdownToReoptimize(value: Long)

Set the countdown until reoptimization by the Level Two translator.

Link copied to clipboard
fun A_RawFunction.decreaseCountdownToReoptimizeFromPoll(delta: Long)

This raw function was found to be running in an interpreter during a periodic poll. Decrease its countdown to reoptimization by the indicated amount, being careful not to drop below one (1).

Link copied to clipboard
fun A_RawFunction.decrementCountdownToReoptimize(continuation: (Boolean) -> Unit): Boolean

Atomically decrement the countdown to reoptimization by the L2Generator. If the count reaches zero (0), then lock this raw function, thereby blocking concurrent applications of A_Functions derived from this raw function, and then evaluate the argument in order to effect reoptimization.

Link copied to clipboard
fun A_RawFunction.literalAt(index: Int): AvailObject

Answer the index-th literal value of this A_RawFunction.

Link copied to clipboard
fun A_RawFunction.localTypeAt(index: Int): A_Type

Answer the type of the index-th local variable.

Link copied to clipboard
fun A_RawFunction.numArgs(): Int

Answer the number of arguments expected by this raw function.

Link copied to clipboard
fun A_RawFunction.outerTypeAt(index: Int): A_Type

Answer the type of the index-th outer variable.

fun A_RawFunction.setStartingChunkAndReoptimizationCountdown(chunk: L2Chunk, countdown: Long)

Set the chunk that implements this A_RawFunction, and the countdown to reoptimization by the L2Generator.

Link copied to clipboard
fun A_RawFunction.tallyInvocation()

Atomically increment the total number of invocations of A_Functions based on this A_RawFunction.

Properties

Link copied to clipboard
val A_RawFunction.codeStartingLineNumber: Int

Answer the starting line number for the block phrase that defines this raw function.

Link copied to clipboard
val A_RawFunction.declarationNames: A_Tuple

For this raw function, compute the tuple of its declaration names (arguments, locals, constants, 0..1 labels, outers). This is useful for decompilation, for giving meaningful names to registers in L2 translations, and for presenting reified continuations. Note that the outers are not part of the stack frame, and apply to the continuation's function instead.

Link copied to clipboard
val A_RawFunction.declarationNamesWithoutOuters: A_Tuple

For this raw function, compute the tuple of its declaration names (arguments, locals, constants, 0..1 labels). This is useful for decompilation, for giving meaningful names to registers in L2 translations, and for presenting reified continuations.

Link copied to clipboard
val functionTypeMethod: CheckedMethod
Link copied to clipboard
val A_RawFunction.lineNumberEncodedDeltas: A_Tuple

Answer the tuple of line number deltas for this ram function. Each entry encodes a signed offset in an unsigned entry. There's an entry for each nybblecode (not for each nybble). The encoding uses the absolute value of the delta from the previous instruction's line number, shifted left once, adding one for negatives. This allows nybble tuples and byte tuples to be the usual representations for small functions.

Link copied to clipboard
val A_RawFunction.maxStackDepth: Int

Answer the maximum depth of the stack needed by an A_Continuation representing the invocation of some A_Function that closes this A_RawFunction.

Link copied to clipboard
var A_RawFunction.methodName: A_String

Read or write the name of the method associated with this raw function, or some other descriptive A_String if it's not a method body.

Link copied to clipboard
val A_RawFunction.module: A_Module

Answer the A_Module that contains the block phrase that defines this raw function.

Link copied to clipboard
val A_RawFunction.numConstants: Int

Answer the number of local constants specified by this A_RawFunction.

Link copied to clipboard
val A_RawFunction.numLiterals: Int

Answer the number of literal values embedded into this A_RawFunction.

Link copied to clipboard
val A_RawFunction.numLocals: Int

Answer the number of local variables specified by this A_RawFunction.

Link copied to clipboard
val A_RawFunction.numNybbles: Int

Answer how many nybbles are taken up by the nybblecodes of this raw function.

Link copied to clipboard
val A_RawFunction.numOuters: Int

Answer the number of outer variables specified by this A_RawFunction.

Link copied to clipboard
val A_RawFunction.numSlots: Int

Answer the number of slots to reserve in a A_Continuation based on this raw function. This is the arity, plus number of local variables and constants, plus number of stack slots.

Link copied to clipboard
val A_RawFunction.nybbles: A_Tuple

Answer the tuple of nybblecodes that implements this raw function.

Link copied to clipboard
val A_RawFunction.originatingPhrase: A_Phrase

Answer the block phrase from which this raw function was constructed. Answer nil if this information is not available.

Link copied to clipboard
var A_RawFunction.originatingPhraseIndex: Int

The index into the module's lazily-loaded tuple of phrases, or -1 if the phrase was not written to a module, in which case the originatingPhrase must already contain the A_Phrase.

Link copied to clipboard
val A_RawFunction.packedDeclarationNames: A_String

Answer an A_String containing the concatenated names of the originating block's declarations.

Link copied to clipboard
val A_RawFunction.returneeCheckStat: Statistic

Answer a Statistic for recording returns into this raw function.

Link copied to clipboard
val A_RawFunction.returnerCheckStat: Statistic

Answer a Statistic for recording returns from this raw function.

Link copied to clipboard
val A_RawFunction.returnTypeIfPrimitiveFails: A_Type

Answer the type that this raw function will produce if there is no primitive, or if the primitive fails and the nybblecodes run.

Link copied to clipboard
val A_RawFunction.startingChunk: L2Chunk

Answer the L2Chunk that the interpreter will run to simulate execution of this A_RawFunction.

Link copied to clipboard
val A_RawFunction.totalInvocations: Long

Answer the total number of invocations of this raw function.