pub struct Cranelift {
enable_nan_canonicalization: bool,
enable_verifier: bool,
pub(crate) enable_perfmap: bool,
enable_pic: bool,
opt_level: CraneliftOptLevel,
pub num_threads: NonZero<usize>,
pub(crate) middlewares: Vec<Arc<dyn ModuleMiddleware>>,
pub(crate) callbacks: Option<CraneliftCallbacks>,
}Expand description
Global configuration options used to create an
wasmer_engine::Engine and customize its behavior.
This structure exposes a builder-like interface and is primarily
consumed by wasmer_engine::Engine::new.
Fields§
§enable_nan_canonicalization: bool§enable_verifier: bool§enable_perfmap: bool§enable_pic: bool§opt_level: CraneliftOptLevel§num_threads: NonZero<usize>The number of threads to use for compilation.
middlewares: Vec<Arc<dyn ModuleMiddleware>>The middleware chain.
callbacks: Option<CraneliftCallbacks>Implementations§
Source§impl Cranelift
impl Cranelift
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new configuration object with the default configuration specified.
Sourcepub fn canonicalize_nans(&mut self, enable: bool) -> &mut Self
pub fn canonicalize_nans(&mut self, enable: bool) -> &mut Self
Enable NaN canonicalization.
NaN canonicalization is useful when trying to run WebAssembly deterministically across different architectures.
Sourcepub fn num_threads(&mut self, num_threads: NonZero<usize>) -> &mut Self
pub fn num_threads(&mut self, num_threads: NonZero<usize>) -> &mut Self
Set the number of threads to use for compilation.
Sourcepub fn opt_level(&mut self, opt_level: CraneliftOptLevel) -> &mut Self
pub fn opt_level(&mut self, opt_level: CraneliftOptLevel) -> &mut Self
The optimization levels when optimizing the IR.
Sourcepub fn isa(&self, target: &Target) -> CodegenResult<Arc<dyn TargetIsa>>
pub fn isa(&self, target: &Target) -> CodegenResult<Arc<dyn TargetIsa>>
Generates the ISA for the provided target
Sourcepub fn callbacks(&mut self, callbacks: Option<CraneliftCallbacks>) -> &mut Self
pub fn callbacks(&mut self, callbacks: Option<CraneliftCallbacks>) -> &mut Self
Callbacks that will triggered in the different compilation phases in Cranelift.
Trait Implementations§
Source§impl CompilerConfig for Cranelift
impl CompilerConfig for Cranelift
Source§fn push_middleware(&mut self, middleware: Arc<dyn ModuleMiddleware>)
fn push_middleware(&mut self, middleware: Arc<dyn ModuleMiddleware>)
Pushes a middleware onto the back of the middleware chain.
Source§fn enable_pic(&mut self)
fn enable_pic(&mut self)
Source§fn enable_verifier(&mut self)
fn enable_verifier(&mut self)
Source§fn enable_perfmap(&mut self)
fn enable_perfmap(&mut self)
Source§fn canonicalize_nans(&mut self, enable: bool)
fn canonicalize_nans(&mut self, enable: bool)
Source§fn supported_features_for_target(&self, target: &Target) -> Features
fn supported_features_for_target(&self, target: &Target) -> Features
§fn default_features_for_target(&self, target: &Target) -> Features
fn default_features_for_target(&self, target: &Target) -> Features
Auto Trait Implementations§
impl Freeze for Cranelift
impl !RefUnwindSafe for Cranelift
impl Send for Cranelift
impl Sync for Cranelift
impl Unpin for Cranelift
impl !UnwindSafe for Cranelift
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more