MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / make_ret_area

Method make_ret_area

winch/codegen/src/codegen/call.rs:116–130  ·  view source on GitHub ↗

Calculates the return area for the callee, if any.

(
        callee_sig: &ABISig,
        masm: &mut M,
    )

Source from the content-addressed store, hash-verified

114
115 /// Calculates the return area for the callee, if any.
116 fn make_ret_area<M: MacroAssembler>(
117 callee_sig: &ABISig,
118 masm: &mut M,
119 ) -> Result<Option<RetArea>> {
120 if callee_sig.has_stack_results() {
121 let base = masm.sp_offset()?.as_u32();
122 let end = base + callee_sig.results_stack_size();
123 if end > base {
124 masm.reserve_stack(end - base)?;
125 }
126 Ok(Some(RetArea::sp(SPOffset::from_u32(end))))
127 } else {
128 Ok(None)
129 }
130 }
131
132 /// Lowers the high-level [`Callee`] to a [`CalleeKind`] and
133 /// [ContextArgs] pair which contains all the metadata needed for

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
spFunction · 0.85
has_stack_resultsMethod · 0.80
results_stack_sizeMethod · 0.80
as_u32Method · 0.45
sp_offsetMethod · 0.45
reserve_stackMethod · 0.45

Tested by

no test coverage detected