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.

Re-exports§

pub use wasmparser;translator

Modules§

object
Object creator for Wasm Compilations.
serialize
types
Types for compilation.

Macros§

wasm_unsupportedtranslator
Return an Err(WasmError::Unsupported(msg)) where msg the string built by calling format! on the arguments to this macro.

Structs§

ArtifactNon-WebAssembly
A compiled wasm module, ready to be instantiated.
ArtifactBuild
A compiled wasm module, ready to be instantiated.
ArtifactBuildFromArchive
A compiled wasm module that was loaded from a serialized archive.
BaseTunablesNon-WebAssembly
Tunable parameters for WebAssembly compilation. This is the reference implementation of the Tunables trait, used by default.
CodeMemoryNon-WebAssembly
Memory manager for executable code.
Engine
A WebAssembly Universal Engine.
EngineBuilder
The Builder contents of Engine
EngineInner
The inner contents of Engine
Features
Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal.
FunctionBodyDatatranslator
Contains function data: bytecode and its offset in the module.
FunctionExtentNon-WebAssembly
Represents a continuous region of executable memory starting with a function entry point.
GlobalFrameInfoRegistrationNon-WebAssembly
An RAII structure used to unregister a module’s frame information when the module is destroyed.
MiddlewareBinaryReadertranslator
A Middleware binary reader of the WebAssembly structures and types.
MiddlewareReaderStatetranslator
The state of the binary reader. Exposed to middlewares to push their outputs.
ModuleEnvironmenttranslator
The result of translating via ModuleEnvironment. Function bodies are not yet translated, and data initializers have not yet been copied out of the original buffer. The function bodies will be translated by a specific compiler backend.
ModuleFromArchive
Module loaded from an archive. Since CompileModuleInfo is part of the public interface of this crate and has to be mutable, it has to be deserialized completely.
ModuleTranslationStatetranslator
Contains information decoded from the Wasm module that must be referenced during each Wasm function’s translation.

Enums§

CompiledFunctionFrameInfoVariantNon-WebAssembly
The variant of the compiled function frame info which can be an owned type
FrameInfosVariantNon-WebAssembly
The variant of the frame information which can be an owned type or the explicit framed map
InstantiationError
An error while instantiating a module.
LinkError
The WebAssembly.LinkError object indicates an error during module instantiation (besides traps from the start function).

Constants§

VERSION
Version number of this crate.

Statics§

FRAME_INFONon-WebAssembly
This is a global cache of backtrace frame information for all active

Traits§

ArtifactCreate
An Artifact is the product that the Engine implementation produce and use.
Compilercompiler
An implementation of a Compiler from parsed WebAssembly module to Compiled native code.
CompilerConfigcompiler
The compiler configuration options.
FunctionBinaryReadertranslator
Trait for iterating over the operators of a Wasm Function
FunctionMiddlewaretranslator
A function middleware specialized for a single function.
ModuleMiddlewaretranslator
A shared builder for function middlewares.
ModuleMiddlewareChaintranslator
Trait for generating middleware chains from “prototype” (generator) chains.
TunablesNon-WebAssembly
An engine delegates the creation of memories, tables, and globals to a foreign implementor of this trait.
Upcastable
Trait needed to get downcasting of Engines to work.

Functions§

from_binaryreadererror_wasmerrortranslator
Make a WasmError out of a BinaryReaderError.
get_libcall_trampoline
Returns the address of a trampoline in the libcall trampolines section.
get_trace_and_trapcodeNon-WebAssembly
Given a Trap, this function returns the Wasm trace and the trap code.
libcall_trampoline_lencompiler
Returns the length of a libcall trampoline.
link_moduleNon-WebAssembly
Links a module, patching the allocated functions with the required relocations and jump tables.
make_libcall_trampolinescompiler
Creates a custom section containing the libcall trampolines.
register_frame_infoNon-WebAssembly
Registers a new compiled module’s frame information.
resolve_importsNon-WebAssembly
This function allows to match all imports of a ModuleInfo with concrete definitions provided by a Resolver.
translate_moduletranslator
Translate a sequence of bytes forming a valid Wasm binary into a parsed ModuleInfo ModuleTranslationState.
wpheaptype_to_typetranslator
Converts a wasmparser heap type to a Wasm Type.
wptype_to_typetranslator
Helper function translating wasmparser types to Wasm Type.

Type Aliases§

Addend
Addend to add to the symbol value.
CodeOffset
Offset in bytes from the beginning of the function.