Describes cost information of the loop (map, fold, flatMap etc.)
This is used for fail-fast checks in add
method.
Represents a single scope during execution of the graph.
Represents a single scope during execution of the graph.
The lifetime of each instance is bound to scope execution.
When the evaluation enters a new scope (e.g. calling a lambda) a new Scope instance is created and pushed
to _scopeStack, then is starts receiving add
method calls.
When the evaluation leaves the scope, the top is popped off the stack.
Called once for each operation of a scope (lambda or thunk).
Called after all operations of a scope are executed (lambda or thunk)
Called after all operations of a scope are executed (lambda or thunk)
symbol of Lambda or ThunkDef node of the scope
Resets this accumulator into initial state to be ready for new graph execution.
Resets this accumulator into initial state to be ready for new graph execution.
Called before any operation of a new scope (lambda or thunk)
Returns total accumulated cost
Returns total accumulated cost
Implements finite state machine with stack of graph blocks (scopes), which correspond to lambdas and thunks. It accepts messages: startScope(), endScope(), add(), reset() At any time
totalCost
is the currently accumulated cost.