AbstractAvailObject

abstract class AbstractAvailObject

AbstractAvailObject specifies the essential layout and storage requirements of an Avail object, but does not specify a particular representation. As such, it defines requirements for object and integer storage capability, identity comparison by object address, indirection capability, and descriptor access.

Author

Todd L Smith

Mark van Gulik

Parameters

initialDescriptor

The object's descriptor at creation time. Most messages are redirected through the descriptor to allow the behavior and representation to change, often without changing the observable semantics. The descriptor essentially says how this object should behave, including how its fields are laid out.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun checkWriteForField(e: AbstractSlotsEnum)

Sanity check: ensure that the specified field is writable.

Link copied to clipboard
fun descriptor(): AbstractDescriptor

Retrieve this object's current descriptor.

Link copied to clipboard
fun destroy()

Replace the descriptor with a filler. This blows up for most messages, catching further uses of this object. Note that all further uses are incorrect by definition.

Link copied to clipboard
abstract fun integerSlotsCount(): Int

Answer the number of integer slots. All variable integer slots occur following the last fixed integer slot.

Link copied to clipboard
abstract fun objectSlotsCount(): Int

Answer the number of object slots in this AvailObject. All variable object slots occur following the last fixed object slot.

Link copied to clipboard
fun sameAddressAs(anotherObject: A_BasicObject): Boolean

Answer whether the objects occupy the same memory addresses.

Link copied to clipboard
fun setDescriptor(newDescriptor: AbstractDescriptor)

Replace this object's current currentDescriptorAbstractDescriptor].

abstract fun truncateWithFillerForNewIntegerSlotsCount(newIntegerSlotsCount: Int)

Slice the current object into two objects, the left one (at the same starting address as the input), and the right one (a filler object that nobody should ever create a pointer to). The new filler can have zero post-header slots (i.e., just the header), but the left object must not, since it may turn into an indirection some day and will require at least one slot for the target pointer.

Link copied to clipboard
abstract fun truncateWithFillerForNewObjectSlotsCount(newObjectSlotsCount: Int)

Slice the current object into two objects, the left one (at the same starting address as the input), and the right one (a filler object that nobody should ever create a pointer to). The new filler can have zero post-header slots (i.e., just the header), but the left object must not, since it may turn into an indirection some day and will require at least one slot for the target pointer.

Link copied to clipboard
fun variableIntegerSlotsCount(): Int

Answer the number of variable integer slots in this object. This does not include the fixed integer slots.

Link copied to clipboard
fun variableObjectSlotsCount(): Int

Answer the number of variable object slots in this AvailObject. This does not include the fixed object slots.

Inheritors

Link copied to clipboard