use alloc::sync::Arc;
use miden_core::mast::{JoinNode, MastForest, MastNodeId};
use crate::{
AsyncHost, ExecutionError,
continuation_stack::ContinuationStack,
fast::{FastProcessor, Tracer, trace_state::NodeExecutionState},
};
impl FastProcessor {
#[inline(always)]
pub(super) fn start_join_node(
&mut self,
join_node: &JoinNode,
node_id: MastNodeId,
current_forest: &Arc<MastForest>,
continuation_stack: &mut ContinuationStack,
host: &mut impl AsyncHost,
tracer: &mut impl Tracer,
) -> Result<(), ExecutionError> {
tracer.start_clock_cycle(
self,
NodeExecutionState::Start(node_id),
continuation_stack,
current_forest,
);
self.execute_before_enter_decorators(node_id, current_forest, host)?;
continuation_stack.push_finish_join(node_id);
continuation_stack.push_start_node(join_node.second());
continuation_stack.push_start_node(join_node.first());
self.increment_clk(tracer);
Ok(())
}
#[inline(always)]
pub(super) fn finish_join_node(
&mut self,
node_id: MastNodeId,
current_forest: &Arc<MastForest>,
continuation_stack: &mut ContinuationStack,
host: &mut impl AsyncHost,
tracer: &mut impl Tracer,
) -> Result<(), ExecutionError> {
tracer.start_clock_cycle(
self,
NodeExecutionState::End(node_id),
continuation_stack,
current_forest,
);
self.increment_clk(tracer);
self.execute_after_exit_decorators(node_id, current_forest, host)
}
}