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

Method lift_params

crates/wasmtime/src/runtime/component/func/host.rs:641–656  ·  view source on GitHub ↗
(cx: &mut LiftContext<'_>, ty: TypeFuncIndex, src: Source<'_>)

Source from the content-addressed store, hash-verified

639 }
640
641 fn lift_params(cx: &mut LiftContext<'_>, ty: TypeFuncIndex, src: Source<'_>) -> Result<P> {
642 let ty = InterfaceType::Tuple(cx.types[ty].params);
643 match src {
644 Source::Flat(storage) => {
645 // SAFETY: the contract of `ComponentType` for `P` means that
646 // it's safe to interpret the parameters `storage` as
647 // `P::Lower`. The contract of `entrypoint` is that everything
648 // is initialized correctly internally.
649 let storage: &P::Lower = unsafe { slice_to_storage(storage) };
650 P::linear_lift_from_flat(cx, ty, storage)
651 }
652 Source::Memory(offset) => {
653 P::linear_lift_from_memory(cx, ty, &cx.memory()[offset..][..P::SIZE32])
654 }
655 }
656 }
657
658 fn lower_result(
659 cx: &mut LowerContext<'_, T>,

Callers

nothing calls this directly

Calls 14

slice_to_storageFunction · 0.85
OkFunction · 0.85
fromFunction · 0.85
next_field32_sizeMethod · 0.80
TupleClass · 0.50
newFunction · 0.50
liftFunction · 0.50
loadFunction · 0.50
memoryMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
canonical_abiMethod · 0.45

Tested by

no test coverage detected