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

Method lower_builtin

winch/codegen/src/codegen/call.rs:164–178  ·  view source on GitHub ↗

Lowers a builtin function by loading its address to the next available register.

(
        env: &mut FuncEnv<P>,
        builtin: &BuiltinFunction,
        vmctx_offset: Option<u32>,
    )

Source from the content-addressed store, hash-verified

162 /// Lowers a builtin function by loading its address to the next available
163 /// register.
164 fn lower_builtin<P: PtrSize>(
165 env: &mut FuncEnv<P>,
166 builtin: &BuiltinFunction,
167 vmctx_offset: Option<u32>,
168 ) -> (CalleeKind, ContextArgs) {
169 match builtin.ty() {
170 BuiltinType::Builtin(idx) => (
171 CalleeKind::direct(env.name_builtin(idx)),
172 match vmctx_offset {
173 Some(offset) => ContextArgs::offset_from_pinned_vmctx(offset),
174 None => ContextArgs::pinned_vmctx(),
175 },
176 ),
177 }
178 }
179
180 /// Lower a local function to a [`CalleeKind`] and [ContextArgs] pair.
181 fn lower_local<P: PtrSize>(

Callers

nothing calls this directly

Calls 2

name_builtinMethod · 0.80
tyMethod · 0.45

Tested by

no test coverage detected