InstantiationNode

Instantiates a join node.

Join nodes correspond to static ("dead") subprograms. In order to actually use a join pattern, one must first create a "live" instance of it. The result of such an instantiation is a non-empty collection of continuations, one for each channel in the join pattern. Then, using a continuation requires one to provide its parameters and jump into it, which may trigger the join node's body.

More...

Members

Functions

opEquals
bool opEquals(const(InstantiationNode) rhs)

Equivalence check.

opIndex
inout(InEdge)* opIndex(InEdge.ID slot)

See Node.opIndex.

toHash
hash_t toHash()

Semantic hash. Depends on the number of continuations instantiated by this node.

Properties

inEdges
InEdgeIterator!Callable inEdges [@property getter]

Provides an iterator over this node's in-edges.

outEdges
OutEdgeIterator!Callable outEdges [@property getter]

Provides an iterator over this node's out-edges.

Static functions

dispose
void dispose(InstantiationNode* self)

Frees all resources allocated by this node and sets it to an uninitialized state.

initialize
err_t initialize(InstantiationNode* self, uint n)

Initializes an instantiation node, must be later disposed.

Variables

continuations
InEdge[] continuations;

Non-empty collection of live continuations, each corresponding to a channel in the join pattern.

definition
OutEdge definition;

Points to the definition of the join node being instantiated.

Mixed In Members

From mixin NodeInheritance

opPostMove
void opPostMove(const(This) old)

Post-move adjusts in-edge slots' owner pointer.

Detailed Description

TODO: continuation semantics are unclear w.r.t. multiple uses and scope. e.g.: can a continuation be used more than once (with basic blocks, we would like the answer to be a YES, with return continuations, a NO), or are they consumed when the join triggers? what happens if a continuation is instantiated and never jumped to? what if two threads race to use the same continuation? yet another case is with upwards-escaping continuations, which we want to forbid (so that a function can't return a continuation back into itself)

See Also