Skip to content

Commit d621b45

Browse files
authored
Bench API: Enable Pulley and allow recompiling with the same bench engine (bytecodealliance#9877)
* bench-api: Allow recompiling with the same engine * Enable Pulley in the bench API
1 parent a415485 commit d621b45

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

crates/bench-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ doctest = false
2222
anyhow = { workspace = true }
2323
shuffling-allocator = { version = "1.1.1", optional = true }
2424
target-lexicon = { workspace = true }
25-
wasmtime = { workspace = true, default-features = true, features = ["winch"] }
25+
wasmtime = { workspace = true, default-features = true, features = ["winch", "pulley"] }
2626
wasmtime-cli-flags = { workspace = true, default-features = true, features = [
2727
"cranelift",
2828
] }

crates/bench-api/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,7 @@ impl BenchState {
484484
}
485485

486486
fn compile(&mut self, bytes: &[u8]) -> Result<()> {
487-
assert!(
488-
self.module.is_none(),
489-
"create a new engine to repeat compilation"
490-
);
487+
self.module = None;
491488

492489
(self.compilation_start)(self.compilation_timer);
493490
let module = Module::from_binary(self.linker.engine(), bytes)?;
@@ -498,6 +495,8 @@ impl BenchState {
498495
}
499496

500497
fn instantiate(&mut self) -> Result<()> {
498+
self.store_and_instance = None;
499+
501500
let module = self
502501
.module
503502
.as_ref()

0 commit comments

Comments
 (0)