Method Descriptor
A method maintains all A_Definitions that have the same name. At compile time a name is looked up and the corresponding method is stored as a literal in the object code for a call site. At runtime, the actual function is located within the method and then invoked. The methods also keep track of bidirectional dependencies, so that a change of membership (e.g., adding a method definition) causes an immediate invalidation of optimized level two code that depends on the previous membership.
Methods and macros are stored in separate tuples. Note that macros may be polymorphic (multiple definitions), and a lookup structure is used at compile time to decide which macro is most specific.
Author
Mark van Gulik
Todd L Smith
Parameters
The Mutability of the resulting descriptor. This should only be Mutability.MUTABLE for the initialMutableDescriptor, and Mutability.SHARED for normal instances.
Types
The layout of integer slots for my instances.
The fields that are of type AvailObject.
SpecialMethodAtom enumerates atoms that are known to the virtual machine and that correspond to specific primitive invocations. Multiple primitives may be provided to make the associated method polymorphic.
Functions
Ensure that the specified field is writable.
Create a new object whose descriptor is the receiver, and which has the specified number of indexed (variable) slots.
Create a new object whose descriptor is the receiver, and which has the specified number of indexed (variable) slots.
Create a new object whose descriptor is the receiver, and which has the specified number of indexed (variable) slots.
Answer the LookupStatistics that tracks dynamic lookups, involving type testing within a LookupTree. By the time the first one occurs, a bundle will have been set.
Can an object using this descriptor have more than the minimum number of integer slots?
Can an object using this descriptor have more than the minimum number of object slots?
Answer how many levels of printing to allow before elision.
Answer whether the argument types supported by the specified FunctionTypeDescriptor are acceptable argument types for invoking a FunctionDescriptor whose type is self.
Answer whether these are acceptable TypeDescriptor for invoking a FunctionDescriptor whose type is self.
Answer whether these are acceptable arguments for invoking a FunctionDescriptor whose type is self.
Answer whether these are acceptable TypeDescriptor for invoking a FunctionDescriptor that is an instance of self. There may be more entries in the TupleDescriptor than are required by the FunctionTypeDescriptor.
Answer whether these are acceptable arguments for invoking a FunctionDescriptor that is an instance of self. There may be more entries in the TupleDescriptor than are required by the FunctionTypeDescriptor.
Record the fact that the given L2Chunk depends on the object not changing in some way peculiar to the kind of object. Most typically, this is applied to A_Methods, triggering invalidation if A_Definitions are added to or removed from the method, but at some point we may also support slowly-changing variables.
Add the operands and answer the result.
Add the operands and answer the result.
Construct a Java string from the given Avail StringDescriptor.
Construct a Java set from the given TupleDescriptor.
Construct a TupleDescriptor from the given SetDescriptor. Element ordering in the tuple will be arbitrary and unstable.
Visit my child phrases with the action.
Map my children through the (destructive) transformation specified by aBlock.
Compare a subrange of the receiver with a subrange of the given TupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given ByteStringDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given ByteTupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given IntegerIntervalTupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given NybbleTupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given ObjectTupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given RepeatedElementTupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given SmallIntegerIntervalTupleDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of another object. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compare a subrange of the receiver with a subrange of the given TwoByteStringDescriptor. The size of the subrange of both objects is determined by the index range supplied for the receiver.
Compute this object's TypeTag, having failed to extract it from the descriptor directly in AvailObjectRepresentation.typeTag.
Answer a fiber's internal debug log.
Look up all method definitions that could match arguments satisfying the given TypeRestrictions. This should return the definitions that could be invoked at runtime at a call site with the given restrictions. This set is subject to change as new methods and types are created. If a restriction and the corresponding argument type of a definition have no possible intersection except bottom (⊥), then disallow the definition (it could never actually be invoked because bottom is uninstantiable). Answer a list of method definitions.
Describe the object for the IntelliJ debugger.
Divide the operands and answer the result.
Divide the operands and answer the result.
Answer whether the arguments, both objects, are equal in value.
Answer whether the arguments, an object and a TupleDescriptor, are equal in value.
Answer whether the arguments, an object and a ByteStringDescriptor, are equal in value.
Answer whether the arguments, an object, and a ByteTupleDescriptor, are equal in value.
Answer whether the receiver, an object, is a character with a code point equal to the integer argument.
Answer whether the arguments, an object and a CompiledCodeDescriptor, are equal.
Answer whether the arguments, an object and a FiberTypeDescriptor, are equal in value.
Answer whether the arguments, an object and a FunctionDescriptor, are equal in value.
Answer whether the arguments, an object and a FunctionTypeDescriptor, are equal.
Extract a 64-bit signed Java long from the specified Avail integer.
Look up all method definitions that could match the given argument types. Answer a list of method definitions.
Answer whether the receiver contains the specified element.
Test if the definition is present within this method.
Is the specified AvailObject an Avail atom?
Given two objects that are known to be equal, is the first one in a better form (more compact, more efficient, older generation) than the second one?
Sets only use explicit bins for collisions, otherwise they store the element itself. This works because a bin can't be an element of a set.
Is the specified AvailObject an Avail boolean?
Is the specified AvailObject an Avail byte tuple?
Is the specified AvailObject an Avail character?
Is the specified AvailObject an Avail extended integer?
Is the specified AvailObject an Avail function?
Is the specified AvailObject an Avail map?
Is the specified AvailObject an Avail nybble?
Is the specified AvailObject an Avail set?
Is the specified AvailObject an Avail string?
Is the specified AvailObject an Avail tuple?
Is the specified AvailObject an Avail unsigned byte?
Answer a pojo's java object. The type is not statically checkable in Java, but at least making it generic avoids an explicit cast expression at each call site.
Look up the definition to invoke, given a tuple of argument types. Use the methodTestingTree to find the definition to invoke.
Given that the receiver is marked immutable, but its slots have not yet been made immutable, scan them now. For each slot found to be mutable, mark it immutable and add it to the supplied list.
Given that the receiver is marked shared, but its slots have not yet been shared, scan them now. For each slot found to be unshared, mark it and add it to the supplied list.
{@inheritDoc}
{@inheritDoc}
Method manipulation takes place while all fibers are L1-precise and suspended. Use a global lock at the outermost calls to side-step deadlocks. Because no fiber is running, we don't have to protect subsystems like the L2Generator from these changes.
Difference the operands and answer the result.
Add a GrammaticalRestrictionDescriptor to the receiver.
Multiply the operands and answer the result.
Multiply the operands and answer the result.
Answer how many arguments my instances expect. This is applicable to both methods and CompiledCodeDescriptor.
Add the operands and answer the result.
Remove the definition from me. Causes dependent chunks to be invalidated.
Remove the chunk from my set of dependent chunks because it has been invalidated by a new definition in either me or another method on which the chunk is contingent.
Given two objects that are known to be equal, the second of which is in the form of a tuple type, is the first one in a better form than the second one?
Difference the operands and answer the result.
Difference the operands and answer the result.
Multiply the operands and answer the result.
Print the object to the StringBuilder. By default show it as the descriptor's name and a line-by-line list of fields. If the indent is beyond the maximumIndent, indicate it's too deep without recursing. If the object is in the specified recursion list, indicate a recursive print and return.
Throw an AvailUnsupportedOperationException suitable to be thrown by the sender.
Properties
A Statistic that records the number and size of each allocation.
Used for quickly checking integer fields when AvailObjectRepresentation.shouldCheckSlots is enabled.
Used for quickly checking object fields when AvailObjectRepresentation.shouldCheckSlots is enabled.
The minimum number of integer slots an AvailObject can have if it uses this descriptor. Does not include indexed slots possibly at the end. Populated automatically by the constructor.
The minimum number of object slots an AvailObject can have if it uses this descriptor. Does not include indexed slots possibly at the end. Populated automatically by the constructor.
A set of message bundles that name this method. The method itself has no intrinsic name, as its bundles completely determine what it is called in various modules (based on the module scope of the bundles' atomic names).
This read-only property can be used in place of unsupportedOperation. Using the getter produces almost the same diagnostic stack trace when executed, but is a much shorter expression.