Flag

enum Flag : Enum<Primitive.Flag>

These flags are used by the execution machinery and optimizer to indicate the potential mischief that the corresponding primitives may get into.

Entries

Link copied to clipboard

The semantics of the primitive fall outside the usual capacity of the L2Generator. The current continuation should be reified prior to attempting the primitive. Do not attempt to fold or inline this primitive.

Link copied to clipboard

The primitive reads from some global state that isn't directly accessible with Avail code. An example would be fetching the global implicit observer function (IMPLICIT_OBSERVE).

Link copied to clipboard

The primitive writes to some global state that isn't directly accessible with Avail code. An example would be modifying the global implicit observer function (P_SetImplicitObserveFunction).

Link copied to clipboard

The primitive arguments should not be cleared after their last usages.

Link copied to clipboard

The primitive failure variable should not be cleared after its last usage.

Link copied to clipboard

The primitive is the special exception catching primitive. Its sole purpose is to fail, causing an actual continuation to be built. The exception raising mechanism searches for such a continuation to find a suitable handler function.

Link copied to clipboard

This is a bootstrap primitive. It must be made available to the origin module of an Avail system via a special pragma.

Link copied to clipboard

The primitive is not exposed to an Avail program. The compiler forbids direct compilation of primitive linkages to such primitives. A_RawFunction-creating primitives also forbid creation of code that links a Private primitive.

Link copied to clipboard

The primitive cannot fail. Hence, there is no need for Avail code to run in the event of a primitive failure. Hence, such code is forbidden (because it would be unreachable).

Link copied to clipboard

The raw function has a particular form that qualifies it as a special primitive, such as immediately returning a constant or argument. The raw function won't be displayed as a primitive, but it will execute and be inlineable as one.

Link copied to clipboard

The primitive is guaranteed to replace the current continuation, and care should be taken to ensure that the current continuation is fully reified prior to attempting this primitive.

Link copied to clipboard

The primitive can replace the current continuation, and care should be taken to ensure the current continuation is fully reified prior to attempting this primitive. Note that the primitive is not obligated to switch continuations.

Link copied to clipboard

The primitive can invoke a function. If the function is a non-primitive (or a primitive that fails), the current continuation must be reified before the call.

Link copied to clipboard

The primitive has a side-effect, such as writing to a file, modifying a variable, or defining a new method.

Link copied to clipboard

A primitive must have this flag if it might suspend the current fiber. The L2 invocation machinery ensures the Java stack has been reified into a continuation chain prior to invoking the primitive.

Link copied to clipboard

The invocation of the primitive can be safely inlined. In particular, it simply computes a value or changes the state of something and does not replace the current continuation in unusual ways. Thus, something more specific than a general invocation can be embedded in the calling L2Chunk. Since code for potential reification is still needed in the failure case, this flag is less useful than it used to be when a continuation had to be reified on every non-primitive call.

Link copied to clipboard

The primitive can be attempted by the L2Generator at re-optimization time if the arguments are known constants. The result should be stable, such that invoking the primitive again with the same arguments should produce the same value. The primitive should not have side-effects.

Properties

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