Expand description
Runtime library calls.
Note that Wasm compilers may sometimes perform these inline rather than calling them, particularly when CPUs have special instructions which compute them directly.
These functions are called by compiled Wasm code, and therefore must take certain care about some things:
-
They must always be
pub extern "C"and should only contain basic, raw i32/i64/f32/f64/pointer parameters that are safe to pass across the system ABI! -
If any nested function propagates an
Err(trap)out to the library function frame, we need to raise it. This involves some nasty and quite unsafe code under the covers! Notable, after raising the trap, drops will not be run for local variables! This can lead to things like leakingVMInstances which leads to never deallocating JIT code, instances, and modules! Therefore, always use nested blocks to ensure drops run before raising a trap:βpub extern "C" fn my_lib_function(...) { let result = { // Do everything in here so drops run at the end of the block. ... }; if let Err(trap) = result { // Now we can safely raise the trap without leaking! raise_lib_trap(trap); } }
ModulesΒ§
- eh π
EnumsΒ§
- LibCall
- The name of a runtime library routine.
StaticsΒ§
- WASMER_
VM_ PROBESTACK - Probestack check
FunctionsΒ§
- __
adddf3 π β - __
addsf3 π β - __
divdf3 π β - __
divsf3 π β - __eqdf2 π β
- __eqsf2 π β
- __
extendsfdf2 π β - __
fixdfdi π β - __
fixdfsi π β - __
fixsfdi π β - __
fixsfsi π β - __
fixunsdfdi π β - __
fixunsdfsi π β - __
fixunssfdi π β - __
fixunssfsi π β - __
floatdidf π β - __
floatdisf π β - __
floatsidf π β - __
floatsisf π β - __
floatundidf π β - __
floatundisf π β - __
floatunsidf π β - __
floatunsisf π β - __gedf2 π β
- __gesf2 π β
- __gtdf2 π β
- __gtsf2 π β
- __ledf2 π β
- __lesf2 π β
- __ltdf2 π β
- __ltsf2 π β
- __
muldf3 π β - __
mulsf3 π β - __nedf2 π β
- __
negdf2 π β - __
negsf2 π β - __nesf2 π β
- __
subdf3 π β - __
subsf3 π β - __
truncdfsf2 π β - __
unorddf2 π β - __
unordsf2 π β - function_
pointer - The function pointer to a libcall
- throwβ
- Safety
- wasmer_
eh_ βpersonality - The implementation of Wasmerβs personality function.
- wasmer_
eh_ βpersonality2 - The second stage of the personality function. See module level documentation for an explanation of the exact procedure used during unwinding.
- wasmer_
vm_ βalloc_ exception - Implementation for allocating an exception. Returns the exnref, i.e. a handle to the exception within the store.
- wasmer_
vm_ βdata_ drop - Implementation of
data.drop. - wasmer_
vm_ dbg_ str - (debug) Print a string.
- wasmer_
vm_ dbg_ usize - (debug) Print an usize.
- wasmer_
vm_ βelem_ drop - Implementation of
elem.drop. - wasmer_
vm_ βexception_ into_ exnref - Given a pointer to a caught exception, return the exnref contained within.
- wasmer_
vm_ f32_ ceil - Implementation of f32.ceil
- wasmer_
vm_ f32_ floor - Implementation of f32.floor
- wasmer_
vm_ f32_ nearest - Implementation of f32.nearest
- wasmer_
vm_ f32_ trunc - Implementation of f32.trunc
- wasmer_
vm_ f64_ ceil - Implementation of f64.ceil
- wasmer_
vm_ f64_ floor - Implementation of f64.floor
- wasmer_
vm_ f64_ nearest - Implementation of f64.nearest
- wasmer_
vm_ f64_ trunc - Implementation of f64.trunc
- wasmer_
vm_ βfunc_ ref - Implementation of
func.ref. - wasmer_
vm_ βimported_ memory32_ atomic_ notify - Implementation of memory.notify for imported 32-bit memories.
- wasmer_
vm_ βimported_ memory32_ atomic_ wait32 - Implementation of memory.wait32 for imported 32-bit memories.
- wasmer_
vm_ βimported_ memory32_ atomic_ wait64 - Implementation of memory.wait64 for imported 32-bit memories.
- wasmer_
vm_ βimported_ memory32_ copy - Implementation of
memory.copyfor imported memories. - wasmer_
vm_ βimported_ memory32_ fill - Implementation of
memory.fillfor imported memories. - wasmer_
vm_ βimported_ memory32_ grow - Implementation of memory.grow for imported 32-bit memories.
- wasmer_
vm_ βimported_ memory32_ size - Implementation of memory.size for imported 32-bit memories.
- wasmer_
vm_ βimported_ table_ get - Implementation of
table.getfor imported tables. - wasmer_
vm_ βimported_ table_ grow - Implementation of
table.growfor imported tables. - wasmer_
vm_ βimported_ table_ set - Implementation of
table.setfor imported tables. - wasmer_
vm_ βimported_ table_ size - Implementation of
table.sizefor imported tables. - wasmer_
vm_ βmemory32_ atomic_ notify - Implementation of memory.notify for locally-defined 32-bit memories.
- wasmer_
vm_ βmemory32_ atomic_ wait32 - Implementation of memory.wait32 for locally-defined 32-bit memories.
- wasmer_
vm_ βmemory32_ atomic_ wait64 - Implementation of memory.wait64 for locally-defined 32-bit memories.
- wasmer_
vm_ βmemory32_ copy - Implementation of
memory.copyfor locally defined memories. - wasmer_
vm_ βmemory32_ fill - Implementation of
memory.fillfor locally defined memories. - wasmer_
vm_ βmemory32_ grow - Implementation of memory.grow for locally-defined 32-bit memories.
- wasmer_
vm_ βmemory32_ init - Implementation of
memory.init. - wasmer_
vm_ βmemory32_ size - Implementation of memory.size for locally-defined 32-bit memories.
- wasmer_
vm_ βraise_ trap - Implementation for raising a trap
- wasmer_
vm_ read_ exnref - Given a VMContext and an exnref (handle to an exception within the store), returns a pointer to the payload buffer of the underlying VMExceptionObj.
- wasmer_
vm_ βtable_ copy - Implementation of
table.copy. - wasmer_
vm_ βtable_ fill - Implementation of
table.fill. - wasmer_
vm_ βtable_ get - Implementation of
table.get. - wasmer_
vm_ βtable_ grow - Implementation of
table.growfor locally-defined tables. - wasmer_
vm_ βtable_ init - Implementation of
table.init. - wasmer_
vm_ βtable_ set - Implementation of
table.set. - wasmer_
vm_ βtable_ size - Implementation of
table.size. - wasmer_
vm_ βthrow - Implementation for throwing an exception.