A_Continuation
A_Continuation is an interface that specifies the operations specific to continuations in Avail. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
Author
Mark van Gulik
Inheritors
Properties
Dispatch to the descriptor.
Is the receiver an Avail byte string?
Is the receiver an Avail byte tuple?
Is the receiver an Avail extended integer?
Is the receiver an Avail function?
Dispatch to the descriptor.
Is the receiver an Avail IntTupleDescriptor? This is conservative, in that some object tuples may only contain ints but not be reported as being int tuples.
Is the receiver an Avail LongTupleDescriptor? This is conservative, in that some object tuples may only contain longs but not be reported as being long tuples.
Dispatch to the descriptor.
Is the receiver an Avail two-byte string?
Is the receiver an Avail unsigned byte?
Extract the ObjectLayoutVariant from an object.
Functions
Set both the pc and the stack pointer of this continuation, which must be mutable.
Turn the receiver into an indirection to the specified object.
The continuation to which control will pass when this continuation returns. May be nil, indicating this is the outermost stack frame of its fiber and will produce a value from the fiber itself.
Answer the line number associated with this continuation's current pc.
Alter this continuation to be suitable for use by a debugger. This must be performed inside a safe point.
Utility method for decomposing this object in the debugger.
Retrieve the object's {@linkplain AbstractDescriptor descriptor}.
Dispatcher helper function for routing messages to the descriptor.
If this continuation is already mutable just answer it; otherwise answer a mutable copy of it.
Answer whether the receiver and the argument, both A_BasicObjects, are equal in value.
{@inheritDoc}
Answer whether the receiver, an object, and the argument, a byte string, are equal in value.
Answer whether the receiver, an object, and the argument, a byte tuple, are equal in value.
Answer whether the arguments, an object and a compiled code, are equal.
Answer whether the receiver equals the argument.
Answer whether the receiver equals the argument.
Determine whether the receiver is an enumeration with the given set of instances.
Answer whether the receiver, an object, and the argument, a fiber type, are equal in value.
Answer whether the receiver, an object, and the argument, a function type, are equal.
Answer whether the receiver equals the argument.
Answer whether this value equals the given list phrase type.
Answer whether the receiver equals the argument.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer whether the receiver equals the argument.
Extract a field from an object.
Extract a field from an object, using a one-based index into the field slots. This requires knowledge of the ObjectLayoutVariant, since the same field is at different indices in different variants.
Extract a field from an object, or answer null if it's not present.
Add or replace a field of an object.
Extract a field type from an object type.
Extract a field type from an object type, using the given field index, which is specific to an ObjectLayoutVariant.
Extract a field type from an object type, or null if it's not present.
Answer the continuation frame slot at the given index. The frame slots are numbered starting at 1, and consist of the arguments, primitive failure variable (if defined), locals, and then an operand stack that grows from the top down.
Update the continuation frame slot at the given index. The continuation must be mutable. Frame slots are numbered starting at 1, and consist of the arguments, primitive failure variable (if defined), locals, and then an operand stack that grows from the top down.
Answer the function for which this continuation represents an evaluation.
Dispatch to the descriptor.
Determine which nybblecode index is "current" for this continuation. If this is not the top frame, use the instruction previous to the current pc.
Answer the number of integer slots. All variable integer slots occur following the last fixed integer slot.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer the current L2Chunk to run when resuming this continuation. Always check that the chunk is still valid, otherwise the unoptimizedChunk should be resumed instead.
The offset within the L2Chunk at which to resume level two execution when this continuation is to be resumed. Note that the chunk might have become invalidated, so check L2Chunk.isValid) before attempting to resume it.
Dispatch to the descriptor.
The receiver is marked with an IMMUTABLE descriptor, but its subobjects have not yet been made immutable. Scan them now, and do any additional fix-ups necessary for the kind of object.
Dispatch to the descriptor.
The receiver is marked with a SHARED descriptor, but its subobjects have not yet been made shared. Scan them now, and do any additional fix-ups necessary for the kind of object.
Dispatch to the descriptor.
Dispatch to the descriptor.
Answer a name suitable for labeling a field containing this object.
Also defined in A_RawFunction. The total number of "frame" slots in the receiver. These slots are used to hold the arguments, local variables and constants, and the local operand stack on which the level one instruction set depends.
Answer the number of object slots in this AvailObject. All variable object slots occur following the last fixed object slot.
Answer the level one program counter. This is a one-based subscript that indicates the next instruction that will execute in this continuation's function's level one code.
Recursively print the receiver to the builder unless it is already present in the recursionMap. Printing will begin at the specified indent level, measured in horizontal tab characters.
Answer the ContinuationRegisterDumpDescriptor object that was secretly stashed inside this continuation for an L2Chunk's use.
Create a copy of the receiver if it's not already mutable, then clobber the caller slot with the passed value.
Dispatch to the descriptor.
Answer whether the objects occupy the same memory addresses.
Dispatch to the descriptor.
Replace the object's {@linkplain AbstractDescriptor descriptor}.
Dispatch to the descriptor.
Replace my descriptor field with a FillerDescriptor. This blows up for most messages, catching incorrect (all, by definition) further accidental uses of this object.
Answer whether to show value-specific content in the file name for the debugger.
Retrieve the stack element with the given offset. Do not adjust the mutability of the returned value.
Answer the current depth of the argument stack within this continuation. This is a one-based index into the continuation's frame. The stack pointer indexes the most recently pushed value. The stack grows downwards, and the empty stack is indicated by a pointer just beyond the frame data.
If the provided condition is true, synchronize with the receiver's monitor around the execution of the body function. Otherwise, run the body function without synchronization.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target, even if it would cause the otherwise-forbidden immutable->mutable references. Only used during makeImmutable.
Follow indirections until a non-indirection is reached. Replace each indirection's target with the ultimate target, even if it would cause the otherwise-forbidden shared->unshared references. Only used during makeShared.
Answer the number of variable integer slots in this object. This does not include the fixed integer slots.
Answer the number of variable object slots in this AvailObject. This does not include the fixed object slots.