Skip to content

Commit

Permalink
Fold cranelift-wasm crate into wasmtime-cranelift
Browse files Browse the repository at this point in the history
This commit removes the `cranelift-wasm` crate by folding it directly
into the `wasmtime-cranelift` crate. Maintaining a runtime-agnostic
translation of WebAssembly to Cranelift has always been a bit of a
burden on us and at this time there are no known users of this crate
who are helping us to maintain this crate. There's a good number of
abstractions in the crate purely for supporting alternative runtimes and
the crate could be much simpler with far less boilerplate if it were
specialized to Wasmtime.

This commit purely moves the crate sources, deletes then-dead code, and
updates `use` paths to all point to the right place. Otherwise this does
not actually yet contain any refactoring to specialize the translation
phase to Wasmtime itself. It's expected that will come in follow-up
commits should we decide to merge this.
  • Loading branch information
alexcrichton committed Sep 30, 2024
1 parent ec3b2d2 commit aebbffc
Show file tree
Hide file tree
Showing 38 changed files with 119 additions and 1,206 deletions.
22 changes: 1 addition & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ test-programs-artifacts = { path = 'crates/test-programs/artifacts' }
pulley-interpreter = { path = 'pulley', version = "=0.2.0" }
pulley-interpreter-fuzz = { path = 'pulley/fuzz' }

cranelift-wasm = { path = "cranelift/wasm", version = "0.113.0" }
cranelift-codegen = { path = "cranelift/codegen", version = "0.113.0", default-features = false, features = ["std", "unwind"] }
cranelift-frontend = { path = "cranelift/frontend", version = "0.113.0" }
cranelift-entity = { path = "cranelift/entity", version = "0.113.0" }
Expand Down
6 changes: 0 additions & 6 deletions cranelift/codegen/src/ir/entities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ impl DynamicType {
///
/// You can create a `GlobalValue` in the following ways:
///
/// - When compiling to WASM, you can use it to load values from a
/// [`VmContext`](super::GlobalValueData::VMContext) using
/// [`FuncEnvironment::make_global`](https://docs.rs/cranelift-wasm/*/cranelift_wasm/trait.FuncEnvironment.html#tymethod.make_global).
/// - When compiling to native code, you can use it for objects in static memory with
/// [`Module::declare_data_in_func`](https://docs.rs/cranelift-module/*/cranelift_module/trait.Module.html#method.declare_data_in_func).
/// - For any compilation target, it can be registered with
Expand Down Expand Up @@ -329,9 +326,6 @@ impl JumpTable {
/// - [`Module::declare_func_in_func`](https://docs.rs/cranelift-module/*/cranelift_module/trait.Module.html#method.declare_func_in_func)
/// for functions declared elsewhere in the same native
/// [`Module`](https://docs.rs/cranelift-module/*/cranelift_module/trait.Module.html)
/// - [`FuncEnvironment::make_direct_func`](https://docs.rs/cranelift-wasm/*/cranelift_wasm/trait.FuncEnvironment.html#tymethod.make_direct_func)
/// for functions declared in the same WebAssembly
/// [`FuncEnvironment`](https://docs.rs/cranelift-wasm/*/cranelift_wasm/trait.FuncEnvironment.html#tymethod.make_direct_func)
///
/// While the order is stable, it is arbitrary.
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
Expand Down
2 changes: 1 addition & 1 deletion cranelift/codegen/src/ir/pcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! specifically the memory-access sequences. In practice, each such
//! sequence is likely to be a carefully-controlled sequence of IR
//! operations from, e.g., a sandboxing compiler (such as
//! `cranelift-wasm`) so adding annotations here to communicate
//! Wasmtime) so adding annotations here to communicate
//! intent (ranges, bounds-checks, and the like) is no problem.
//!
//! Facts are attached to SSA values in CLIF, and are maintained
Expand Down
3 changes: 0 additions & 3 deletions cranelift/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
This crate contains the meta-language utilities and descriptions used by the
code generator.

- [cranelift-wasm](https://docs.rs/cranelift-wasm)
This crate translates WebAssembly code into Cranelift IR.

- [cranelift-frontend](https://docs.rs/cranelift-frontend)
This crate provides utilities for translating code into Cranelift IR.

Expand Down
39 changes: 0 additions & 39 deletions cranelift/wasm/Cargo.toml

This file was deleted.

220 changes: 0 additions & 220 deletions cranelift/wasm/LICENSE

This file was deleted.

8 changes: 0 additions & 8 deletions cranelift/wasm/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions cranelift/wasm/src/environ/mod.rs

This file was deleted.

Loading

0 comments on commit aebbffc

Please sign in to comment.