Crate wasmer_compiler
source ·Expand description
The wasmer-compiler
crate provides the necessary abstractions
to create a compiler.
It provides an universal way of parsing a module via wasmparser
,
while giving the responsibility of compiling specific function
WebAssembly bodies to the Compiler
implementation.
Structs
- The result of compiling a WebAssembly module’s functions.
- The required info for compiling a module.
- The result of compiling a WebAssembly function.
- The frame info for a Compiled function.
- A Section for a
Compilation
. - See
CustomSection
. - The DWARF information for this Compilation.
- Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal.
- Function and its instructions addresses mappings.
- The function body.
- See
FunctionBody
. - Single source location to generated address mapping.
- An opaque reference to a jump table.
- A error in the middleware.
- A record of a relocation to perform.
- The bytes in the section.
- Index type of a Section defined inside a WebAssembly
Compilation
. - A source location.
- This is the target that we will use for compiling the WebAssembly ModuleInfo, and then run it.
- Trampolines section used by ARM short jump (26bits)
- Information about trap.
- A target “triple”. Historically such things had three fields, though they’ve added additional fields over time.
Enums
- The “architecture” field, which in some cases also specifies a specific subarchitecture.
- The “binary format” field, which is usually omitted, and the binary format is implied by the other fields.
- The calling convention, which specifies things like which registers are used for passing arguments, which registers are callee-saved, and so on.
- The WebAssembly.CompileError object indicates an error during WebAssembly decoding or validation.
- Compiled function unwind information.
- The nomenclature is inspired by the
cpuid
crate. The list of supported features was initially retrieved fromcranelift-native
. - Custom section Protection.
- The target memory endianness.
- The “operating system” field, which sometimes implies an environment, and sometimes isn’t an actual operating system.
- The error that can happen while parsing a
str
to retrieve aCpuFeature
. - The width of a pointer (in the default address space).
- Relocation kinds for every ISA.
- Destination function. Can be either user function or some special one, like
memory.grow
. - A WebAssembly translation error.
Constants
- Version number of this crate.
Type Definitions
- Addend to add to the symbol value.
- Offset in bytes from the beginning of the function.
- The custom sections for a Compilation.
- The compiled functions map (index in the Wasm -> function)
- Code offsets for Jump Tables.
- Relocations to apply to function bodies.
- A convenient alias for a
Result
that usesWasmError
as the error type.