Serializer Operation
A SerializerOpcode describes how to disassemble and assemble the various kinds of objects encountered in Avail.
The ordinal is passed in the constructor as a cross-check, to increase the difficulty of (accidentally) changing the serialized representation without due care for migration of existing serialized data.
Author
Mark van Gulik
Parameters
Whether, during serialization, this operation should record the provided object as a value to capture for use in pumping other serializers and deserializers.
The ordinal of this enum value, supplied as a cross-check to reduce the chance of accidental incompatibility due to the addition of new categories of Avail objects.
The list of operands that describe the interpretation of a stream of bytes written with this SerializerOperation.
Entries
A variable type for which the read type and write type are (actually) unequal.
A variable type for which the read type and write type are equal.
A token type.
An Avail instance meta, a type that has an instance i, which is itself a type. Subtypes of type i are also considered instances of this instance meta.
An Avail singular enumeration, a type that has a single (non-type) instance.
An Avail enumeration, a type that has an explicit finite list of its instances.
The bottom pojo type, representing the most specific type of pojo.
The bottom pojo type, representing the most specific type of pojo.
The bottom pojo type, representing the most specific type of pojo.
A set of class standing in for a pojo type representing a "self type". A self type is used for for parameterizing a Java class by itself. For example, in the parametric type Enum<E extends Enum<E>>, we parameterize the class Enum with such a self type. To reconstruct a self type all we need is a way to get to the raw Java classes involved, so we serialize their names.
A pojo type representing a Java array type. We can reconstruct this array type from the content type and the range of allowable sizes (a much stronger model than Java itself supports).
A pojo type for which AvailObject.isPojoFusedType is true. This indicates a representation without the juicy class filling, so we have to say how each ancestor is parameterized.
A pojo type for which AvailObject.isPojoFusedType is false. This indicates a representation with a juicy class filling, which allows a particularly compact representation involving the class name and its parameter types.
A tuple type.
A fiber type.
Reserved for future use.
Reserved for future use.
A sequence-as-expression phrase.
A variable bound to a static Java field.
An arbitrary primitive type that is not already a special object. Exists primarily to support hidden types that are not exposed directly to an Avail programmer but which must still be visible to the serialization mechanism.
A marker phrase. These should not be created during normal parsing, and must be transformed into other phrases by some means before code generation.
A send phrase.
A list phrase.
A block phrase.
An instance of Constructor, likely created as part of P_CreatePojoConstructorFunction.
An instance of Method, likely created as part of P_CreatePojoInstanceMethodFunction. The method may be an instance method or a static method.
The raw pojo for the Java null value.
An atom which is used for creating explicit subclasses. Output the atom name and the name of the module that issued it. Look up the corresponding atom during reconstruction, recreating it if it's not present and supposed to have been issued by the current module.
A reference to a message bundle, which should be reconstructed by looking it up.
A reference to a forward, which should be reconstructed by looking it up.
A reference to an abstract, which should be reconstructed by looking it up.
A reference to a macro, which should be reconstructed by looking it up.
A reference to a method, which should be reconstructed by looking it up.
A reference to a method that should be looked up during deserialization. A method can have multiple message bundles, and each pair is recorded during serialization. For system atoms we output nil for the module name. During deserialization, the list is searched for a module that has been loaded, and if the corresponding name is an atom, and if that atom has a bundle associated with it, that bundle's method is used.
The representation of a continuation, which is just its level one state.
This special opcode causes a previously built variable to have a previously built value to be assigned to it at this point during deserialization.
A token.
A global variable. It's serialized as the type, the module that defined it, the variable's name within that module, and a flag byte.
A non-global variable. Deserialization reconstructs a new one, since there's no way to know where the original one came from.
A function with one or more outer (lexically captured) variables.
A function with no outer (lexically captured) variables.
A compiled code object. Output any information needed to reconstruct the compiled code object.
An atom. Output the atom name and the name of the module that issued it. Look up the corresponding atom during reconstruction, recreating it if it's not present and supposed to have been issued by the current module.
An atom. Output the atom name and the name of the module that issued it. Look up the corresponding atom during reconstruction, recreating it if it's not present and supposed to have been issued by the current module.
A map. Convert it to a tuple (key1, value1, ... key``[N]``, value``[N]``) and work with that, converting it back to a map when deserializing.
A tuple whose values fall in the range 0..15.
A tuple of integers whose values all fall in the range 0..255.
A tuple of characters with arbitrary code points. Write the compressed number of characters then each compressed character.
A tuple of characters whose code points all fall in the range 0..65535. Write the compressed number of characters then each compressed character.
A tuple of characters with code points in Latin-1. Write the size of the tuple then the sequence of character bytes.
A tuple of arbitrary objects. Write the size of the tuple then the elements as object identifiers.
A character whose code point requires three bytes to represent (0..16777215, but technically only 0..1114111).
A character whose code point requires an unsigned short (256..65535).
A character whose code point fits in an unsigned byte (0..255).
One of the special atoms that the AvailRuntime maintains.
One of the special objects that the AvailRuntime maintains.
This special opcode causes a previously built object to be produced as an actual checkpoint output from the Deserializer.
An Avail integer that cannot be represented as an Int.
An Avail integer in the range -231 through 2^31-1, except the range 0..65535 which have their own special cases already.
An Avail integer in the range 256..65535. Note that 0..255 have their own special cases already which require less space. Don't try to compress the short value for this reason.
An Avail integer in the range 11..255. Note that 0..10 have their own special cases already which require very little space.
The Avail integer 10. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 9. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 8. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 7. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 6. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 5. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 4. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 3. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 2. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 1. Note that there are no operands, since the value is encoded in the choice of instruction itself.
The Avail integer 0. Note that there are no operands, since the value is encoded in the choice of instruction itself.