Struct wasmtime_environ::settings::Flags[][src]

pub struct Flags { /* fields omitted */ }
Expand description

Flags group shared.

Implementations

impl Flags[src]

pub fn new(builder: Builder) -> Flags[src]

Create flags shared settings group.

impl Flags[src]

pub fn iter(&self) -> impl Iterator<Item = Value>[src]

Iterates the setting values.

impl Flags[src]

User-defined settings.

pub fn predicate_view(&self) -> PredicateView<'_>[src]

Get a view of the boolean predicates.

pub fn regalloc(&self) -> Regalloc[src]

Register allocator to use with the MachInst backend.

This selects the register allocator as an option among those offered by the regalloc.rs crate. Please report register allocation bugs to the maintainers of this crate whenever possible.

Note: this only applies to target that use the MachInst backend. As of 2020-04-17, this means the x86_64 backend doesn’t use this yet.

Possible values:

  • backtracking is a greedy, backtracking register allocator as implemented in Spidermonkey’s optimizing tier IonMonkey. It may take more time to allocate registers, but it should generate better code in general, resulting in better throughput of generated code.
  • backtracking_checked is the backtracking allocator with additional self checks that may take some time to run, and thus these checks are disabled by default.
  • experimental_linear_scan is an experimental linear scan allocator. It may take less time to allocate registers, but generated code’s quality may be inferior. As of 2020-04-17, it is still experimental and it should not be used in production settings.
  • experimental_linear_scan_checked is the linear scan allocator with additional self checks that may take some time to run, and thus these checks are disabled by default.

pub fn opt_level(&self) -> OptLevel[src]

Optimization level for generated code.

Supported levels:

  • none: Minimise compile time by disabling most optimizations.
  • speed: Generate the fastest possible code
  • speed_and_size: like “speed”, but also perform transformations aimed at reducing code size.

pub fn tls_model(&self) -> TlsModel[src]

Defines the model used to perform TLS accesses.

pub fn libcall_call_conv(&self) -> LibcallCallConv[src]

Defines the calling convention to use for LibCalls call expansion.

This may be different from the ISA default calling convention.

The default value is to use the same calling convention as the ISA default calling convention.

This list should be kept in sync with the list of calling conventions available in isa/call_conv.rs.

pub fn baldrdash_prologue_words(&self) -> u8[src]

Number of pointer-sized words pushed by the baldrdash prologue.

Functions with the baldrdash calling convention don’t generate their own prologue and epilogue. They depend on externally generated code that pushes a fixed number of words in the prologue and restores them in the epilogue.

This setting configures the number of pointer-sized words pushed on the stack when the Cranelift-generated code is entered. This includes the pushed return address on x86.

pub fn probestack_size_log2(&self) -> u8[src]

The log2 of the size of the stack guard region.

Stack frames larger than this size will have stack overflow checked by calling the probestack function.

The default is 12, which translates to a size of 4096.

pub fn enable_verifier(&self) -> bool[src]

Run the Cranelift IR verifier at strategic times during compilation.

This makes compilation slower but catches many bugs. The verifier is always enabled by default, which is useful during development.

pub fn is_pic(&self) -> bool[src]

Enable Position-Independent Code generation.

pub fn use_colocated_libcalls(&self) -> bool[src]

Use colocated libcalls.

Generate code that assumes that libcalls can be declared “colocated”, meaning they will be defined along with the current function, such that they can use more efficient addressing.

pub fn avoid_div_traps(&self) -> bool[src]

Generate explicit checks around native division instructions to avoid their trapping.

This is primarily used by SpiderMonkey which doesn’t install a signal handler for SIGFPE, but expects a SIGILL trap for division by zero.

On ISAs like ARM where the native division instructions don’t trap, this setting has no effect - explicit checks are always inserted.

pub fn enable_float(&self) -> bool[src]

Enable the use of floating-point instructions.

Disabling use of floating-point instructions is not yet implemented.

pub fn enable_nan_canonicalization(&self) -> bool[src]

Enable NaN canonicalization.

This replaces NaNs with a single canonical value, for users requiring entirely deterministic WebAssembly computation. This is not required by the WebAssembly spec, so it is not enabled by default.

pub fn enable_pinned_reg(&self) -> bool[src]

Enable the use of the pinned register.

This register is excluded from register allocation, and is completely under the control of the end-user. It is possible to read it via the get_pinned_reg instruction, and to set it with the set_pinned_reg instruction.

pub fn use_pinned_reg_as_heap_base(&self) -> bool[src]

Use the pinned register as the heap base.

Enabling this requires the enable_pinned_reg setting to be set to true. It enables a custom legalization of the heap_addr instruction so it will use the pinned register as the heap base, instead of fetching it from a global value.

Warning! Enabling this means that the pinned register must be maintained to contain the heap base address at all times, during the lifetime of a function. Using the pinned register for other purposes when this is set is very likely to cause crashes.

pub fn enable_simd(&self) -> bool[src]

Enable the use of SIMD instructions.

pub fn enable_atomics(&self) -> bool[src]

Enable the use of atomic instructions

pub fn enable_safepoints(&self) -> bool[src]

Enable safepoint instruction insertions.

This will allow the emit_stack_maps() function to insert the safepoint instruction on top of calls and interrupt traps in order to display the live reference values at that point in the program.

pub fn enable_llvm_abi_extensions(&self) -> bool[src]

Enable various ABI extensions defined by LLVM’s behavior.

In some cases, LLVM’s implementation of an ABI (calling convention) goes beyond a standard and supports additional argument types or behavior. This option instructs Cranelift codegen to follow LLVM’s behavior where applicable.

Currently, this applies only to Windows Fastcall on x86-64, and allows an i128 argument to be spread across two 64-bit integer registers. The Fastcall implementation otherwise does not support i128 arguments, and will panic if they are present and this option is not set.

pub fn unwind_info(&self) -> bool[src]

Generate unwind information.

This increases metadata size and compile time, but allows for the debugger to trace frames, is needed for GC tracing that relies on libunwind (such as in Wasmtime), and is unconditionally needed on certain platforms (such as Windows) that must always be able to unwind.

pub fn emit_all_ones_funcaddrs(&self) -> bool[src]

Emit not-yet-relocated function addresses as all-ones bit patterns.

pub fn enable_probestack(&self) -> bool[src]

Enable the use of stack probes for supported calling conventions.

pub fn probestack_func_adjusts_sp(&self) -> bool[src]

Enable if the stack probe adjusts the stack pointer.

pub fn enable_jump_tables(&self) -> bool[src]

Enable the use of jump tables in generated machine code.

pub fn enable_heap_access_spectre_mitigation(&self) -> bool[src]

Enable Spectre mitigation on heap bounds checks.

This is a no-op for any heap that needs no bounds checks; e.g., if the limit is static and the guard region is large enough that the index cannot reach past it.

This option is enabled by default because it is highly recommended for secure sandboxing. The embedder should consider the security implications carefully before disabling this option.

Trait Implementations

impl Clone for Flags[src]

pub fn clone(&self) -> Flags[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Display for Flags[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Hash for Flags[src]

pub fn hash<__H>(&self, state: &mut __H) where
    __H: Hasher
[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations

impl RefUnwindSafe for Flags

impl Send for Flags

impl Sync for Flags

impl Unpin for Flags

impl UnwindSafe for Flags

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.