Add CLI options for more configuration options (#3603)
This commit adds a few more CLI flags for random fiddly bits in the `Config` structure to make it a bit easier to play around on the command line and see the effect of various flags on compiled code.
This commit is contained in:
17
src/lib.rs
17
src/lib.rs
@@ -231,6 +231,19 @@ struct CommonOptions {
|
|||||||
/// Enable Cranelift's internal NaN canonicalization
|
/// Enable Cranelift's internal NaN canonicalization
|
||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
enable_cranelift_nan_canonicalization: bool,
|
enable_cranelift_nan_canonicalization: bool,
|
||||||
|
|
||||||
|
/// Executing wasm code will consume fuel, limiting its execution.
|
||||||
|
#[structopt(long)]
|
||||||
|
consume_fuel: bool,
|
||||||
|
|
||||||
|
/// Disables the on-by-default address map from native code to wasm code.
|
||||||
|
#[structopt(long)]
|
||||||
|
disable_address_map: bool,
|
||||||
|
|
||||||
|
/// Switches memory initialization to happen in a paged fashion instead of
|
||||||
|
/// the data segments specified in the original wasm module.
|
||||||
|
#[structopt(long)]
|
||||||
|
paged_memory_initialization: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CommonOptions {
|
impl CommonOptions {
|
||||||
@@ -301,6 +314,10 @@ impl CommonOptions {
|
|||||||
config.dynamic_memory_guard_size(size);
|
config.dynamic_memory_guard_size(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.consume_fuel(self.consume_fuel);
|
||||||
|
config.generate_address_map(!self.disable_address_map);
|
||||||
|
config.paged_memory_initialization(self.paged_memory_initialization);
|
||||||
|
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user