Skip to content

Commit

Permalink
Merge with upstream (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil authored Dec 12, 2024
2 parents 8f56e55 + d9670cf commit b036e8c
Show file tree
Hide file tree
Showing 190 changed files with 7,799 additions and 2,388 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,12 @@ jobs:
# Check that `pulley-interpreter` compiles with tail calls enabled. Don't
# actually run the tests with tail calls enabled, because they are not yet
# implemented in rustc and cause an ICE.
- run: cargo check -p pulley-interpreter
- run: cargo check -p pulley-interpreter --all-features
env:
RUSTFLAGS: "--cfg pulley_tail_calls"
- run: cargo test -p pulley-interpreter --all-features --release
env:
RUSTFLAGS: "--cfg pulley_assume_llvm_makes_tail_calls"

# Ensure that fuzzers still build.
#
Expand Down
1 change: 1 addition & 0 deletions ADOPTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Wasmtime is used in many different production use-cases. This list has grown sig
| [Embark Studios](https://www.embark-studios.com/) | [@repi](https://github.com/repi) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | Rust game engine |
| [Fastly](https://fastly.com/) | [@fitzgen](https://github.com/fitzgen) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | The Compute@Edge platform helps you compile your custom code to WebAssembly and runs it at the Fastly edge using the WebAssembly System Interface for each compute request. |
| [Fermyon](https://fermyon.com) | [@tschneidereit](https://github.com/tschneidereit) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | Fermyon Cloud is a cloud application platform for WebAssembly-based serverless functions and microservices. |
| [Huawei](https://www.huawei.com) | [@mohrobati](https://github.com/mohrobati) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | Huawei Cloud uses Wasmtime to run WebAssembly functions in both serverless cloud and on the edge. |
| [InfinyOn](https://infinyon.com/) | [@sehz](https://github.com/sehz) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | InfinyOn leverages the power of WebAssembly SmartModules to execute real-time data transformations. |
| [Microsoft](https://microsoft.com/) | [@devigned](https://gist.github.com/devigned) | ![production](https://img.shields.io/badge/-production-blue?style=flat) | Microsoft has had Wasmtime in preview for its WebAssembly System Interface (WASI) node pools in Azure Kubernetes Service since October 2021. |
| [Redpanda](https://redpanda.com/) | [@rockwotj](https://github.com/rockwotj) | ![beta](https://img.shields.io/badge/-production-blue?style=flat) | Redpanda Data Transforms allow developers to transform data directly in the message broker. |
Expand Down
9 changes: 5 additions & 4 deletions Cargo.lock

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

11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,13 @@ unused_import_braces = 'warn'
unused-lifetimes = 'warn'
unused-macro-rules = 'warn'

# Don't warn about unknown cfg condition in `#[cfg(pulley_tail_calls)]`
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(pulley_tail_calls)'] }
# Don't warn about unknown cfgs for pulley
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(pulley_tail_calls)',
'cfg(pulley_assume_llvm_makes_tail_calls)',
]

[workspace.lints.clippy]
# The default set of lints in Clippy is viewed as "too noisy" right now so
Expand All @@ -198,7 +203,7 @@ unnecessary_cast = 'warn'
allow_attributes_without_reason = 'warn'

[workspace.dependencies]
arbitrary = { version = "1.3.1" }
arbitrary = { version = "1.4.0" }
wasmtime-wmemcheck = { path = "crates/wmemcheck", version = "=29.0.0" }
wasmtime = { path = "crates/wasmtime", version = "29.0.0", default-features = false }
wasmtime-c-api-macros = { path = "crates/c-api-macros", version = "=29.0.0" }
Expand Down
7 changes: 6 additions & 1 deletion cranelift/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ x86 = []
arm64 = []
s390x = []
riscv64 = []
pulley = ["dep:pulley-interpreter", "pulley-interpreter/encode", "pulley-interpreter/disas"]
pulley = [
"dep:pulley-interpreter",
"pulley-interpreter/encode",
"pulley-interpreter/disas",
"cranelift-codegen-meta/pulley",
]
# Enable the ISA target for the host machine
host-arch = []

Expand Down
4 changes: 4 additions & 0 deletions cranelift/codegen/meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ rustdoc-args = [ "--document-private-items" ]

[dependencies]
cranelift-codegen-shared = { path = "../shared", version = "0.116.0" }
pulley-interpreter = { workspace = true, optional = true }

[features]
pulley = ['dep:pulley-interpreter']
6 changes: 5 additions & 1 deletion cranelift/codegen/meta/src/isle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub fn get_isle_compilations(
let prelude_isle = codegen_crate_dir.join("src").join("prelude.isle");
let prelude_opt_isle = codegen_crate_dir.join("src").join("prelude_opt.isle");
let prelude_lower_isle = codegen_crate_dir.join("src").join("prelude_lower.isle");
#[cfg(feature = "pulley")]
let pulley_gen = gen_dir.join("pulley_gen.isle");

// Directory for mid-end optimizations.
let src_opts = codegen_crate_dir.join("src").join("opts");
Expand All @@ -73,6 +75,7 @@ pub fn get_isle_compilations(
let src_isa_aarch64 = codegen_crate_dir.join("src").join("isa").join("aarch64");
let src_isa_s390x = codegen_crate_dir.join("src").join("isa").join("s390x");
let src_isa_risc_v = codegen_crate_dir.join("src").join("isa").join("riscv64");
#[cfg(feature = "pulley")]
let src_isa_pulley_shared = codegen_crate_dir
.join("src")
.join("isa")
Expand Down Expand Up @@ -166,6 +169,7 @@ pub fn get_isle_compilations(
untracked_inputs: vec![clif_lower_isle.clone()],
},
// The Pulley instruction selector.
#[cfg(feature = "pulley")]
IsleCompilation {
name: "pulley".to_string(),
output: gen_dir.join("isle_pulley_shared.rs"),
Expand All @@ -175,7 +179,7 @@ pub fn get_isle_compilations(
src_isa_pulley_shared.join("inst.isle"),
src_isa_pulley_shared.join("lower.isle"),
],
untracked_inputs: vec![clif_lower_isle.clone()],
untracked_inputs: vec![pulley_gen.clone(), clif_lower_isle.clone()],
},
],
}
Expand Down
15 changes: 14 additions & 1 deletion cranelift/codegen/meta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ mod constant_hash;
mod shared;
mod unique_table;

#[cfg(feature = "pulley")]
mod pulley;

/// Generate an ISA from an architecture string (e.g. "x86_64").
pub fn isa_from_arch(arch: &str) -> Result<isa::Isa, String> {
isa::Isa::from_arch(arch).ok_or_else(|| format!("no supported isa found for arch `{arch}`"))
Expand Down Expand Up @@ -63,6 +66,11 @@ fn generate_rust_for_shared_defs(
)?;
}

#[cfg(feature = "pulley")]
if isas.contains(&isa::Isa::Pulley32) || isas.contains(&isa::Isa::Pulley64) {
pulley::generate_rust("pulley_inst_gen.rs", out_dir)?;
}

Ok(())
}

Expand All @@ -82,7 +90,12 @@ fn generate_isle_for_shared_defs(
"clif_opt.isle",
"clif_lower.isle",
isle_dir,
)
)?;

#[cfg(feature = "pulley")]
pulley::generate_isle("pulley_gen.isle", isle_dir)?;

Ok(())
}

/// Generates all the source files used in Cranelift from the meta-language.
Expand Down
Loading

0 comments on commit b036e8c

Please sign in to comment.