Skip to content

Commit

Permalink
Bench API: Enable Pulley and allow recompiling with the same bench en…
Browse files Browse the repository at this point in the history
…gine (bytecodealliance#9877)

* bench-api: Allow recompiling with the same engine

* Enable Pulley in the bench API
  • Loading branch information
fitzgen authored Dec 20, 2024
1 parent a415485 commit d621b45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/bench-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ doctest = false
anyhow = { workspace = true }
shuffling-allocator = { version = "1.1.1", optional = true }
target-lexicon = { workspace = true }
wasmtime = { workspace = true, default-features = true, features = ["winch"] }
wasmtime = { workspace = true, default-features = true, features = ["winch", "pulley"] }
wasmtime-cli-flags = { workspace = true, default-features = true, features = [
"cranelift",
] }
Expand Down
7 changes: 3 additions & 4 deletions crates/bench-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,7 @@ impl BenchState {
}

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

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

fn instantiate(&mut self) -> Result<()> {
self.store_and_instance = None;

let module = self
.module
.as_ref()
Expand Down

0 comments on commit d621b45

Please sign in to comment.