Flag
These flags are used by the execution machinery and optimizer to indicate the potential mischief that the corresponding primitives may get into.
Entries
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.
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.
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.
The primitive has a side-effect, such as writing to a file, modifying a variable, or defining a new method.
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.
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.
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.
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).
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.
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.
The primitive failure variable should not be cleared after its last usage.
The primitive arguments should not be cleared after their last usages.
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).
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).
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.