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

Method spill_register_arguments

winch/codegen/src/codegen/mod.rs:209–237  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

207 }
208
209 fn spill_register_arguments(&mut self) -> Result<()> {
210 use WasmValType::*;
211 for (operand, slot) in self
212 .sig
213 .params_without_retptr()
214 .iter()
215 .zip(self.context.frame.locals())
216 {
217 match (operand, slot) {
218 (ABIOperand::Reg { ty, reg, .. }, slot) => {
219 let addr = self.masm.local_address(slot)?;
220 match &ty {
221 I32 | I64 | F32 | F64 | V128 => {
222 self.masm.store((*reg).into(), addr, (*ty).try_into()?)?;
223 }
224 Ref(rt) => match rt.heap_type {
225 WasmHeapType::Func | WasmHeapType::Extern => {
226 self.masm.store_ptr(*reg, addr)?;
227 }
228 _ => bail!(CodeGenError::unsupported_wasm_type()),
229 },
230 }
231 }
232 // Skip non-register arguments
233 _ => {}
234 }
235 }
236 Ok(())
237 }
238}
239
240impl<'a, 'translation, 'data, M> CodeGen<'a, 'translation, 'data, M, Emission>

Callers 1

emit_prologueMethod · 0.80

Calls 8

OkFunction · 0.85
params_without_retptrMethod · 0.80
iterMethod · 0.45
localsMethod · 0.45
local_addressMethod · 0.45
storeMethod · 0.45
try_intoMethod · 0.45
store_ptrMethod · 0.45

Tested by

no test coverage detected