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§

Compilation
The result of compiling a WebAssembly module’s functions.
CompileModuleInfo
The required info for compiling a module.
CompiledFunction
The result of compiling a WebAssembly function.
CompiledFunctionFrameInfo
The frame info for a Compiled function.
CustomSection
A Section for a Compilation.
CustomSectionRef
See CustomSection.
Dwarf
The DWARF information for this Compilation.
Features
Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal.
FunctionAddressMap
Function and its instructions addresses mappings.
FunctionBody
The function body.
FunctionBodyRef
See FunctionBody.
InstructionAddressMap
Single source location to generated address mapping.
JumpTable
An opaque reference to a jump table.
MiddlewareError
A error in the middleware.
Relocation
A record of a relocation to perform.
SectionBody
The bytes in the section.
SectionIndex
Index type of a Section defined inside a WebAssembly Compilation.
SourceLoc
A source location.
Target
This is the target that we will use for compiling the WebAssembly ModuleInfo, and then run it.
TrampolinesSection
Trampolines section used by ARM short jump (26bits)
TrapInformation
Information about trap.
Triple
A target “triple”. Historically such things had three fields, though they’ve added additional fields over time.

Enums§

Architecture
The “architecture” field, which in some cases also specifies a specific subarchitecture.
BinaryFormat
The “binary format” field, which is usually omitted, and the binary format is implied by the other fields.
CallingConvention
The calling convention, which specifies things like which registers are used for passing arguments, which registers are callee-saved, and so on.
CompileError
The WebAssembly.CompileError object indicates an error during WebAssembly decoding or validation.
CompiledFunctionUnwindInfo
Compiled function unwind information.
CompiledFunctionUnwindInfoRef
See CompiledFunctionUnwindInfo.
CpuFeature
The nomenclature is inspired by the cpuid crate. The list of supported features was initially retrieved from cranelift-native.
CustomSectionProtection
Custom section Protection.
Endianness
The target memory endianness.
OperatingSystem
The “operating system” field, which sometimes implies an environment, and sometimes isn’t an actual operating system.
ParseCpuFeatureError
The error that can happen while parsing a str to retrieve a CpuFeature.
PointerWidth
The width of a pointer (in the default address space).
RelocationKind
Relocation kinds for every ISA.
RelocationTarget
Destination function. Can be either user function or some special one, like memory.grow.
WasmError
A WebAssembly translation error.

Constants§

VERSION
Version number of this crate.

Type Aliases§

Addend
Addend to add to the symbol value.
CodeOffset
Offset in bytes from the beginning of the function.
CustomSections
The custom sections for a Compilation.
Functions
The compiled functions map (index in the Wasm -> function)
JumpTableOffsets
Code offsets for Jump Tables.
Relocations
Relocations to apply to function bodies.
WasmResult
A convenient alias for a Result that uses WasmError as the error type.