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

Method without

winch/codegen/src/codegen/context.rs:197–218  ·  view source on GitHub ↗

Executes the provided function, guaranteeing that the specified set of registers, if any, remain unallocatable throughout the function's execution.

(
        &mut self,
        regs: impl IntoIterator<Item = &'r Reg> + Copy,
        masm: &mut M,
        mut f: F,
    )

Source from the content-addressed store, hash-verified

195 /// registers, if any, remain unallocatable throughout the function's
196 /// execution.
197 pub fn without<'r, T, M, F>(
198 &mut self,
199 regs: impl IntoIterator<Item = &'r Reg> + Copy,
200 masm: &mut M,
201 mut f: F,
202 ) -> Result<T>
203 where
204 M: MacroAssembler,
205 F: FnMut(&mut Self, &mut M) -> T,
206 {
207 for r in regs {
208 self.reg(*r, masm)?;
209 }
210
211 let result = f(self, masm);
212
213 for r in regs {
214 self.free_reg(*r);
215 }
216
217 Ok(result)
218 }
219
220 /// Free the given register.
221 pub fn free_reg(&mut self, reg: impl Into<Reg>) {

Callers

nothing calls this directly

Calls 4

OkFunction · 0.85
free_regMethod · 0.80
fFunction · 0.50
regMethod · 0.45

Tested by

no test coverage detected