Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement some minor UX improvements #1031

Merged
merged 4 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/cli/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ impl Context {
compilation_mode: CompilationMode,
) -> Result<Self, Error> {
let mut config = Config::default();
config.wasm_tail_call(true);
config.wasm_extended_const(true);
if fuel.is_some() {
config.consume_fuel(true);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/wasmi/src/engine/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ impl Default for Config {
multi_value: true,
bulk_memory: true,
reference_types: true,
tail_call: false,
extended_const: false,
tail_call: true,
extended_const: true,
floats: true,
consume_fuel: false,
fuel_costs: FuelCosts::default(),
Expand Down
2 changes: 2 additions & 0 deletions crates/wasmi/src/func/into_func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ impl_wasm_type! {
type i64 = I64;
type F32 = F32;
type F64 = F64;
type f32 = F32;
type f64 = F64;
type FuncRef = FuncRef;
type ExternRef = ExternRef;
}
Expand Down
15 changes: 15 additions & 0 deletions crates/wasmi/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,21 @@
}
}

impl<T> Default for Store<T>
where
T: Default,
{
fn default() -> Self {
let engine = Engine::default();

Check warning on line 830 in crates/wasmi/src/store.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/store.rs#L829-L830

Added lines #L829 - L830 were not covered by tests
Self {
inner: StoreInner::new(&engine),
trampolines: Arena::new(),
data: T::default(),

Check warning on line 834 in crates/wasmi/src/store.rs

View check run for this annotation

Codecov / codecov/patch

crates/wasmi/src/store.rs#L832-L834

Added lines #L832 - L834 were not covered by tests
limiter: None,
}
}
}

impl<T> Store<T> {
/// Creates a new store.
pub fn new(engine: &Engine, data: T) -> Self {
Expand Down
Loading