commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
a71f6794537d9e89e925124c1295f6de9999cd6e
Dan Gohman
2023-01-03T15:43:04
Update wasi-tests to wasi 0.11. (#5488) This updates the tests to version 0.11 of the wasi bindings. There aren't any fundamental changes here; this just syncs up with the latest version so that it's consistent with other users of the wasi APIs.
diff --git a/crates/test-programs/wasi-tests/Cargo.lock b/crates/test-programs/wasi-tests/Cargo.lock index 004fa00cc..d1d241ba8 100644 --- a/crates/test-programs/wasi-tests/Cargo.lock +++ b/crates/test-programs/wasi-tests/Cargo.lock @@ -16,9 +16,9 @@ checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac...
28
89
149
21ba68b41bf287965c50d62e1aaf0bf0e11a0d4f
Dan Gohman
2022-12-24T04:00:48
Implement `command` exit statuses. (#40) Add a `result` return type to `command` so that it can indicate success or failure. The idea here is that this isn't a full `i32` return value because the meaning of return values isn't portable across platforms. Also, Typed Main is a better long-term answer for users tha...
diff --git a/src/lib.rs b/src/lib.rs index f8d99b458..5ad723e77 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,7 +33,7 @@ pub unsafe extern "C" fn command( args_len: usize, env_vars: StrTupleList, preopens: PreopenList, -) { +) -> Result<(), ()> { // TODO: ideally turning off `command` would remove...
1
2
1
310fdbccf5cc3dd3663354e0e8f38cfd44840cd6
Dan Gohman
2022-12-24T04:00:48
Implement `command` exit statuses. (#40) Add a `result` return type to `command` so that it can indicate success or failure. The idea here is that this isn't a full `i32` return value because the meaning of return values isn't portable across platforms. Also, Typed Main is a better long-term answer for users tha...
diff --git a/host/src/main.rs b/host/src/main.rs index cf11313c9..35aa68b32 100644 --- a/host/src/main.rs +++ b/host/src/main.rs @@ -29,7 +29,11 @@ async fn main() -> Result<()> { let (wasi, _instance) = Wasi::instantiate_async(&mut store, &component, &linker).await?; - wasi.command(&mut store, 0, 0, &[], &...
6
94
14
18a8d26710b0bcad62fada61a2e4e374665cea7c
Dan Gohman
2022-12-24T04:00:07
Implement host file flags and type functions. (#42) This gets us another step closer to running the Wasmtime tests.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index bb8fce053..ae50e6de9 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -9,7 +9,7 @@ use std::{ }; use wasi_common::{ dir::TableDirExt, - file::{FileStream, TableFileExt}, + file::{FdFlags, FileStream, TableFileExt}, W...
3
81
21
decb08c00dfbbdc79377c96b735084406cd6e7cd
Dan Gohman
2022-12-23T23:29:06
Add pseudo-streams. (#29) * Add pseudo-streams. This add a pseudo-stream type to the wasi-poll interface, and adds ways to obtain streams from command invocation and from files. In the future, it can support sockets too. With this, `command` takes streams for stdin/stdout, rather than filesystem descriptors. ...
diff --git a/src/lib.rs b/src/lib.rs index 97c83c481..f8d99b458 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,7 +11,7 @@ use core::mem::{self, forget, replace, size_of, ManuallyDrop, MaybeUninit}; use core::ptr::{self, copy_nonoverlapping, null_mut}; use core::slice; use wasi::*; -use wasi_poll::WasiFuture; +use w...
1
381
127
bad0f20d10114b444fadee7ef4f848ef718a8004
Joel Dice
2022-12-23T18:11:51
implement more host filesystem functions The `file_read` test now passes. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
diff --git a/src/lib.rs b/src/lib.rs index 6df2f9fd6..97c83c481 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -969,6 +969,7 @@ pub unsafe extern "C" fn fd_seek( _ => return Err(ERRNO_INVAL), }; let result = wasi_filesystem::seek(file.fd, from)?; + file.position.set(result); ...
1
1
0
0798e85f75c48fcada5dd66b946fb65d27f96122
Joel Dice
2022-12-23T18:11:51
implement more host filesystem functions The `file_read` test now passes. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index 6b65a3ff9..5e82a9533 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -1,8 +1,16 @@ #![allow(unused_variables)] use crate::{wasi_filesystem, HostResult, WasiCtx}; -use std::io::{IoSlice, IoSliceMut}; -use wasi_common::file::TableF...
2
178
8
32c1a87a86e9a9fe3b2945c08d9a4fa9a93edd41
Joel Dice
2022-12-23T15:41:07
add support for environment variables and preopens Per #31, we pass env vars and preopens via `command`, just like CLI arguments. Later, we plan to add another interface (e.g. `cli-reactor`) for reactors which need env vars and/or preopens, which will have a single function `initialize` that takes the same two paramet...
diff --git a/src/lib.rs b/src/lib.rs index 28b399fbe..6df2f9fd6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,6 +31,8 @@ pub unsafe extern "C" fn command( stdout: u32, args_ptr: *const WasmStr, args_len: usize, + env_vars: StrTupleList, + preopens: PreopenList, ) { // TODO: ideally turning ...
1
147
25
31e7fbb7b165d00f154119a622cf6e70e6e806e7
Joel Dice
2022-12-23T15:41:07
add support for environment variables and preopens Per #31, we pass env vars and preopens via `command`, just like CLI arguments. Later, we plan to add another interface (e.g. `cli-reactor`) for reactors which need env vars and/or preopens, which will have a single function `initialize` that takes the same two paramet...
diff --git a/host/Cargo.toml b/host/Cargo.toml index 84517cac2..b39c91135 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -19,3 +19,4 @@ wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync" } test-programs-macros = { path = "../test-programs/macros" } tracing-subscriber = { version = "0.3", default-featur...
11
108
150
36a0fa76a3f45969a7b8b6b66b8e36c03b2f9bd1
Dan Gohman
2022-12-23T18:51:37
Fix `fd_renumber` to handle output fds that aren't previously allocated. (#38) This fixes the crates/test-programs/wasi-tests/src/bin/stdio.rs test in the Wasmtime testsuite.
diff --git a/src/lib.rs b/src/lib.rs index f105f667f..28b399fbe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -843,10 +843,18 @@ pub unsafe extern "C" fn fd_renumber(fd: Fd, to: Fd) -> Errno { State::with_mut(|state| { let closed = state.closed; + // Ensure the table is big enough to contain `to`. ...
1
9
1
fa34a13ecc4ec1cfde75d5f44b0132da6d8c363a
Dan Gohman
2022-12-22T16:47:27
Add a way to get a random `u64`. (#36) This anticipates https://github.com/WebAssembly/wasi-random/pull/18.
diff --git a/host/src/random.rs b/host/src/random.rs index 35a5f8162..36c76aa80 100644 --- a/host/src/random.rs +++ b/host/src/random.rs @@ -4,10 +4,14 @@ use crate::{wasi_random, WasiCtx}; #[async_trait::async_trait] impl wasi_random::WasiRandom for WasiCtx { - async fn getrandom(&mut self, len: u32) -> anyhow:...
1
5
1
e20ab42597b087c672c42a16d297541a4fc550d3
Dan Gohman
2022-12-22T16:47:27
Add a way to get a random `u64`. (#36) This anticipates https://github.com/WebAssembly/wasi-random/pull/18.
diff --git a/src/lib.rs b/src/lib.rs index 16bf4d48e..f105f667f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1474,7 +1474,7 @@ pub unsafe extern "C" fn random_get(buf: *mut u8, buf_len: Size) -> Errno { state.register_buffer(buf, buf_len); assert_eq!(buf_len as u32 as Size, buf_len); - let re...
1
1
1
87f740b71e5571be250cdc3409ef4e1cb1abd7df
Dan Gohman
2022-12-22T16:46:18
Fix a broken link in a doc comment. (#34)
diff --git a/wasi-common/cap-std-sync/src/net.rs b/wasi-common/cap-std-sync/src/net.rs index bdbf507fe..b20a71486 100644 --- a/wasi-common/cap-std-sync/src/net.rs +++ b/wasi-common/cap-std-sync/src/net.rs @@ -387,7 +387,7 @@ pub fn get_fd_flags<Socketlike: AsSocketlike>( /// Return the file-descriptor flags for a gi...
1
1
1
657ffafcc88b5551f9f762da578dc745281a76f6
Dan Gohman
2022-12-22T16:46:06
Remove no-longer-needed `#[allow(...)]` directives. (#35)
diff --git a/host/src/exit.rs b/host/src/exit.rs index 475b888ca..22ef106ac 100644 --- a/host/src/exit.rs +++ b/host/src/exit.rs @@ -1,5 +1,3 @@ -#![allow(unused_variables)] - use crate::{wasi_exit, WasiCtx}; #[async_trait::async_trait] diff --git a/host/src/logging.rs b/host/src/logging.rs index 1d9bbf775..7dba22a...
3
0
6
a308828ba2f26e2cf7faecd5ed532f083107f042
Afonso Bordado
2022-12-21T00:12:38
fuzzgen: Add `bitcast` (#5481) * fuzzgen: Add `bitcast` * fuzzgen: Enable IaddCout for 32/64bit integer on x86_64 These were added in #5285
diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index ebdd89a5c..5b3c58f08 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -188,6 +188,26 @@ fn insert_const( Ok(()) } +fn insert_bitcast( + fge...
1
25
2
307945877e7b800bd12b5932c4c64eae61888235
Afonso Bordado
2022-12-20T00:39:33
fuzzgen: Add `srem`/`urem` (#5476)
diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index cb8019bae..ebdd89a5c 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -304,6 +304,28 @@ const OPCODE_SIGNATURES: &'static [( // aarch64: https:...
1
22
0
921f6ca3b1eda9485fdb469030958a3dd8ac406c
Afonso Bordado
2022-12-19T20:41:42
fuzzgen: Add `iabs`/`umulhi`/`smulhi` (#5469) * fuzzgen: Add `iabs` instruction * fuzzgen: Add `smulhi`/`umulhi`
diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index f1c0059ea..cb8019bae 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -270,6 +270,20 @@ const OPCODE_SIGNATURES: &'static [( (Opcode::Imul, &[I32...
1
28
0
6dc3646f326f0c2c3f3b47ad1392824d3204d24f
Joel Dice
2022-12-17T17:00:01
add tests for `wasi-random`, `wasi-clocks`, and stdin (#30) This required fleshing out the `wasi-clocks` host implementation a bit and adding a `read_vectored_at` implementation for `ReadPipe`. Signed-off-by: Joel Dice <joel.dice@fermyon.com> Signed-off-by: Joel Dice <joel.dice@fermyon.com>
diff --git a/src/lib.rs b/src/lib.rs index 0506665b1..16bf4d48e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1792,7 +1792,7 @@ const fn command_data_size() -> usize { start -= size_of::<DirentCache>(); // Remove miscellaneous metadata also stored in state. - start -= 7 * size_of::<usize>(); + start -=...
1
2
2
b8e2c746068c0b4ad5560ed32ef5d79ef4e13c8c
Joel Dice
2022-12-17T17:00:01
add tests for `wasi-random`, `wasi-clocks`, and stdin (#30) This required fleshing out the `wasi-clocks` host implementation a bit and adding a `read_vectored_at` implementation for `ReadPipe`. Signed-off-by: Joel Dice <joel.dice@fermyon.com> Signed-off-by: Joel Dice <joel.dice@fermyon.com>
diff --git a/host/src/clocks.rs b/host/src/clocks.rs index a591050ef..ecad346af 100644 --- a/host/src/clocks.rs +++ b/host/src/clocks.rs @@ -7,8 +7,13 @@ impl TryFrom<SystemTime> for wasi_clocks::Datetime { type Error = anyhow::Error; fn try_from(time: SystemTime) -> Result<Self, Self::Error> { - dro...
9
160
23
6323b0f9f4a14d8b6a0d50c328bba475550e731c
Afonso Bordado
2022-12-16T18:39:32
fuzzgen: Use the generic insert for select_spectre_guard (#5458) Now that we have a generic version of select_spectre_guard we don't need to always preced it with an `icmp`.
diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index dd572ced9..4b228f8c7 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -73,33 +73,6 @@ fn insert_opcode( Ok(()) } -// `select_spectre_guard` is...
1
33
54
e0c00bd34dc4f55792e072b7cb0d85235185b974
Dan Gohman
2022-12-16T00:07:42
Don't print extra metadata in stdout/stderr, and implement proc_exit (#27) Add an API to implement proc_exit with, and implement it.
diff --git a/src/lib.rs b/src/lib.rs index c3f7c05a4..0506665b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,8 @@ #![allow(unused_variables)] // TODO: remove this when more things are implemented use crate::bindings::{ - wasi_clocks, wasi_default_clocks, wasi_filesystem, wasi_logging, wasi_poll, wasi_rand...
1
10
13
5dd1ec2345d7222e19a4557acd62afb746caacbe
Dan Gohman
2022-12-16T00:07:42
Don't print extra metadata in stdout/stderr, and implement proc_exit (#27) Add an API to implement proc_exit with, and implement it.
diff --git a/host/src/exit.rs b/host/src/exit.rs new file mode 100644 index 000000000..475b888ca --- /dev/null +++ b/host/src/exit.rs @@ -0,0 +1,14 @@ +#![allow(unused_variables)] + +use crate::{wasi_exit, WasiCtx}; + +#[async_trait::async_trait] +impl wasi_exit::WasiExit for WasiCtx { + async fn exit(&mut self, sta...
2
16
0
2cfa024855f4b542999c7bf547838e2f85b244a5
Alex Crichton
2022-12-15T22:56:16
Support fuel and epoch interruption in the benchmarking API (#5449) When these engine flags are passed be sure to configure the store appropriately to ensure that the wasm can actually run instead of crashing immediately, enabling benchmarking comparisons between these modes.
diff --git a/crates/bench-api/src/lib.rs b/crates/bench-api/src/lib.rs index 60291d24f..7d894fe71 100644 --- a/crates/bench-api/src/lib.rs +++ b/crates/bench-api/src/lib.rs @@ -406,6 +406,8 @@ struct BenchState { make_wasi_cx: Box<dyn FnMut() -> Result<WasiCtx>>, module: Option<Module>, store_and_instanc...
1
18
0
1fe56d7efb6a9860bf99fb818f19f8b91f4d1222
Nick Fitzgerald
2022-12-15T20:18:52
Account for fuel before unconditionally trapping Wasm accesses (#5447) * Account for fuel before unconditionally trapping Wasm accesses Fixes #5445 * Add a test for fuel accounting and unconditionally trapping memory accesses
diff --git a/cranelift/wasm/src/code_translator.rs b/cranelift/wasm/src/code_translator.rs index 05f7d0b99..2250fb3cf 100644 --- a/cranelift/wasm/src/code_translator.rs +++ b/cranelift/wasm/src/code_translator.rs @@ -2316,17 +2316,18 @@ where // offsets in `memarg` are <=2gb, which means we get the fast path of on...
5
80
15
0a6a28a4fb28ab14453c9ed41f9e9d696061879a
Jake Champion
2022-12-15T00:33:36
fix typo in hint about WASMTIME_BACKTRACE_DETAILS env var (#5443) * fix typo in hint about WASMTIME_BACKTRACE_DETAILS env var * Update traps.rs
diff --git a/crates/wasmtime/src/trap.rs b/crates/wasmtime/src/trap.rs index f16f19aed..41b59fe0d 100644 --- a/crates/wasmtime/src/trap.rs +++ b/crates/wasmtime/src/trap.rs @@ -389,7 +389,7 @@ impl fmt::Display for WasmBacktrace { } } if self.hint_wasm_backtrace_details_env { - ...
2
2
2
2e0bc7dab6e888f6b827bc33fa4507d2d5075cc4
Pat Hickey
2022-12-14T18:44:05
Wasmtime component bindgen: opt-in trappable error types (#5397) * wip * start trying to write a runtime test * cut out all the more complex test cases until i get this one working * add macro parsing for the trappable error type config * runtime result tests works for an empty and a string error type *...
diff --git a/Cargo.lock b/Cargo.lock index 751b5d39e..29e6ee8d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3790,6 +3790,7 @@ dependencies = [ name = "wasmtime-wit-bindgen" version = "5.0.0" dependencies = [ + "anyhow", "heck", "wit-parser", ] diff --git a/crates/component-macro/src/bindgen.rs b/crates/compone...
8
714
176
299be327d577e342669df70dfc0f17c1b54a5525
Ulrich Weigand
2022-12-13T23:22:49
Simplify "unimplemented" operation error message (#5429) Now that all operations are implemented in ISLE, simplify Rust code by providing a generic error message if any operation is not implemented in ISLE. Done across all targets.
diff --git a/cranelift/codegen/src/isa/aarch64/lower.rs b/cranelift/codegen/src/isa/aarch64/lower.rs index 55f40ff74..2e4b487d6 100644 --- a/cranelift/codegen/src/isa/aarch64/lower.rs +++ b/cranelift/codegen/src/isa/aarch64/lower.rs @@ -15,7 +15,6 @@ use crate::isa::aarch64::inst::*; use crate::isa::aarch64::AArch64Ba...
4
21
647
3ce896f69da43d73feb90815c670ef4e253d5bf8
Andrew Brown
2022-12-13T22:38:47
wiggle: choose between `&mut self` and `&self` (#5428) Previously, all Wiggle-generated traits were generated with `&mut self` signatures. With the addition of the `mutable` configuration option to `from_witx!` and `wasmtime_integration!`, one can disable this, emitting instead traits that use `&self` (i.e., `mutab...
diff --git a/crates/wiggle/generate/src/codegen_settings.rs b/crates/wiggle/generate/src/codegen_settings.rs index 11391ed71..b6fdf62f2 100644 --- a/crates/wiggle/generate/src/codegen_settings.rs +++ b/crates/wiggle/generate/src/codegen_settings.rs @@ -12,10 +12,13 @@ pub struct CodegenSettings { pub errors: Error...
6
52
9
37ade17e2a2c90d4c7a63c3b899cd5a02f494353
Alex Crichton
2022-12-13T20:04:56
Allow at least 1 page of memory when disallowing traps (#5421) This commit fixes configuration of the pooling instance allocator when traps are disallowed while fuzzing to ensure that there's at least one page of memory. The support in `wasm-smith` currently forcibly creates a 1-page memory which was previously inv...
diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs index 91c325390..30de3d316 100644 --- a/crates/fuzzing/src/generators/config.rs +++ b/crates/fuzzing/src/generators/config.rs @@ -311,6 +311,20 @@ impl<'a> Arbitrary<'a> for Config { cfg.max_memory_pages = po...
1
14
0
bf3d212ae952624882a13f450c31f42e18a20103
Dan Gohman
2022-12-13T18:48:43
Implement `fd_renumber`. (#21) * Implement `fd_renumber`. * Implement `Drop` for `Descriptor` to free backend resources. Instead of trying to remember to call `close` on file descriptors when they're replaced or removed, just have the `Drop` impl for `Descriptor`. * Use the local `unwrap_result` instead of `...
diff --git a/src/lib.rs b/src/lib.rs index 173fd08cc..c3f7c05a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ use crate::bindings::{ use core::arch::wasm32::unreachable; use core::cell::{Cell, RefCell, UnsafeCell}; use core::ffi::c_void; -use core::mem::{self, forget, size_of, ManuallyDrop, MaybeUninit}; ...
1
33
28
2da3694844f158ecb5ab67901d26280f82eb0040
Ari Seyhun
2022-12-13T17:54:48
Upgrade `wasmtime` and remove `wit-bindgen-host-wasmtime-rust` (#25)
diff --git a/host/Cargo.toml b/host/Cargo.toml index 386099804..84517cac2 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -10,13 +10,12 @@ async-trait = { workspace = true } cap-std = { workspace = true } cap-rand = { workspace = true } tokio = { version = "1.22.0", features = [ "rt", "macros" ] } -wasmtime = ...
4
12
21
0a54cdfabc089e26034dc7758e68230901c3d793
Alex Crichton
2022-12-13T17:11:45
Implement the `fd_readdir` function (#23) * Implement the `fd_readdir` function This roughly matches the implementation in `wasi-common` today where it uses the directory entry stream as a form of iterator and the `cookie` represents the `n`th iteration. Not exactly efficient if the `buf` provided to the hostcal...
diff --git a/src/lib.rs b/src/lib.rs index 42154852f..173fd08cc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ use crate::bindings::{ use core::arch::wasm32::unreachable; use core::cell::{Cell, RefCell, UnsafeCell}; use core::ffi::c_void; -use core::mem::{self, forget, size_of, MaybeUninit}; +use core::mem...
1
241
38
ce548181ac6c0430ab1b397daaab25238ce0ce0e
Alex Crichton
2022-12-13T17:11:45
Implement the `fd_readdir` function (#23) * Implement the `fd_readdir` function This roughly matches the implementation in `wasi-common` today where it uses the directory entry stream as a form of iterator and the `cookie` represents the `n`th iteration. Not exactly efficient if the `buf` provided to the hostcal...
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index f81d84073..f1e612fed 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -195,7 +195,14 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { async fn read_dir_entry( &mut self, stream: wasi_filesystem::DirEntryStr...
1
8
1
a2acf7c7b76a78911567af244d4d861c49b50f24
Ari Seyhun
2022-12-13T16:57:50
Implement `getrandom` using `Standard` distribution (#24)
diff --git a/host/Cargo.toml b/host/Cargo.toml index 94e388251..386099804 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -8,6 +8,7 @@ anyhow = { workspace = true } thiserror = { workspace = true } async-trait = { workspace = true } cap-std = { workspace = true } +cap-rand = { workspace = true } tokio = { ver...
2
7
1
a76e0e8aa57220fe9c75f810c293ba2694d65e7a
Saúl Cabrera
2022-12-13T12:13:45
Decouple `MachBufferFinalized<Stencil>` from `ir::FunctionParameters` (#5419) This commit allows retrieving a `MachBufferFinalized<Final>` from a `MachBufferFinalized<Stencil>` without relying on `ir::FunctionParameters`. Instead it uses the function's base source location, which is the only piece used by the previ...
diff --git a/cranelift/codegen/src/machinst/buffer.rs b/cranelift/codegen/src/machinst/buffer.rs index 8a71d33cb..316e916db 100644 --- a/cranelift/codegen/src/machinst/buffer.rs +++ b/cranelift/codegen/src/machinst/buffer.rs @@ -141,7 +141,6 @@ //! semantics below (grep for "Preserves execution semantics"). use cra...
2
6
8
7adf3cacc50a10512e001552aa5b9d84ab238cac
Saúl Cabrera
2022-12-12T17:01:06
cranelift-codegen: Prepare cranelift codegen for usage from Winch (#5413) This commit prepares the x64 pieces from cranelift codegen to be consumed by Winch for binary emission. This change doesn't introduce or modifies functionality it makes the necessary pieces for binary emission public. This change also impro...
diff --git a/cranelift/codegen/src/isa/x64/inst/args.rs b/cranelift/codegen/src/isa/x64/inst/args.rs index b792e528a..0d202082c 100644 --- a/cranelift/codegen/src/isa/x64/inst/args.rs +++ b/cranelift/codegen/src/isa/x64/inst/args.rs @@ -14,11 +14,13 @@ use std::string::String; /// An extenstion trait for converting ...
5
119
22
8f23e5a66f4444b7a49e499f43d83473d2f6f558
Martin Evans
2022-12-12T15:32:23
`--json` option for `wasmtime settings` command (#5411) * - Added `--json` flag to settings command - Refactored gathering of data into a `Settings` struct which can be used in both human/machine readable paths - Split out human readable output to another function, it produces exactly the same result as before ...
diff --git a/Cargo.lock b/Cargo.lock index 26f719dab..73154abba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3475,6 +3475,8 @@ dependencies = [ "once_cell", "rayon", "rustix", + "serde", + "serde_json", "target-lexicon", "tempfile", "test-programs", diff --git a/Cargo.toml b/Cargo.toml index e70b03402..3751...
3
134
41
8035945502c348d26fd95b77542687d435bfdd85
Timothy Chen
2022-12-11T23:32:30
Reduce sig data size by changing sized spaces (#5402) * Reduce sig sizes * Fix test * Change compute_args_loc to return u32
diff --git a/cranelift/codegen/src/isa/aarch64/abi.rs b/cranelift/codegen/src/isa/aarch64/abi.rs index dedff9cf2..180fd22f2 100644 --- a/cranelift/codegen/src/isa/aarch64/abi.rs +++ b/cranelift/codegen/src/isa/aarch64/abi.rs @@ -29,7 +29,7 @@ pub(crate) type AArch64Caller = Caller<AArch64MachineDeps>; /// This is the ...
5
43
41
57b934c66395fcc7441eae9c4bd5b75e6b68a023
Alex Crichton
2022-12-08T21:16:18
Fix prints in non-command builds (#19) * Fix prints in non-command builds When the `command` entrypoint isn't invoked, such as for non-command builds, then prints were not working as they would return `ERRNO_BADF` which is swallowed by at least Rust right now. This instead sets the initialization of `State` to r...
diff --git a/src/lib.rs b/src/lib.rs index 01c530823..42154852f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,15 +39,21 @@ pub unsafe extern "C" fn command( unreachable(); } State::with_mut(|state| { - state.push_desc(Descriptor::File(File { + // Initialization of `State` automaticall...
1
97
43
f7a0986ae82dacfd788a9a367ee5286541643fd2
Dan Gohman
2022-12-08T00:06:13
Update directory iteration APIs. This pulls in https://github.com/WebAssembly/wasi-filesystem/pull/72.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index 64308550b..d7c1b62a5 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -85,8 +85,14 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { fn readdir( &mut self, fd: wasi_filesystem::Descriptor, - rewind: b...
1
8
2
6f0e31c2e3a6c4e325b64fa2d01ec5813cf38353
Dan Gohman
2022-12-07T23:52:52
Add a `badf` error code. This pulls in https://github.com/WebAssembly/wasi-filesystem/pull/62.
diff --git a/src/lib.rs b/src/lib.rs index 24c1d3729..01c530823 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1429,6 +1429,7 @@ impl From<wasi_filesystem::Errno> for Errno { wasi_filesystem::Errno::Again => ERRNO_AGAIN, wasi_filesystem::Errno::Already => ERRNO_ALREADY, wasi_filesys...
1
1
0
875f646cafdb1c3481bbf9520feb7ceb314ebac2
Dan Gohman
2022-12-08T00:05:47
Add file locking APIs. This pulls in https://github.com/WebAssembly/wasi-filesystem/pull/69.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index e77541bb0..64308550b 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -233,4 +233,39 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { ) -> HostResult<(), wasi_filesystem::Errno> { todo!() } + + fn lock_share...
1
35
0
06a94f4c94d184242ec628a159bbfc0076e054c6
Dan Gohman
2022-12-07T23:53:33
Remove the `allocate` function. This pulls in https://github.com/WebAssembly/wasi-filesystem/pull/64.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index 6acfdf64c..e77541bb0 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -14,15 +14,6 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { todo!() } - fn fallocate( - &mut self, - fd: wasi_filesystem::De...
1
0
9
0456c1d2131e53f4b00542548bb061b11d62f1f0
Jamey Sharp
2022-12-08T02:26:51
cranelift-isle: Factor constraint/binding relation (#5383) It turns out that during codegen I'll want to know which bindings were added for a particular constraint. Factoring that out and making sure to use it everywhere that constraints and bindings are created ensures that these will always stay in sync. It also ...
diff --git a/cranelift/isle/isle/src/trie_again.rs b/cranelift/isle/isle/src/trie_again.rs index 4b02159bc..c60af5d2e 100644 --- a/cranelift/isle/isle/src/trie_again.rs +++ b/cranelift/isle/isle/src/trie_again.rs @@ -188,6 +188,27 @@ pub fn build(termenv: &sema::TermEnv) -> (Vec<(sema::TermId, RuleSet)>, Vec<Erro ...
1
82
98
91fff49f0f706c4d8b38d5b647fe265e9e2901c8
Dan Gohman
2022-12-07T23:45:11
Implement `path_open`. (#18) * Implement `path_open`. * Implement `fd_close`, and finish `path_open`. * Stub out `close` in the host impl.
diff --git a/src/lib.rs b/src/lib.rs index 571b627aa..24c1d3729 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,6 +82,14 @@ fn unwrap<T>(maybe: Option<T>) -> T { } } +fn unwrap_result<T, E>(result: Result<T, E>) -> T { + if let Ok(value) = result { + value + } else { + unreachable() + } +...
1
136
11
abe30a73d47e7307fceafb0cdee5859ada806255
Dan Gohman
2022-12-07T23:45:11
Implement `path_open`. (#18) * Implement `path_open`. * Implement `fd_close`, and finish `path_open`. * Stub out `close` in the host impl.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index d4f9dfb93..6acfdf64c 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -176,6 +176,10 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { todo!() } + fn close(&mut self, fd: wasi_filesystem::Descriptor) -> anyhow::...
1
4
0
3477cd02856ae3720202efccf93cb2dc75634ab9
Alex Crichton
2022-12-07T02:20:25
Update a few aspects of the adapter build (#17) * Update a few aspects of the adapter build * Use the `wasm32-unknown-unknown` target for the adapter and specify flags in `.cargo/config.toml` to avoid having to pass the same flags everywhere. This allows using `wasm32-wasi` for tests to ensure the flags on...
diff --git a/src/lib.rs b/src/lib.rs index 549bc40e0..571b627aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,13 +25,19 @@ mod bindings { }); } -#[export_name = "command"] -unsafe extern "C" fn command_entrypoint( +#[no_mangle] +pub unsafe extern "C" fn command( stdin: u32, stdout: u32, args_pt...
1
9
3
006f8657af6e8310123db5c22b5f2de62974c991
Alex Crichton
2022-12-07T02:20:25
Update a few aspects of the adapter build (#17) * Update a few aspects of the adapter build * Use the `wasm32-unknown-unknown` target for the adapter and specify flags in `.cargo/config.toml` to avoid having to pass the same flags everywhere. This allows using `wasm32-wasi` for tests to ensure the flags on...
diff --git a/test-programs/macros/build.rs b/test-programs/macros/build.rs index 86ebb60c8..adc55ce93 100644 --- a/test-programs/macros/build.rs +++ b/test-programs/macros/build.rs @@ -14,17 +14,14 @@ fn main() { cmd.arg("build") .arg("--release") .current_dir("../../") - .arg("--target=wa...
1
3
6
0eb22429d12b4d2bf7b6e1848828d4254e1e6dca
Chris Fallin
2022-12-07T00:47:58
Fuzzing: add `use_egraphs` option back to fuzzing config generator. (#5388) This PR reverts #5128 (commit b3333bf9ea465a708b1504c10122d1626e13d5a9), adding back the ability for the fuzzing config generator to set the `use_egraphs` Cranelift option. This will start to fuzz the egraphs-based optimization framework ag...
diff --git a/cranelift/fuzzgen/src/lib.rs b/cranelift/fuzzgen/src/lib.rs index d7df6df08..423d1cbdf 100644 --- a/cranelift/fuzzgen/src/lib.rs +++ b/cranelift/fuzzgen/src/lib.rs @@ -253,6 +253,7 @@ where "enable_incremental_compilation_cache_checks", "regalloc_checker", "enable_llv...
2
3
0
08d44e37462316d9b2bce59957ececce89a0969d
Alex Crichton
2022-12-06T20:29:13
Change how wasm DWARF is inserted into artifacts (#5358) This commit fixes a bug with components by changing how DWARF information from a wasm binary is copied over to the final compiled artifact. Note that this is not the Wasmtime-generated DWARF but rather the native wasm DWARF itself used in backtraces. Previ...
diff --git a/crates/environ/src/obj.rs b/crates/environ/src/obj.rs index 526ef8b7d..9da43ef08 100644 --- a/crates/environ/src/obj.rs +++ b/crates/environ/src/obj.rs @@ -119,3 +119,12 @@ pub const ELF_WASMTIME_INFO: &'static str = ".wasmtime.info"; /// sometimes quite large (3MB seen for spidermonkey-compiled-to-wasm),...
3
65
68
51b6a0436cb4ab44c9c9b5bd93cda8da0049b3d9
Rainy Sinclair
2022-12-06T20:18:57
Run differential fuzzing in non-trapping mode 90% of the time (#5385)
diff --git a/crates/fuzzing/src/generators/module.rs b/crates/fuzzing/src/generators/module.rs index a33feb1db..7ff78c2b7 100644 --- a/crates/fuzzing/src/generators/module.rs +++ b/crates/fuzzing/src/generators/module.rs @@ -39,6 +39,10 @@ impl<'a> Arbitrary<'a> for ModuleConfig { // https://github.com/bytecod...
1
4
0
feaa7ca75f0782a3dbb2fbbbdff48b3a5fa5d7f9
Chris Fallin
2022-12-06T18:30:02
Alias analysis: refactor for use by other driver loops. (#5380) * Alias analysis: refactor for use by other driver loops. This PR pulls the core of the alias analysis infrastructure into a `process_inst()` method that operates on a single instruction, and allows another compiler pass to apply store-to-load forwar...
diff --git a/cranelift/codegen/src/alias_analysis.rs b/cranelift/codegen/src/alias_analysis.rs index 2e2087b06..f2c1e6e08 100644 --- a/cranelift/codegen/src/alias_analysis.rs +++ b/cranelift/codegen/src/alias_analysis.rs @@ -76,7 +76,7 @@ use cranelift_entity::{packed_option::PackedOption, EntityRef}; /// For a given ...
2
135
117
20bccd27cbce8227c771991e91baad586abb479b
Joel Dice
2022-12-06T18:08:54
sketch of `poll_oneoff` polyfill (#11) This adds a `poll_oneoff` implementation to src/lib.rs. It's completely untested. I was planning on adding a host implementation and using that to test end-to-end, but that raised some tough questions about how much of the existing `wasi-common` scheduler(s) should be reused...
diff --git a/src/lib.rs b/src/lib.rs index 98f299372..549bc40e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,14 +1,17 @@ #![allow(unused_variables)] // TODO: remove this when more things are implemented use crate::bindings::{ - wasi_clocks, wasi_default_clocks, wasi_filesystem, wasi_logging, wasi_random, + ...
1
226
8
069ddb94780524a93cb1228752bf72e1c1e9aad5
Joel Dice
2022-12-06T18:08:54
sketch of `poll_oneoff` polyfill (#11) This adds a `poll_oneoff` implementation to src/lib.rs. It's completely untested. I was planning on adding a host implementation and using that to test end-to-end, but that raised some tough questions about how much of the existing `wasi-common` scheduler(s) should be reused...
diff --git a/host/src/clocks.rs b/host/src/clocks.rs index 5fb0022fd..bdbbc6288 100644 --- a/host/src/clocks.rs +++ b/host/src/clocks.rs @@ -66,6 +66,24 @@ impl wasi_default_clocks::WasiDefaultClocks for WasiCtx { } impl wasi_clocks::WasiClocks for WasiCtx { + fn subscribe_wall_clock( + &mut self, + ...
4
56
48
4a0cefb1aacb001bbd9dc9c61309c5edbace79dc
Alex Crichton
2022-12-06T17:41:32
Fix a fuzz failure due to changing errors (#5384) Fix the `instantiate-many` fuzzer from a recent regression introduced in #5347 where an error message changed slightly. Ideally a concrete error type would be tested for here but that's deferred to a future PR.
diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index a0628abf3..37f389252 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -315,7 +315,7 @@ pub fn instantiate_with_dummy(store: &mut Store<StoreLimits>, module: &Module) - } // Also allow failures t...
1
1
1
28cfa575339f8ad1552af254077a1fde1962d750
Saúl Cabrera
2022-12-06T00:46:58
cranelift: Small documentation fixes (#5377) * `translate_operator` doesn't return a boolean. * `from_base_offset` doesn't panic if offset is smaller than base.
diff --git a/cranelift/codegen/src/ir/sourceloc.rs b/cranelift/codegen/src/ir/sourceloc.rs index 21f7da5ab..53331ee8c 100644 --- a/cranelift/codegen/src/ir/sourceloc.rs +++ b/cranelift/codegen/src/ir/sourceloc.rs @@ -63,10 +63,6 @@ impl RelSourceLoc { } /// Creates a new `RelSourceLoc` based on the given ba...
2
1
6
29d4d1063f8a1ac9e4ea03dcc7cd12f004bc7254
Anton Romanov
2022-12-05T16:19:32
[codegen] Fixed mutability of domtree reference (#5371)
diff --git a/cranelift/codegen/src/dce.rs b/cranelift/codegen/src/dce.rs index e3e855806..f2850a8a1 100644 --- a/cranelift/codegen/src/dce.rs +++ b/cranelift/codegen/src/dce.rs @@ -11,7 +11,7 @@ use crate::ir::Function; use crate::timing; /// Perform DCE on `func`. -pub fn do_dce(func: &mut Function, domtree: &mut ...
1
1
1
03715dda9d536cc8f81d4ed9d5d152139fcd2eb0
Alex Crichton
2022-12-01T22:22:08
Tidy up some internals of instance allocation (#5346) * Simplify the `ModuleRuntimeInfo` trait slightly Fold two functions into one as they're only called from one location anyway. * Remove ModuleRuntimeInfo::signature This is redundant as the array mapping is already stored within the `VMContext` so that c...
diff --git a/crates/environ/src/vmoffsets.rs b/crates/environ/src/vmoffsets.rs index de131eab4..520787010 100644 --- a/crates/environ/src/vmoffsets.rs +++ b/crates/environ/src/vmoffsets.rs @@ -31,11 +31,6 @@ use cranelift_entity::packed_option::ReservedValue; use std::convert::TryFrom; use wasmtime_types::OwnedMemory...
14
142
176
ed6769084b057e56fbf5974e0ef82509c5ec307f
Alex Crichton
2022-12-01T22:19:07
Add a `WasmBacktrace::new()` constructor (#5341) * Add a `WasmBacktrace::new()` constructor This commit adds a method of manually capturing a backtrace of WebAssembly frames within a `Store`. The new constructor can be called with any `AsContext` values, primarily `&Store` and `&Caller`, during host functions to...
diff --git a/crates/runtime/src/traphandlers/backtrace.rs b/crates/runtime/src/traphandlers/backtrace.rs index b18d8b96c..0efed892b 100644 --- a/crates/runtime/src/traphandlers/backtrace.rs +++ b/crates/runtime/src/traphandlers/backtrace.rs @@ -74,6 +74,11 @@ impl Frame { } impl Backtrace { + /// Returns an empt...
3
141
3
213c256bd9153cc256e67f81889a2fcc4b20bff6
Alex Crichton
2022-12-01T21:12:46
Upload a release artifact from CI (#15) This updates CI to upload a `wasi_snapshot_preview1.wasm` release artifact from CI. One is stored per CI job in case it needs to be inspected, and additionally a github action is used to maintain a "latest" release for pushes to `main` to ensure that the latest copy of `wasi...
diff --git a/test-programs/macros/build.rs b/test-programs/macros/build.rs index 43ef1f056..86ebb60c8 100644 --- a/test-programs/macros/build.rs +++ b/test-programs/macros/build.rs @@ -16,7 +16,10 @@ fn main() { .current_dir("../../") .arg("--target=wasm32-wasi") .env("CARGO_TARGET_DIR", &out...
1
4
1
b5411878b7d14e8c8a9b270276b5afeae68d2c38
Alex Crichton
2022-12-01T21:03:56
Implement `args_{get,sizes_get}` functions (#16) This commit updates the implementation of `cabi_export_realloc` to allocate from a bump-allocated-region in `State` rather than allocating a separate page for each argument as previously done. Additionally the argument data is now stored within `State` as well enabli...
diff --git a/src/lib.rs b/src/lib.rs index 746b7450d..98f299372 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,17 +23,23 @@ mod bindings { } #[export_name = "command"] -unsafe extern "C" fn command_entrypoint(stdin: i32, stdout: i32, _args_ptr: i32, _args_len: i32) { +unsafe extern "C" fn command_entrypoint( + ...
1
124
34
43dfe3bcbf2eac194ed9d1ff52f6b58dd8bfc70b
Alex Crichton
2022-12-01T21:03:56
Implement `args_{get,sizes_get}` functions (#16) This commit updates the implementation of `cabi_export_realloc` to allocate from a bump-allocated-region in `State` rather than allocating a separate page for each argument as previously done. Additionally the argument data is now stored within `State` as well enabli...
diff --git a/host/tests/runtime.rs b/host/tests/runtime.rs index db8bdf199..b3bea097b 100644 --- a/host/tests/runtime.rs +++ b/host/tests/runtime.rs @@ -55,3 +55,13 @@ fn run_panic(mut store: Store<WasiCtx>, wasi: Wasi) -> Result<()> { println!("{:?}", r); Ok(()) } + +fn run_args(mut store: Store<WasiCtx>, w...
2
17
0
e0b9663e4489bbdf48f3887274a0b179883690f4
Alex Crichton
2022-12-01T20:47:10
Remove some custom error types in Wasmtime (#5347) * Remove some custom error types in Wasmtime These types are mostly cumbersome to work with nowadays that `anyhow` is used everywhere else. This commit removes `InstantiationError` and `SetupError` in favor of using `anyhow::Error` throughout. This can eventuall...
diff --git a/Cargo.lock b/Cargo.lock index 312039a49..a98c6db8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3643,7 +3643,6 @@ dependencies = [ "rustc-demangle", "serde", "target-lexicon", - "thiserror", "wasmtime-environ", "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", @@ -3687,7 +3686,6 @@ depende...
13
131
268
2d25a8434754a2294a9cffdc1cf712799b7d18c7
Alex Crichton
2022-12-01T20:19:52
Simplify global state management in adapter (#13) * Simplify global state management in adapter I was looking recently to implement args-related syscalls but that would require yet-more globals and yet-more state to be managed. Instead of adding a slew of new globals for this which are all manually kept in sync ...
diff --git a/test-programs/macros/build.rs b/test-programs/macros/build.rs index 25061418b..43ef1f056 100644 --- a/test-programs/macros/build.rs +++ b/test-programs/macros/build.rs @@ -9,7 +9,7 @@ fn main() { let mut components = Vec::new(); - println!("cargo:rerun-if-changed=../../"); + println!("cargo:...
1
1
1
1eeec7b698e0ef82914d6824a3e6f0cfe6b59276
Nick Fitzgerald
2022-12-01T19:04:36
cranelift-wasm: Remove `ModuleTranslationState` (#5365) * cranelift-wasm: Remove `ModuleTranslationState` We were putting data into it, but never reading data out of it. Can be removed. * cranelift-wasm: move `funct_state.rs` sub module to `state.rs` Since it is the only submodule of `state` it can just be th...
diff --git a/cranelift/wasm/src/lib.rs b/cranelift/wasm/src/lib.rs index 112159862..b8388848b 100644 --- a/cranelift/wasm/src/lib.rs +++ b/cranelift/wasm/src/lib.rs @@ -61,8 +61,7 @@ pub use crate::environ::{ }; pub use crate::func_translator::FuncTranslator; pub use crate::module_translator::translate_module; -pub ...
6
4
62
ebb693aa18b5ed772e8a85a8c5afeb4b18350f6a
Nam Junghyun
2022-12-01T17:13:39
Move precompiled module detection into wasmtime (#5342) * Treat `-` as an alias to `/dev/stdin` This applies to unix targets only, as Windows does not have an appropriate alternative. * Add tests for piped modules from stdin This applies to unix targets only, as Windows does not have an appropriate alternat...
diff --git a/crates/wasmtime/src/engine.rs b/crates/wasmtime/src/engine.rs index dfb386bf5..9c4a67f25 100644 --- a/crates/wasmtime/src/engine.rs +++ b/crates/wasmtime/src/engine.rs @@ -600,7 +600,7 @@ impl Engine { self.load_code(MmapVec::from_slice(bytes)?, expected) } - /// Like `load_code_bytes`, ...
4
156
54
37c3c5b1e0ca0c9cece48881d71647c1189979f6
Trevor Elliott
2022-12-01T04:37:20
Remove an unnecessary debug trace (#5359)
diff --git a/cranelift/codegen/src/isa/s390x/inst/mod.rs b/cranelift/codegen/src/isa/s390x/inst/mod.rs index ad7c76190..41b34ea87 100644 --- a/cranelift/codegen/src/isa/s390x/inst/mod.rs +++ b/cranelift/codegen/src/isa/s390x/inst/mod.rs @@ -340,7 +340,6 @@ impl Inst { value: u64, mut alloc_tmp: F, ...
1
0
1
c16f2956dbf7983eda85bc9f1900ef1afe717f62
Trevor Elliott
2022-12-01T01:01:14
Allocate a temporary for 64-bit constant loads in the s390x backend (#5357) Avoid reusing a destination virtual register for 64-bit constants in the s390x backend. This change addresses a case identified by the regalloc2 ssa validator, as the destination register was written to twice when constants were generated via ...
diff --git a/cranelift/codegen/src/isa/s390x/inst/emit.rs b/cranelift/codegen/src/isa/s390x/inst/emit.rs index f0cd7b879..eb7c48bc5 100644 --- a/cranelift/codegen/src/isa/s390x/inst/emit.rs +++ b/cranelift/codegen/src/isa/s390x/inst/emit.rs @@ -104,7 +104,7 @@ pub fn mem_finalize( } else { ...
2
14
8
567d941facf6a0f3afb0375b891b3b16ce0dc404
Alex Crichton
2022-12-01T00:03:09
Update Wasmtime/tooling dependencies (#14) This forces all the `*.wit.md` file to go into one large `*.wit` file for now which will get split up later once `use` is re-introduced.
diff --git a/src/lib.rs b/src/lib.rs index 001c24526..0818c5442 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,28 +1,26 @@ #![allow(unused_variables)] // TODO: remove this when more things are implemented -wit_bindgen_guest_rust::generate!({ - import: "wit/wasi-clocks.wit.md", - import: "wit/wasi-default-clock...
1
15
17
c9d42fe6b5b71d72416ea6919347f90590a31c50
Alex Crichton
2022-12-01T00:03:09
Update Wasmtime/tooling dependencies (#14) This forces all the `*.wit.md` file to go into one large `*.wit` file for now which will get split up later once `use` is re-introduced.
diff --git a/host/src/lib.rs b/host/src/lib.rs index ddde706bc..9ce86fd06 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -7,14 +7,7 @@ mod table; pub use table::Table; wit_bindgen_host_wasmtime_rust::generate!({ - import: "../wit/wasi-clocks.wit.md", - import: "../wit/wasi-default-clocks.wit.md", - ...
3
4
10
0e65f87e379315f1ed419aeafddba68e800ad5f9
Jamey Sharp
2022-11-30T23:06:00
cranelift-isle: Reject unreachable rules (#5322) Some of our ISLE rules can never fire because there's a higher-priority rule that will always fire instead. Sometimes the worst that can happen is we generate sub-optimal output. That's not so bad but we'd still like to know about it so we can fix it. In other c...
diff --git a/cranelift/isle/isle/src/error.rs b/cranelift/isle/isle/src/error.rs index d919e36d1..999821edd 100644 --- a/cranelift/isle/isle/src/error.rs +++ b/cranelift/isle/isle/src/error.rs @@ -24,6 +24,9 @@ impl std::fmt::Debug for Errors { Error::TypeError { msg, .. } => format!("type error: {}", ...
4
73
5
d8dbabfe6b6c8bc41f3406fa58f927f8d21f2f29
Trevor Elliott
2022-11-30T22:44:59
Don't reuse registers in the x64 div lowering (#5356) Introduce a temporary for an intermediate value in the lowering of div in the x64 backend. Additionally, add a src argument to the shift_r smart constructor, which is why the diff got larger than just the div lowering.
diff --git a/cranelift/codegen/src/isa/x64/inst/emit.rs b/cranelift/codegen/src/isa/x64/inst/emit.rs index 73e25ca47..6c22bb045 100644 --- a/cranelift/codegen/src/isa/x64/inst/emit.rs +++ b/cranelift/codegen/src/isa/x64/inst/emit.rs @@ -2344,6 +2344,7 @@ pub(crate) fn emit( OperandSize::Size64, ...
4
37
6
acf9dc2ee99abff22739de778ce1ab04ac3454d5
Alex Crichton
2022-11-30T19:44:22
Implement `clock_{time,res}_get` (#12) Currently traps for the `*_CPUTIME_*` clocks and doesn't check for overflow on nanoseconds.
diff --git a/src/lib.rs b/src/lib.rs index 795ef89e1..001c24526 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -171,8 +171,21 @@ pub unsafe extern "C" fn environ_sizes_get( /// return `errno::inval`. /// Note: This is similar to `clock_getres` in POSIX. #[no_mangle] -pub unsafe extern "C" fn clock_res_get(id: Clockid, ...
1
29
5
8bc75502112d05e2f16e0714e59ae3cb4bd9c43c
Peter Huene
2022-11-30T15:57:53
wasmtime: enable stack probing for x86_64 targets. (#5350) * wasmtime: enable stack probing for x86_64 targets. This commit unconditionally enables stack probing for x86_64 targets. On Windows, stack probing is always required because of the way Windows commits stack pages (via guard page access). Fixes #534...
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index cc345bc7f..ed9c4f3dd 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -191,6 +191,7 @@ impl Config { ret.cranelift_debug_verifier(false); ret.cranelift_opt_level(OptLevel::Speed); ...
3
67
4
67fc5389b00720d93daf16a3fbf78acbb24f8681
Timothy Chen
2022-11-30T15:19:41
Remove sig data arg and ret fields to reduce size (#5319) * Remove sig data arg and ret fields to reduce size * Update cranelift/codegen/src/machinst/abi.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> * Update cranelift/codegen/src/machinst/abi.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> * Fi...
diff --git a/cranelift/codegen/src/isa/s390x/lower/isle.rs b/cranelift/codegen/src/isa/s390x/lower/isle.rs index 1f6f5ce9a..3f142aa0a 100644 --- a/cranelift/codegen/src/isa/s390x/lower/isle.rs +++ b/cranelift/codegen/src/isa/s390x/lower/isle.rs @@ -126,7 +126,7 @@ impl generated_code::Context for IsleContext<'_, '_, MI...
3
66
59
2bb1fb08fa4220f2bcfe295ec417478b4ec7efa8
Benjamin Bouvier
2022-11-30T15:15:34
Flush icache on android aarch64 too (#5331)
diff --git a/crates/jit-icache-coherence/Cargo.toml b/crates/jit-icache-coherence/Cargo.toml index a2b8e3d25..c1f6ee1fe 100644 --- a/crates/jit-icache-coherence/Cargo.toml +++ b/crates/jit-icache-coherence/Cargo.toml @@ -19,5 +19,5 @@ features = [ "Win32_System_Diagnostics_Debug", ] -[target.'cfg(any(target_os ...
2
85
65
86acb9a4386229660ab49391badcd333a5311a14
Alex Crichton
2022-11-29T22:32:56
Use workspace inheritance for some more dependencies (#5349) Deduplicate some dependency directives through `[workspace.dependencies]`
diff --git a/Cargo.toml b/Cargo.toml index e42e094ae..c3cbe1ef9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ wast = { workspace = true } criterion = "0.3.4" num_cpus = "1.13.0" memchr = "2.4" -async-trait = "0.1" +async-trait = { workspace = true } wat = { workspace = true } rayon = "1.5.0" wasmtime...
16
32
26
3b76874834abb56fac91ca3b5af362b73c68b929
Jamey Sharp
2022-11-29T19:02:12
cranelift-isle: Fix representation for overlap checks (#5337) Ulrich Weigand identified two bugs in this code due to it falsely claiming there were unreachable rules in the s390x backend. The fixes are: - Add constraints for pure constructors. I didn't notice that a constructor which is declared pure (which c...
diff --git a/cranelift/isle/isle/src/trie_again.rs b/cranelift/isle/isle/src/trie_again.rs index b0af04e92..ff046ece3 100644 --- a/cranelift/isle/isle/src/trie_again.rs +++ b/cranelift/isle/isle/src/trie_again.rs @@ -212,9 +212,9 @@ impl Rule { // For the purpose of overlap checking, equality constraints act l...
1
43
6
4312cabc4ba711985b441366c85f842177789fdf
Jimmy Bourassa
2022-11-29T17:08:52
Fuel documentation fixes (#5343) - `Store::add_fuel` documentation said it'd panic when the engine is not configured to have fuel, but it in fact returns an error[1]. - There was a typo in `Store::add_fuel`'s documentation (either either). I "fixed" the typo by rewording the section using the same wording ...
diff --git a/crates/wasmtime/src/store.rs b/crates/wasmtime/src/store.rs index ae0753ad3..92ed27086 100644 --- a/crates/wasmtime/src/store.rs +++ b/crates/wasmtime/src/store.rs @@ -766,10 +766,10 @@ impl<T> Store<T> { /// Note that at this time when fuel is entirely consumed it will cause /// wasm to trap. Mo...
1
6
6
a5a0645aff478b23f3f02aedde53c9903f0349f7
Trevor Elliott
2022-11-29T01:52:11
Don't allow reuse_def constraints in the s390x Loop instruction (#5336)
diff --git a/cranelift/codegen/src/isa/s390x/inst/mod.rs b/cranelift/codegen/src/isa/s390x/inst/mod.rs index 6ca7adadc..5caf862c1 100644 --- a/cranelift/codegen/src/isa/s390x/inst/mod.rs +++ b/cranelift/codegen/src/isa/s390x/inst/mod.rs @@ -1068,6 +1068,12 @@ fn s390x_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, coll...
2
17
1
a631f98af0308fd9d6a9cc9accc9d98ae63adca2
Dan Gohman
2022-11-23T23:37:27
Implement `fd_fdstat_get` and `fd_fdstat_set_flags`. This incoporates several wasi-filesystem repo changes too.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index dbf889e67..d4f9dfb93 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -30,10 +30,25 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { todo!() } - fn info( + fn flags( &mut self, fd: wasi_fil...
1
26
4
87854bbb43a43891c0e4a8903f3174a9ca3cc813
Dan Gohman
2022-11-23T23:37:27
Implement `fd_fdstat_get` and `fd_fdstat_set_flags`. This incoporates several wasi-filesystem repo changes too.
diff --git a/src/lib.rs b/src/lib.rs index 0adf33a78..795ef89e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -248,43 +248,47 @@ pub unsafe extern "C" fn fd_datasync(fd: Fd) -> Errno { pub unsafe extern "C" fn fd_fdstat_get(fd: Fd, stat: *mut Fdstat) -> Errno { match Descriptor::get(fd) { Descriptor::File(...
1
87
27
58a5089e489f24cfa5a223b3e027797ef93f67c8
Nick Fitzgerald
2022-11-28T19:35:29
Cranelift: log number of CLIF insts/blocks to optimize/lower (#5333)
diff --git a/cranelift/codegen/src/context.rs b/cranelift/codegen/src/context.rs index 01724612f..f7817a967 100644 --- a/cranelift/codegen/src/context.rs +++ b/cranelift/codegen/src/context.rs @@ -148,8 +148,17 @@ impl Context { /// /// Public only for testing purposes. pub fn optimize(&mut self, isa: &d...
2
16
1
6fe69d00ca8d1760584cf55723fc65b6e9464ab6
Nick Fitzgerald
2022-11-28T18:57:02
Cranelift: add debug logs counting how many vcode instructions and blocks we lower to (#5332)
diff --git a/cranelift/codegen/src/machinst/compile.rs b/cranelift/codegen/src/machinst/compile.rs index bf773eb30..2f103df1a 100644 --- a/cranelift/codegen/src/machinst/compile.rs +++ b/cranelift/codegen/src/machinst/compile.rs @@ -39,6 +39,11 @@ pub fn compile<B: LowerBackend + TargetIsa>( lower.lower(b)? ...
2
10
0
54a6d2f79a5481bbdc378b7bbe061f5adab912e6
Trevor Elliott
2022-11-28T18:31:56
Generate more fixed_nonallocatable constraints, and add debug assertions (#5132) Add assertions to the OperandCollector that show we're not using pinned vregs, and use reg_fixed_nonallocatable constraints when a real register is used with other constraint generation functions like reg_use etc.
diff --git a/cranelift/codegen/src/machinst/reg.rs b/cranelift/codegen/src/machinst/reg.rs index a23ddceca..22249fffa 100644 --- a/cranelift/codegen/src/machinst/reg.rs +++ b/cranelift/codegen/src/machinst/reg.rs @@ -358,12 +358,22 @@ impl<'a, F: Fn(VReg) -> VReg> OperandCollector<'a, F> { /// Add a register use, ...
1
38
11
951bdcb2cfcaa1b7007881ef611b3ddc98fb8757
Alex Crichton
2022-11-28T14:58:02
Clear affine slots when dropping a `Module` (#5321) * Clear affine slots when dropping a `Module` This commit implements a resource usage optimization for Wasmtime with the pooling instance allocator by ensuring that when a `Module` is dropped its backing virtual memory mappings are all removed. Currently when a...
diff --git a/crates/runtime/src/cow.rs b/crates/runtime/src/cow.rs index 3542c4855..d083e4d97 100644 --- a/crates/runtime/src/cow.rs +++ b/crates/runtime/src/cow.rs @@ -499,14 +499,8 @@ impl MemoryImageSlot { // extent of the prior initialization image in order to preserve // resident memory that migh...
5
288
223
240ff2b854bd72006d8094a1626fa62d7740ad1b
Afonso Bordado
2022-11-28T01:18:28
wasmtime: Add libc as a dependency on FreeBSD in the `jit-icache-coherence` crate (#5323) This gets this package to build for `x86_64`, but does not include any cache clearing for `aarch64-freebsd`. Which will probably build, but not work. As far as I can tell membarriers are still in the process of being added. ...
diff --git a/crates/jit-icache-coherence/Cargo.toml b/crates/jit-icache-coherence/Cargo.toml index 30a196599..a2b8e3d25 100644 --- a/crates/jit-icache-coherence/Cargo.toml +++ b/crates/jit-icache-coherence/Cargo.toml @@ -19,5 +19,5 @@ features = [ "Win32_System_Diagnostics_Debug", ] -[target.'cfg(any(target_os ...
1
1
1
28cf995fd3f9926a95036758c78390f54a0289ae
Rodrigo Batista de Moraes
2022-11-23T23:41:52
cranelift-frontend: make `FunctionBuilder::finalize` consume self (#5316)
diff --git a/cranelift/frontend/src/frontend.rs b/cranelift/frontend/src/frontend.rs index 0eb9b606b..89949c679 100644 --- a/cranelift/frontend/src/frontend.rs +++ b/cranelift/frontend/src/frontend.rs @@ -596,10 +596,11 @@ impl<'a> FunctionBuilder<'a> { } } - /// Declare that translation of the curre...
3
29
31
caa21b2cfa9e79f97279d6a46d8bceaa6ad6b6c4
Dan Gohman
2022-11-23T19:05:49
Swap `info` and `fd-info` See the last commit in https://github.com/WebAssembly/wasi-filesystem/pull/66 for details.
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index 52b48ad51..dbf889e67 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -30,10 +30,10 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { todo!() } - fn fd_info( + fn info( &mut self, fd: wasi_f...
1
2
2
28cb8bd9325811f07dd992bb5de70f3e430fbd22
Dan Gohman
2022-11-23T19:05:49
Swap `info` and `fd-info` See the last commit in https://github.com/WebAssembly/wasi-filesystem/pull/66 for details.
diff --git a/src/lib.rs b/src/lib.rs index 0b698df53..0adf33a78 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -248,7 +248,7 @@ pub unsafe extern "C" fn fd_datasync(fd: Fd) -> Errno { pub unsafe extern "C" fn fd_fdstat_get(fd: Fd, stat: *mut Fdstat) -> Errno { match Descriptor::get(fd) { Descriptor::File(fi...
1
1
1
be17956d8bdd8b4ef5de5548cf91b49de9e80374
Dan Gohman
2022-11-23T18:00:54
Implement path_rename, path_symlink, and path_unlink_file.
diff --git a/src/lib.rs b/src/lib.rs index efefd98fc..0b698df53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -945,14 +945,26 @@ pub unsafe extern "C" fn path_remove_directory( /// Note: This is similar to `renameat` in POSIX. #[no_mangle] pub unsafe extern "C" fn path_rename( - fd: Fd, + old_fd: Fd, old_pa...
1
35
4
4a102a2bf78b879b32dea65dbb9a5cfe2504bc79
Dan Gohman
2022-11-23T17:43:40
Implement path_create_directory, path_filestat_get, path_link.
diff --git a/src/lib.rs b/src/lib.rs index d9e7cadb3..efefd98fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -686,7 +686,16 @@ pub unsafe extern "C" fn path_create_directory( path_ptr: *const u8, path_len: usize, ) -> Errno { - unreachable() + let path = slice::from_raw_parts(path_ptr, path_len); + + ...
1
62
5
41b94d53694af2f4a8e16d594ecb23ccf200bdc4
Dan Gohman
2022-11-22T23:41:49
Implement fd_filestat_set_size, fd_pread, and fd_pwrite.
diff --git a/src/lib.rs b/src/lib.rs index a2466bf0b..d9e7cadb3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -342,7 +342,14 @@ pub unsafe extern "C" fn fd_filestat_get(fd: Fd, buf: *mut Filestat) -> Errno { /// Note: This is similar to `ftruncate` in POSIX. #[no_mangle] pub unsafe extern "C" fn fd_filestat_set_size(f...
1
79
7
4974e79fd74070f4db376650fb1ef92a1d1d2697
Dan Gohman
2022-11-22T23:20:09
Implement polyfills for several wasi-filesystem functions Implement fd_advise, fd_filestat_set_times, path_filestat_set_times, and path_remove_directory.
diff --git a/src/lib.rs b/src/lib.rs index 80a0ed152..a2466bf0b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,7 +195,23 @@ pub unsafe extern "C" fn fd_advise( len: Filesize, advice: Advice, ) -> Errno { - unreachable() + let advice = match advice { + ADVICE_NORMAL => wasi_filesystem::Advice::...
1
89
4
c18bdcb74a4c896fd4aa41778d4b738c81cc9f3c
Dan Gohman
2022-11-23T17:42:06
Change the `len` parameter of `fadvise` to `filesize`. (#7) * Change the `len` parameter of `fadvise` to `filesize`. Fadvise can apply to regions of files larger than the linear memory address space, so it wants a `filesize` (which is u64) rather than a `size` (which is u32 on wasm32). * Update the host implem...
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index 1bbc5a582..52b48ad51 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -8,7 +8,7 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { &mut self, fd: wasi_filesystem::Descriptor, offset: wasi_filesystem::File...
1
1
1
48ee42efc29529306264f167fb459a0417af1f70
Timothy Chen
2022-11-22T17:03:51
Refactor Sigdata methods with sigset (#5307) * Refactor sigdata methods * Update cranelift/codegen/src/machinst/abi.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> * Address comments Co-authored-by: Jamey Sharp <jamey@minilop.net>
diff --git a/cranelift/codegen/src/isa/s390x/lower/isle.rs b/cranelift/codegen/src/isa/s390x/lower/isle.rs index 44ec3994b..1f6f5ce9a 100644 --- a/cranelift/codegen/src/isa/s390x/lower/isle.rs +++ b/cranelift/codegen/src/isa/s390x/lower/isle.rs @@ -129,7 +129,7 @@ impl generated_code::Context for IsleContext<'_, '_, MI...
3
175
170
6ce2ac19b8ae877ba9730ab948137e2214655c4c
Alex Crichton
2022-11-22T16:51:55
Refactor shared memory internals, expose embedder methods (#5311) This commit refactors the internals of `wasmtime_runtime::SharedMemory` a bit to expose the necessary functions to invoke from the `wasmtime::SharedMemory` layer. Notably some items are moved out of the `RwLock` from prior, such as the type and the `...
diff --git a/crates/runtime/src/instance.rs b/crates/runtime/src/instance.rs index e8d9ed929..9e4f88ecb 100644 --- a/crates/runtime/src/instance.rs +++ b/crates/runtime/src/instance.rs @@ -966,8 +966,8 @@ impl Instance { let def_ptr = self.memories[defined_memory_index] .as_shared_...
9
373
218
8ce98e3c12482a3f004173a38320394ef673190e
Harald Hoyer
2022-11-22T15:36:29
fix: atomit wait does not sleep long enough (#5315) From the documentation of `CondVar::wait_timeout`: > The semantics of this function are equivalent to wait except that the thread > will be blocked for roughly no longer than `dur`. This method should not be > used for precise timing due to anomalies such as pre...
diff --git a/crates/runtime/src/parking_spot.rs b/crates/runtime/src/parking_spot.rs index a958d6d75..3b87bd636 100644 --- a/crates/runtime/src/parking_spot.rs +++ b/crates/runtime/src/parking_spot.rs @@ -115,7 +115,14 @@ impl ParkingSpot { let spot = inner.get_mut(&key).expect("failed to get spot"); -...
1
8
1
7a31c5b07c266dbf95a4d3a4e7fa498acbc5441a
Alex Crichton
2022-11-18T22:04:38
Deduplicate listings of traps in Wasmtime (#5299) This commit replaces `wasmtime_environ::TrapCode` with `wasmtime::Trap`. This is possible with past refactorings which slimmed down the `Trap` definition in the `wasmtime` crate to a simple `enum`. This means that there's one less place that all the various trap opc...
diff --git a/crates/cranelift/src/compiler.rs b/crates/cranelift/src/compiler.rs index 1fa160362..5f6a08bf3 100644 --- a/crates/cranelift/src/compiler.rs +++ b/crates/cranelift/src/compiler.rs @@ -32,7 +32,7 @@ use std::sync::{Arc, Mutex}; use wasmparser::{FuncValidatorAllocations, FunctionBody}; use wasmtime_environ...
14
179
249
9b7c5e316df0b5094db57931075973e5cb21c93a
Alex Crichton
2022-11-18T20:02:14
Test for `Trap::OutOfFuel` instead of strings (#5297) Update a few locations to test for a specific error code
diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 90fa8b6ed..16fc731ae 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -306,13 +306,10 @@ pub fn instantiate_with_dummy(store: &mut Store<StoreLimits>, module: &Module) - } let string = e.to_stri...
2
6
16