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

Method ptr_param

crates/cranelift/src/compiler/component.rs:1957–1960  ·  view source on GitHub ↗

Helper function to interpret an input parameter as a pointer into linear memory. This will cast the input parameter to the host integer type and then add that value to the base. Note that bounds-checking happens in adapter modules, and this trampoline is simply calling the host libcall.

(&mut self, param: usize, is64: bool, base: ir::Value)

Source from the content-addressed store, hash-verified

1955 // Note that bounds-checking happens in adapter modules, and this
1956 // trampoline is simply calling the host libcall.
1957 fn ptr_param(&mut self, param: usize, is64: bool, base: ir::Value) -> ir::Value {
1958 let val = self.len_param(param, is64);
1959 self.builder.ins().iadd(base, val)
1960 }
1961
1962 // Helper function to cast a core wasm input to a host pointer type
1963 // which will go into the host libcall.

Callers 1

translate_transcodeMethod · 0.80

Calls 2

len_paramMethod · 0.80
insMethod · 0.45

Tested by

no test coverage detected