Expand description
FFI Trampolines for Async Task Operations
These extern “C” functions are called from JIT-compiled code to interact with the async task scheduler (spawn, join, cancel, scopes).
v2-boundary: All functions in this module are called from translator/opcodes/async_ops.rs and registered in ffi_symbols/async_symbols.rs.
Deleted (no callers from MirToIR):
- Simulation event scheduling (__shape_schedule_event, EventQueueOpaque, etc.)
- Cooperative yield/suspend (__shape_should_yield, __shape_yield, __shape_suspend, etc.)
- Event queue polling (__shape_poll_event, __shape_emit_event, __shape_emit_alert)
- Suspension state inspection (__shape_get_suspension_state, __shape_set_yield_threshold)
Constants§
- SUSPENSION_
ASYNC_ WAIT - Suspension state for async-wait (JoinAwait returns this to signal the JIT execution loop should hand control back to the interpreter).
Statics§
- ASYNC_
SCOPE_ ENTER_ FN - Async scope enter trampoline:
fn() - ASYNC_
SCOPE_ EXIT_ FN - Async scope exit trampoline:
fn() - CANCEL_
TASK_ FN - Cancel trampoline:
fn(future_bits: u64) - SPAWN_
TASK_ FN - Spawn trampoline:
fn(callable_bits: u64) -> u64(returns Future bits)
Functions§
- jit_
async_ scope_ enter - Enter an async scope (structured concurrency boundary).
- jit_
async_ scope_ exit - Exit an async scope (structured concurrency boundary).
- jit_
cancel_ task - Cancel a running task by its future ID.
- jit_
join_ await - Await a task group, suspending JIT execution.
- jit_
join_ init - Initialize a join group from task futures.
- jit_
spawn_ task - Spawn a new async task.
- register_
async_ ⚠task_ fns - Register all async task trampolines.
- unregister_
async_ task_ fns - Clear all async task trampoline registrations.