pub fn emit_alloc_fast_path(
builder: &mut FunctionBuilder<'_>,
vmctx_val: Value,
size: u64,
gc_trigger_sig: SigRef,
oom_func: FuncRef,
) -> ValueExpand description
Emit the alloc fast-path as inline Cranelift IR.
This is a bump-pointer allocation:
- Load alloc_ptr from VMContext
- new_ptr = alloc_ptr + size (8-byte aligned)
- If new_ptr > alloc_limit: call gc_trigger (cold path), then retry
- Store new_ptr as alloc_ptr
- Return old alloc_ptr (start of allocated region)
vmctx_val is the SSA value holding the VMContext pointer.
size is the number of bytes to allocate (will be rounded up to 8-byte alignment).
gc_trigger_sig is the signature reference for the gc_trigger call.
Returns the SSA value pointing to the start of the allocated memory.