Permuted List Phrase Descriptor
My instances represent phrases which will generate permuted tuples at runtime. The elements still have to be generated in their lexical order, but an L1Operation.L1Ext_doPermute changes their order while they're still on the stack (before being made into a tuple or passed as the top level arguments in a send).
Author
Mark van Gulik
Parameters
The mutability of the new descriptor.
Types
My slots of type AvailObject.
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 for objects and ints.
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.
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?
Subclasses do not have an immutable descriptor, so use the shared one instead.
Answer how many levels of printing to allow before elision.
Answer the mutable version of this descriptor.
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.
For this tuple, estimate how many bits of memory per element are consumed by its current representation. This is used to determine which of two representations is more efficient, in the case that equal tuples have been compared, and either one can be converted into an indirection to the other.
Visit every phrase constituting this parse tree, invoking the passed consumer with each.
Visit and transform the direct descendants of this phrase. Map this phrase's children through the (destructive) transformation specified by aBlock, assigning them back into my slots.
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.
If the receiver is immutable, make an equivalent mutable copy of that phrase. Otherwise, answer the receiver itself.
Answer a fiber's internal debug log.
Describe the object for the IntelliJ debugger.
Divide the operands and answer the result.
Divide the operands and answer the result.
Emit the effect of this phrase. By default that means to emit the value of the phrase, then to pop the unwanted value from the stack.
Emit the value of this phrase. That means emit a sequence of instructions that will cause this phrase's value to end up on the stack.
Phrases compare with A_Phrase.equalsPhrase.
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.
Note: This is only used to eliminate duplicate equivalent phrases produced by the parallel parsing plan mechanism. Each definition has to be parsed as a separate potential entity in the message bundle tree, and multiple applicable sites might be found for the same bundle, but different definitions.
DON'T transform the index.
Extract a 64-bit signed Java long from the specified Avail integer.
Answer whether the receiver contains the specified element.
Terminate the recursion through the recursive list structure. If this isn't overridden in a subclass then it must be a bottom-level argument to a send.
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.
DON'T transform the index.
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}
Add a DefinitionDescriptor to the receiver. Causes dependent chunks to be invalidated.
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 MethodDescriptor and CompiledCodeDescriptor.
Return the phrase's expression type, which is the type of object that will be produced by this phrase.
Return the PhraseKind that this phrase's type implements.
Add the operands and answer the result.
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?
Return the MethodDescriptor's TupleDescriptor of FunctionDescriptor that statically restrict call sites by argument type.
Strip away macro substitution phrases inside my recursive list structure. This has to be done recursively over list phrases because of the way the "leaf" phrases are checked for grammatical restrictions, but the "root" phrases are what get passed into functions.
Difference the operands and answer the result.
Difference the operands and answer the result.
Multiply the operands and answer the result.
Validate this phrase, throwing an exception if there is a problem. Do not recurse into its subphrases, as those have already been validated.
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.
Answer the shared version of this descriptor.
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.
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.