SerializerOperation

enum SerializerOperation : Enum<SerializerOperation>

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

shouldCaptureObject

Whether, during serialization, this operation should record the provided object as a value to capture for use in pumping other serializers and deserializers.

ordinal

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.

operands

The list of operands that describe the interpretation of a stream of bytes written with this SerializerOperation.

Entries

Link copied to clipboard

The Avail integer 0. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 1. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 2. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 3. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 4. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 5. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 6. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 7. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 8. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 9. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

The Avail integer 10. Note that there are no operands, since the value is encoded in the choice of instruction itself.

Link copied to clipboard

An Avail integer in the range 11..255. Note that 0..10 have their own special cases already which require very little space.

Link copied to clipboard

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.

Link copied to clipboard

An Avail integer in the range -231 through 2^31-1, except the range 0..65535 which have their own special cases already.

Link copied to clipboard

An Avail integer that cannot be represented as an Int.

Link copied to clipboard

Produce the Avail nil during deserialization.

Link copied to clipboard

This special opcode causes a previously built object to be produced as an actual checkpoint output from the Deserializer.

Link copied to clipboard

One of the special objects that the AvailRuntime maintains.

Link copied to clipboard

One of the special atoms that the AvailRuntime maintains.

Link copied to clipboard

A character whose code point fits in an unsigned byte (0..255).

Link copied to clipboard

A character whose code point requires an unsigned short (256..65535).

Link copied to clipboard

A character whose code point requires three bytes to represent (0..16777215, but technically only 0..1114111).

Link copied to clipboard

A float. Convert the raw bits to an int for writing.

Link copied to clipboard

A double. Convert the raw bits to a long and write it in big endian.

Link copied to clipboard

A tuple of arbitrary objects. Write the size of the tuple then the elements as object identifiers.

Link copied to clipboard

A tuple of characters with code points in Latin-1. Write the size of the tuple then the sequence of character bytes.

Link copied to clipboard

A tuple of characters whose code points all fall in the range 0..65535. Write the compressed number of characters then each compressed character.

Link copied to clipboard

A tuple of characters with arbitrary code points. Write the compressed number of characters then each compressed character.

Link copied to clipboard

A tuple of integers whose values all fall in the range 0..2^31-1.

Link copied to clipboard

A tuple of integers whose values all fall in the range 0..255.

Link copied to clipboard

A tuple whose values fall in the range 0..15.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

A compiled code object. Output any information needed to reconstruct the compiled code object.

Link copied to clipboard

A function with no outer (lexically captured) variables.

Link copied to clipboard

A function with one or more outer (lexically captured) variables.

Link copied to clipboard

A non-global variable. Deserialization reconstructs a new one, since there's no way to know where the original one came from.

Link copied to clipboard

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.

Link copied to clipboard

A set. Convert it to a tuple and work with that, converting it back to a set when deserializing.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This special opcode causes a previously built variable to have a previously built value to be assigned to it at this point during deserialization.

Link copied to clipboard

The representation of a continuation, which is just its level one state.

Link copied to clipboard

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.

Link copied to clipboard

A reference to a method, which should be reconstructed by looking it up.

Link copied to clipboard

A reference to a macro, which should be reconstructed by looking it up.

Link copied to clipboard

A reference to an abstract, which should be reconstructed by looking it up.

Link copied to clipboard

A reference to a forward, which should be reconstructed by looking it up.

Link copied to clipboard

A reference to a message bundle, which should be reconstructed by looking it up.

Link copied to clipboard

A reference to a module, possibly the one being constructed.

Link copied to clipboard

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.

Link copied to clipboard

The raw pojo for the Java null value.

Link copied to clipboard

The serialization of a raw (unparameterized) Java primitiveClass.

Link copied to clipboard

An instance of Method, likely created as part of P_CreatePojoInstanceMethodFunction. The method may be an instance method or a static method.

Link copied to clipboard

An instance of Constructor, likely created as part of P_CreatePojoConstructorFunction.

Link copied to clipboard

The serialization of a raw (unparameterized) Java primitiveClass.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A marker phrase. These should not be created during normal parsing, and must be transformed into other phrases by some means before code generation.

Link copied to clipboard

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.

Link copied to clipboard

A variable bound to a static Java field.

Link copied to clipboard
Link copied to clipboard

Reserved for future use.

Link copied to clipboard

Reserved for future use.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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).

Link copied to clipboard

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.

Link copied to clipboard

The bottom pojo type, representing the most specific type of pojo.

Link copied to clipboard

The bottom pojo type, representing the most specific type of pojo.

Link copied to clipboard

The bottom pojo type, representing the most specific type of pojo.

Link copied to clipboard

An Avail enumeration, a type that has an explicit finite list of its instances.

Link copied to clipboard

An Avail singular enumeration, a type that has a single (non-type) instance.

Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A variable type for which the read type and write type are equal.

Link copied to clipboard

A variable type for which the read type and write type are (actually) unequal.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int
Link copied to clipboard
val shouldCaptureObject: Boolean