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
54207d343e0d1dfdb1cfcb9ddafbd4674eecb431
Jamey Sharp
2022-11-18T19:21:08
cranelift-isle: Specialize for Term at rule root (#5295) In #5174 we decided it doesn't make sense for a rule to have a bind-pattern at the root of its left-hand side. There's no Rust value corresponding to the root value of such a term, because it actually represents a function declaration with one or more argumen...
diff --git a/cranelift/isle/isle/src/ast.rs b/cranelift/isle/isle/src/ast.rs index 1850b5af9..bd967d619 100644 --- a/cranelift/isle/isle/src/ast.rs +++ b/cranelift/isle/isle/src/ast.rs @@ -152,7 +152,6 @@ pub enum Pattern { impl Pattern { pub fn root_term(&self) -> Option<&Ident> { match self { - ...
4
57
108
7e4077805bf2b2edd0493a481c71ea3d136482bd
MediosZ
2022-11-18T04:45:05
doc: add a comment in cancel_during_run. (#5267) Signed-off-by: Tricster <mediosrity@gmail.com> Signed-off-by: Tricster <mediosrity@gmail.com>
diff --git a/tests/all/async_functions.rs b/tests/all/async_functions.rs index 7d8a389b3..f2c5e74ec 100644 --- a/tests/all/async_functions.rs +++ b/tests/all/async_functions.rs @@ -269,6 +269,9 @@ async fn cancel_during_run() { *caller.data_mut() = 1; let dtor = SetOnDrop(caller); ...
1
3
0
9a44ef7443461ac3b1004b95e6c5ef605d2abe16
Jamey Sharp
2022-11-18T00:00:59
cranelift-isle: Unify expressions and bindings (#5294) As it turns out, that distinction was not necessary for this representation. Removing it eliminates some complexity around wrapping expressions as bindings and vice versa. It also clears up some confusion about which category to put certain constructs in (argum...
diff --git a/cranelift/isle/isle/src/trie_again.rs b/cranelift/isle/isle/src/trie_again.rs index 5b32989d5..d83035ead 100644 --- a/cranelift/isle/isle/src/trie_again.rs +++ b/cranelift/isle/isle/src/trie_again.rs @@ -2,7 +2,7 @@ //! to closely reflect the operations we can implement in Rust, to make code generation ea...
1
90
173
3b6544dc66e704a185d7aaf8cc50bcad9d7c7f75
Nick Fitzgerald
2022-11-17T21:13:24
Fix warnings in `cranelift-codegen` docs builds (#5292)
diff --git a/cranelift/codegen/src/bitset.rs b/cranelift/codegen/src/bitset.rs index d271a8661..c09a58777 100644 --- a/cranelift/codegen/src/bitset.rs +++ b/cranelift/codegen/src/bitset.rs @@ -4,7 +4,7 @@ //! T is intended to be a primitive unsigned type. Currently it can be any type between u8 and u32 //! //! If yo...
3
4
4
9bf2a8e663cc4fec84580bc282f1fa0ba8f3bb9a
Alex Crichton
2022-11-17T16:28:11
Remove some dead code in the cranelift-wasm crate (#5290) * Remove some dead code in the cranelift-wasm crate * Remove some more dead code
diff --git a/cranelift/wasm/src/state/module_state.rs b/cranelift/wasm/src/state/module_state.rs index 8b857bf6a..db22d8279 100644 --- a/cranelift/wasm/src/state/module_state.rs +++ b/cranelift/wasm/src/state/module_state.rs @@ -1,8 +1,6 @@ -use crate::{SignatureIndex, WasmError, WasmResult}; -use cranelift_codegen::ir...
2
1
83
de6e4a4e2052bf8743131e2fdf8837ba4c9657ee
Timothy Chen
2022-11-17T00:15:19
Shrink the size of SigData in Cranelift (#5261) * Shrink the size of SigData in Cranelift * Update cranelift/codegen/src/machinst/abi.rs Co-authored-by: Jamey Sharp <jamey@minilop.net> * Change ret arg length to u16 * Add test Co-authored-by: Jamey Sharp <jamey@minilop.net>
diff --git a/cranelift/codegen/src/machinst/abi.rs b/cranelift/codegen/src/machinst/abi.rs index 160281fc1..acfd22f6a 100644 --- a/cranelift/codegen/src/machinst/abi.rs +++ b/cranelift/codegen/src/machinst/abi.rs @@ -119,7 +119,6 @@ use std::collections::HashMap; use std::convert::TryFrom; use std::marker::PhantomDat...
1
56
31
1bd78f1a35c34bc304257b224e8ef8a0cb4cba16
Timothy Chen
2022-11-16T14:56:03
Fix get_typed_fund extra param in benchmark (#5280)
diff --git a/crates/bench-api/src/lib.rs b/crates/bench-api/src/lib.rs index 498236f64..60291d24f 100644 --- a/crates/bench-api/src/lib.rs +++ b/crates/bench-api/src/lib.rs @@ -533,7 +533,7 @@ impl BenchState { .take() .expect("instantiate the module before executing it"); - let start...
1
1
1
a007e02bd2467195259bea73e8c3a243de071afb
Trevor Elliott
2022-11-15T20:49:17
Add fixed_nonallocatable constraints when appropriate (#5253) Plumb the set of allocatable registers through the OperandCollector and use it validate uses of fixed-nonallocatable registers, like %rsp on x86_64.
diff --git a/cranelift/codegen/src/isa/aarch64/inst/emit.rs b/cranelift/codegen/src/isa/aarch64/inst/emit.rs index 0784cdeb0..d2277b4ba 100644 --- a/cranelift/codegen/src/isa/aarch64/inst/emit.rs +++ b/cranelift/codegen/src/isa/aarch64/inst/emit.rs @@ -1369,6 +1369,7 @@ impl MachInstEmit for Inst { } ...
13
133
66
d335dc8d5ac23d97c2707aa838420fddb8bd7538
Nick Fitzgerald
2022-11-15T19:54:52
Cranelift: Do not optimize heap bounds checking comparison in legalization (#5272) That optimization is only for 12-bit immediates in Aarch64, which is now handled in backend lowering, so we can simplify this code a bit now.
diff --git a/cranelift/codegen/src/legalizer/heap.rs b/cranelift/codegen/src/legalizer/heap.rs index 96e905b3f..46284e973 100644 --- a/cranelift/codegen/src/legalizer/heap.rs +++ b/cranelift/codegen/src/legalizer/heap.rs @@ -189,37 +189,22 @@ fn static_addr( let mut spectre_oob_comparison = None; let index = ...
1
8
23
df1d679d2ffe878841dee0c94dc348a1a306c790
Andrew Brown
2022-11-15T19:04:42
wiggle: allow wiggle to use shared memory (#5054) `wiggle` looks for an exported `Memory` named `"memory"` to use for its guest slices. This change allows it to use a `SharedMemory` if this is the kind of memory used for the export. It is `unsafe` to use shared memory in Wiggle because of broken Rust guarantees:...
diff --git a/crates/wiggle/generate/src/wasmtime.rs b/crates/wiggle/generate/src/wasmtime.rs index 50ece4820..98c9f342c 100644 --- a/crates/wiggle/generate/src/wasmtime.rs +++ b/crates/wiggle/generate/src/wasmtime.rs @@ -112,13 +112,19 @@ fn generate_func( }; let body = quote! { - let mem = match cal...
1
11
5
6dcdabf37eebce01a99444e9e9d30afe110e5696
Alex Crichton
2022-11-15T17:11:47
wiggle: Refactor with fewer raw pointers (#5268) This commit refactors the internals of `wiggle` to have fewer raw pointers and more liberally use `&[UnsafeCell<_>]`. The purpose of this refactoring is to more strictly thread through lifetime information throughout the crate to avoid getting it wrong. Additionally sto...
diff --git a/crates/wiggle/generate/src/types/flags.rs b/crates/wiggle/generate/src/types/flags.rs index 6082ed5f7..34e35eeb2 100644 --- a/crates/wiggle/generate/src/types/flags.rs +++ b/crates/wiggle/generate/src/types/flags.rs @@ -87,15 +87,5 @@ pub(super) fn define_flags( #repr::write(&location.cast...
8
189
268
060f12571d8dace36dffa1e6726bdd2f2d28ce4e
Andrew Brown
2022-11-14T22:33:24
wiggle: adapt Wiggle strings for shared use (#5264) * wiggle: adapt Wiggle strings for shared use This is an extension of #5229 for the `&str` and `&mut str` types. As documented there, we are attempting to maintain Rust guarantees for slices that Wiggle hands out in the presence of WebAssembly shared memory, in...
diff --git a/crates/wasi-common/src/snapshots/preview_1.rs b/crates/wasi-common/src/snapshots/preview_1.rs index 670780673..cdc4df406 100644 --- a/crates/wasi-common/src/snapshots/preview_1.rs +++ b/crates/wasi-common/src/snapshots/preview_1.rs @@ -803,7 +803,7 @@ impl wasi_snapshot_preview1::WasiSnapshotPreview1 for W...
7
94
107
7a6fbe08987a7cb43c7e2a78ba5482bec8ab3c2a
Andrew Brown
2022-11-14T20:15:09
wiggle: fix typo (#5265)
diff --git a/crates/wiggle/src/lib.rs b/crates/wiggle/src/lib.rs index a03bc6e20..3653a3ff0 100644 --- a/crates/wiggle/src/lib.rs +++ b/crates/wiggle/src/lib.rs @@ -55,7 +55,7 @@ pub mod wasmtime_crate { /// The region returned by `base` must not only be valid, however, but it must /// be valid for "a period of time ...
1
1
1
d3692c2f2b86c272335f4858be93fd383d657f06
Denys Zadorozhnyi
2022-11-14T17:02:07
fix typo in caller_conv arg name in ABIMachineSpec::gen_call; (#5259)
diff --git a/cranelift/codegen/src/machinst/abi.rs b/cranelift/codegen/src/machinst/abi.rs index 1e76e230d..160281fc1 100644 --- a/cranelift/codegen/src/machinst/abi.rs +++ b/cranelift/codegen/src/machinst/abi.rs @@ -564,7 +564,7 @@ pub trait ABIMachineSpec { opcode: ir::Opcode, tmp: Writable<Reg>, ...
1
1
1
70c72ee2a44bde6d677fcd514ad0f4428e687739
Jamey Sharp
2022-11-14T02:29:22
cranelift-isle: New IR and revised overlap checks (#5195) * cranelift-isle: New IR and revised overlap checks * Improve error reporting * Avoid "unused argument" warnings a nicer way * Remove unused fields * Minimize diff and "fix" error handling I had tried to use Miette "right" and made things worse s...
diff --git a/cranelift/isle/isle/src/error.rs b/cranelift/isle/isle/src/error.rs index 5748c267a..9115be636 100644 --- a/cranelift/isle/isle/src/error.rs +++ b/cranelift/isle/isle/src/error.rs @@ -42,6 +42,18 @@ pub enum Error { span: Span, }, + /// The rule can never match any input. + Unreachabl...
4
849
268
95ca72a37ae17d33d6fa727150dab5a49011b555
Jamey Sharp
2022-11-11T01:53:05
cranelift-isle: Misc sema cleanups (#5242) This mostly amounts to factoring out duplicated code and turning various uses of `unwrap_or_continue!` into iterator chains.
diff --git a/cranelift/isle/isle/src/sema.rs b/cranelift/isle/isle/src/sema.rs index 1d53f22d2..0e6384034 100644 --- a/cranelift/isle/isle/src/sema.rs +++ b/cranelift/isle/isle/src/sema.rs @@ -303,6 +303,20 @@ impl Term { self.ret_ty } + fn check_args_count<T>(&self, args: &[T], tyenv: &mut TypeEnv, ...
1
64
100
7717d8fa5583b6cdd5140952e32a632d5a8d1cbd
Andrew Brown
2022-11-10T21:54:52
wiggle: adapt Wiggle guest slices for `unsafe` shared use (#5229) * wiggle: adapt Wiggle guest slices for `unsafe` shared use When multiple threads can concurrently modify a WebAssembly shared memory, the underlying data for a Wiggle `GuestSlice` and `GuestSliceMut` could change due to access from other threads. ...
diff --git a/crates/wasi-common/src/snapshots/preview_0.rs b/crates/wasi-common/src/snapshots/preview_0.rs index d04b471c1..c59b7bcfa 100644 --- a/crates/wasi-common/src/snapshots/preview_0.rs +++ b/crates/wasi-common/src/snapshots/preview_0.rs @@ -468,14 +468,16 @@ impl wasi_unstable::WasiUnstable for WasiCtx { ...
11
445
147
7ec626b8989385fd7c5551e8f263c87fb873d6ba
Alex Crichton
2022-11-10T20:53:04
Use deterministic randomness fuzzing the pooling allocator (#5247) This commit updates the index allocation performed in the pooling allocator with a few refactorings: * With `cfg(fuzzing)` a deterministic rng is now used to improve reproducibility of fuzz test cases. * The `Mutex` was pushed inside of `IndexA...
diff --git a/crates/runtime/Cargo.toml b/crates/runtime/Cargo.toml index 94eee3aa1..00a69d67e 100644 --- a/crates/runtime/Cargo.toml +++ b/crates/runtime/Cargo.toml @@ -21,7 +21,7 @@ memoffset = "0.6.0" indexmap = "1.0.2" thiserror = "1.0.4" cfg-if = "1.0" -rand = "0.8.3" +rand = { version = "0.8.3", features = ['sm...
3
141
125
3b9668558f40e212ec6b4047216bdb8d1da30d88
Alex Crichton
2022-11-10T20:01:42
winch: Prepare for an update to the `wasm-tools` crates (#5238) This commit prepares the `winch` crate for updating `wasm-tools`, notably changing a bit about how the visitation of operators works. This moves the function body and wasm validator out of the `CodeGen` structure and into parameters threaded into the e...
diff --git a/winch/codegen/src/codegen.rs b/winch/codegen/src/codegen.rs index fd48e6eb2..5c1cd1c49 100644 --- a/winch/codegen/src/codegen.rs +++ b/winch/codegen/src/codegen.rs @@ -6,7 +6,7 @@ use crate::{ stack::Stack, }; use anyhow::Result; -use wasmparser::{FuncValidator, FunctionBody, ValType, ValidatorResou...
7
90
104
1f09954fa49d6947a6adf3c1edda81231c81e409
Alex Crichton
2022-11-10T19:58:11
Avoid unconditional `getrandom` syscall creating a `WasiCtx` (#5244) This commit updates the default random context inserted into a `WasiCtxt` to be seeded from `thread_rng` rather than the system's entropy. This avoids an unconditional syscall on the creation of all `WasiCtx` structures shouldn't reduce the qualit...
diff --git a/crates/wasi-common/cap-std-sync/src/lib.rs b/crates/wasi-common/cap-std-sync/src/lib.rs index 4d8fd0cb9..12f27bcec 100644 --- a/crates/wasi-common/cap-std-sync/src/lib.rs +++ b/crates/wasi-common/cap-std-sync/src/lib.rs @@ -47,7 +47,7 @@ pub use clocks::clocks_ctx; pub use sched::sched_ctx; use crate::...
1
3
2
92f6fe36cc1b5eca5af57fd0902cf7ff1f2a0752
Alex Crichton
2022-11-10T19:35:15
Fix CI after CVE fixes (#5245) * Fix CI after CVE fixes Alas we can't run CI ahead of time so this fixes various minor build issues from the merging of the recent CVE fixes. Note that I plan to publish the advisories once CI issues are sorted out. * Fix mmap/free of zero bytes
diff --git a/crates/runtime/src/cow.rs b/crates/runtime/src/cow.rs index bbe18363d..3542c4855 100644 --- a/crates/runtime/src/cow.rs +++ b/crates/runtime/src/cow.rs @@ -422,6 +422,7 @@ impl MemoryImageSlot { } } + #[cfg(feature = "pooling-allocator")] pub(crate) fn dummy() -> MemoryImageSlot { ...
2
8
2
f0fccbd18ad47f26d2f37c98b57fb1c17288ef66
Jamey Sharp
2022-11-10T17:51:49
cranelift-isle: Helpers to get type/term by name (#5241) This is a common pattern in sema, so factor it out. Since this version uses `intern` instead of `intern_mut`, it might be a tiny bit faster when errors occur due to not writing names into maps then. When no error occurs, ISLE should do exactly the same work...
diff --git a/cranelift/isle/isle/src/sema.rs b/cranelift/isle/isle/src/sema.rs index d869b0a7d..1d53f22d2 100644 --- a/cranelift/isle/isle/src/sema.rs +++ b/cranelift/isle/isle/src/sema.rs @@ -14,7 +14,6 @@ //! the opposite). use crate::ast; -use crate::ast::Ident; use crate::error::*; use crate::lexer::Pos; use...
1
59
78
2be457c29570bafa33e4d7d8dea2a787f325ab59
Alex Crichton
2022-11-10T17:51:10
Change the return type of `SharedMemory::data` (#5240) This commit is an attempt at improving the safety of using the return value of the `SharedMemory::data` method. Previously this returned `*mut [u8]` which, while correct, is unwieldy and unsafe to work with. The new return value of `&[UnsafeCell<u8>]` has a few...
diff --git a/crates/fuzzing/src/oracles/diff_wasmtime.rs b/crates/fuzzing/src/oracles/diff_wasmtime.rs index f2a31aee1..bdf28fbd5 100644 --- a/crates/fuzzing/src/oracles/diff_wasmtime.rs +++ b/crates/fuzzing/src/oracles/diff_wasmtime.rs @@ -169,12 +169,11 @@ impl DiffInstance for WasmtimeInstance { fn get_memory...
3
34
17
5b6d5e78de106503b3b9add218bb3d2b1d63c493
Alex Crichton
2022-11-10T17:35:14
Merge pull request from GHSA-h84q-m8rr-3v9q The Rust definition was previously performing a 4-byte write when the C API was declared as taking an 1-byte buffer.
diff --git a/crates/c-api/src/trap.rs b/crates/c-api/src/trap.rs index 55beff062..479f30f43 100644 --- a/crates/c-api/src/trap.rs +++ b/crates/c-api/src/trap.rs @@ -116,7 +116,7 @@ pub(crate) fn error_trace<'a>(error: &'a Error, out: &mut wasm_frame_vec_t<'a>) } #[no_mangle] -pub extern "C" fn wasmtime_trap_code(ra...
1
1
1
000bd98ae57c9adb387810570341c36e79f62d4b
Alex Crichton
2022-11-10T17:34:59
Merge pull request from GHSA-44mr-8vmm-wjhg Ensure that support is not regressed in keeping this working.
diff --git a/tests/all/pooling_allocator.rs b/tests/all/pooling_allocator.rs index 49485bf94..b97ebd474 100644 --- a/tests/all/pooling_allocator.rs +++ b/tests/all/pooling_allocator.rs @@ -778,3 +778,39 @@ fn dynamic_memory_pooling_allocator() -> Result<()> { Ok(()) } + +#[test] +fn zero_memory_pages_disallows_...
1
36
0
3535acbf3be032ef1ba0b469b8ab92538a8a18a6
Alex Crichton
2022-11-10T17:34:38
Merge pull request from GHSA-wh6w-3828-g9qf * Unconditionally use `MemoryImageSlot` This commit removes the internal branching within the pooling instance allocator to sometimes use a `MemoryImageSlot` and sometimes now. Instead this is now unconditionally used in all situations on all platforms. This fixes an issue ...
diff --git a/Cargo.toml b/Cargo.toml index 53ab9e31e..6e21908b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -181,13 +181,11 @@ default = [ "vtune", "wasi-nn", "pooling-allocator", - "memory-init-cow", ] jitdump = ["wasmtime/jitdump"] vtune = ["wasmtime/vtune"] wasi-crypto = ["dep:wasmtime-wasi-crypto"] w...
16
247
333
eef567ad2884cbc349812cbe87c69a53934f030f
Pat Hickey
2022-11-10T00:44:31
host: stub in just enough to get the tests to pass
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index f62ea3387..1bbc5a582 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -69,7 +69,11 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { buf: Vec<u8>, offset: wasi_filesystem::Filesize, ) -> HostResult<wasi_file...
2
7
2
58497fdafe7884e9b599ebc8c8dedc1297ca8b10
Pat Hickey
2022-11-10T00:37:26
cabi_export_realloc is another bad allocator for our bad allocator museum
diff --git a/src/lib.rs b/src/lib.rs index 3fb3eadec..80a0ed152 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,7 +106,17 @@ pub unsafe extern "C" fn cabi_export_realloc( align: usize, new_size: usize, ) -> *mut u8 { - unreachable() + if !old_ptr.is_null() { + unreachable(); + } + if new_...
1
11
1
47fa1ad6a854f793bc98f23d5f30bb0d400892e6
Nick Fitzgerald
2022-11-10T00:19:43
Rework bounds checking for atomic operations (#5239) Before, we would do a `heap_addr` to translate the given Wasm memory address into a native memory address and pass it into the libcall that implemented the atomic operation, which would then treat the address as a Wasm memory address and pass it to `validate_atom...
diff --git a/cranelift/wasm/src/code_translator.rs b/cranelift/wasm/src/code_translator.rs index 28478b342..c75f6fe86 100644 --- a/cranelift/wasm/src/code_translator.rs +++ b/cranelift/wasm/src/code_translator.rs @@ -1066,21 +1066,24 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>( let heap = st...
4
74
52
98f3993eef0d126dc9dde9c9b4cf064a9559bb1f
Pat Hickey
2022-11-09T23:59:39
runtime tests: pass some args!
diff --git a/host/tests/runtime.rs b/host/tests/runtime.rs index 62a01dde3..db8bdf199 100644 --- a/host/tests/runtime.rs +++ b/host/tests/runtime.rs @@ -28,8 +28,9 @@ fn instantiate(path: &str) -> Result<(Store<WasiCtx>, Wasi)> { fn run_hello_stdout(mut store: Store<WasiCtx>, wasi: Wasi) -> Result<()> { wasi.comm...
1
15
4
86679489effb0f88e0e073e48408d43b5c1f812c
Jamey Sharp
2022-11-09T23:32:33
cranelift-isle: if-let patterns aren't root terms (#5233) The `is_root` flag to `translate_pattern` just determines whether the `rule_term` argument is used, which begs a larger cleanup. But that cleanup is less clear if `is_root` is set anywhere aside from the call in `collect_rules`. So I wanted to get confirmati...
diff --git a/cranelift/isle/isle/src/sema.rs b/cranelift/isle/isle/src/sema.rs index 7ef2e8142..d869b0a7d 100644 --- a/cranelift/isle/isle/src/sema.rs +++ b/cranelift/isle/isle/src/sema.rs @@ -2397,7 +2397,7 @@ impl TermEnv { &iflet.pattern, Some(ty), bindings, - /* is_...
1
1
1
54998715ead8ef24cd46d0d3eae0340839302232
Jamey Sharp
2022-11-09T23:21:15
cranelift-isle: Save variable names for later use (#5221) It's nice to be able to report these names after sema analysis completes so rule authors can recognize which names they used. This isn't used anywhere yet, but I'm planning to use it during codegen, and the rule-verification folks wanted something like thi...
diff --git a/cranelift/isle/isle/src/sema.rs b/cranelift/isle/isle/src/sema.rs index 46286a02a..7ef2e8142 100644 --- a/cranelift/isle/isle/src/sema.rs +++ b/cranelift/isle/isle/src/sema.rs @@ -429,12 +429,25 @@ pub struct Rule { /// The right-hand side expression that this rule evaluates upon successful /// m...
1
37
31
2ab5b8cd38c8a6201790741b0daeeb973fe0171a
Pat Hickey
2022-11-09T23:17:46
skip codegen for command, and fill in the entrypoint manually
diff --git a/src/lib.rs b/src/lib.rs index 8693554f7..3fb3eadec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,8 +9,12 @@ wit_bindgen_guest_rust::generate!({ import: "wit/wasi-random.wit.md", default: "wit/command.wit.md", name: "wasi_command", + no_std, raw_strings, - unchecked + unchecked...
1
22
31
a0f61cd335c26d36c0c76cb96f0558ef397b4466
Joel Dice
2022-11-08T20:50:05
convert poll interface to use "future" pseudo-handles Per discussion with pchickey, this modifies the poll API to use "futures" rather than a `subscription` type. The former is arguably closer to the API we'll use once resource support is finalized. You can create a future by calling `subscribe-read`, `subscribe-wri...
diff --git a/host/src/main.rs b/host/src/main.rs index 0fe897279..aa8ed7efc 100644 --- a/host/src/main.rs +++ b/host/src/main.rs @@ -27,7 +27,7 @@ fn main() -> Result<()> { let (wasi, _instance) = Wasi::instantiate(&mut store, &component, &linker)?; - wasi.command(&mut store, 0, 0, Vec::new())?; + wasi.c...
2
49
4
d38631a724c1c6b0f38494624a20a7a6f4af66b0
Jamey Sharp
2022-11-09T20:36:02
cranelift-isle: Don't panic on too-large rule priorities (#5236) Found with ISLE's fuzzer.
diff --git a/cranelift/isle/isle/src/parser.rs b/cranelift/isle/isle/src/parser.rs index 347f27f3b..6975777be 100644 --- a/cranelift/isle/isle/src/parser.rs +++ b/cranelift/isle/isle/src/parser.rs @@ -390,7 +390,10 @@ impl<'a> Parser<'a> { fn parse_rule(&mut self) -> Result<Rule> { let pos = self.pos(); ...
1
5
2
33a192556e5f11ee95cffc7a90e74b78abc340c8
Jamey Sharp
2022-11-09T19:24:38
cranelift-isle: Do fewer term lookups (#5232) While checking the call graph of extractors during semantic validation, save `TermId` instead of `Sym`. The types are both just integer indexes, but the `TermId` is more useful here. Saving it avoids needing to check for failed map lookups twice, which simplifies the im...
diff --git a/cranelift/isle/isle/src/sema.rs b/cranelift/isle/isle/src/sema.rs index 501b93a17..46286a02a 100644 --- a/cranelift/isle/isle/src/sema.rs +++ b/cranelift/isle/isle/src/sema.rs @@ -1323,21 +1323,20 @@ impl TermEnv { let mut callees = BTreeSet::new(); template.terms(&mut |...
1
8
19
065ce745914162d105375cc5b4dc6466a269e31b
Tshepang Mbambo
2022-11-09T15:13:03
cli docs: some consistency improvements, and a fix (#5234)
diff --git a/crates/cli-flags/src/lib.rs b/crates/cli-flags/src/lib.rs index 4b9ccae60..ebc0752c3 100644 --- a/crates/cli-flags/src/lib.rs +++ b/crates/cli-flags/src/lib.rs @@ -106,11 +106,11 @@ pub struct CommonOptions { #[clap(long, parse(from_os_str), value_name = "CONFIG_PATH")] pub config: Option<PathBuf...
1
14
14
d59caf39b6667c8147b02b235554bfd78f0f4436
Chris Fallin
2022-11-08T23:03:17
Wasmtime+Cranelift: strip out some dead x86-32 code. (#5226) * Wasmtime+Cranelift: strip out some dead x86-32 code. I was recently pointed to fastly/Viceroy#200 where it seems some folks are trying to compile Wasmtime (via Viceroy) for Windows x86-32 and the failures may not be loud enough. I've tried to reproduc...
diff --git a/cranelift/native/src/lib.rs b/cranelift/native/src/lib.rs index 8250b1e52..8d2a3ca1c 100644 --- a/cranelift/native/src/lib.rs +++ b/cranelift/native/src/lib.rs @@ -46,7 +46,12 @@ pub fn builder_with_options(infer_native_flags: bool) -> Result<isa::Builder, &' isa::LookupError::Unsupported => "unsu...
6
12
43
fd7b903f337d88ab0b8f0a025ab39ac08f4b13ce
Nick Fitzgerald
2022-11-08T21:44:02
Cranelift: Use a custom enum instead of boolean for the ISLE target (#5228) Easier to read and doesn't require `/* is_lower = */`-style comments at call sites.
diff --git a/cranelift/codegen/meta/src/gen_inst.rs b/cranelift/codegen/meta/src/gen_inst.rs index ba65cd339..e0adf5827 100644 --- a/cranelift/codegen/meta/src/gen_inst.rs +++ b/cranelift/codegen/meta/src/gen_inst.rs @@ -1197,11 +1197,20 @@ fn gen_inst_builder(inst: &Instruction, format: &InstructionFormat, fmt: &mut F...
1
47
27
f026d95a1ab66943912f135b250e6a15d410ff6d
Andrew Brown
2022-11-08T21:25:24
wiggle: add initial support for shared memory (#5225) This change is the first in a series of changes to support shared memory in Wiggle. Since Wiggle was written under the assumption of single-threaded guest-side access, this change introduces a `shared` field to guest memories in order to flag when this assumptio...
diff --git a/crates/wiggle/generate/src/wasmtime.rs b/crates/wiggle/generate/src/wasmtime.rs index 50ece4820..be3603754 100644 --- a/crates/wiggle/generate/src/wasmtime.rs +++ b/crates/wiggle/generate/src/wasmtime.rs @@ -118,7 +118,7 @@ fn generate_func( }; let (mem , ctx) = mem.data_and_store_mut(&mu...
4
122
15
70bca801ab3e71d735dd80f3e6174068076b1148
Trevor Elliott
2022-11-08T20:42:20
cranelift: Resize with `types::INVALID` isntead of `types::I8` (#5227)
diff --git a/cranelift/codegen/src/machinst/vcode.rs b/cranelift/codegen/src/machinst/vcode.rs index 6e4aca808..c0423e2a2 100644 --- a/cranelift/codegen/src/machinst/vcode.rs +++ b/cranelift/codegen/src/machinst/vcode.rs @@ -1408,7 +1408,7 @@ impl<I: VCodeInst> VRegAllocator<I> { /// Set the type of this virtual r...
1
1
1
d94173ea099c8f3706624df3c803544e0de9e64c
Trevor Elliott
2022-11-08T18:05:02
Add a VRegAllocator to separate VReg allocation from VCode (#5222) Remove the dependency on VCode for VReg allocation. This will simplify the changes in #5172, as that PR introduces the need to allocate temporary registers from the ABI context. This change also allows us to remove some fields from VCode: reftyped_v...
diff --git a/cranelift/codegen/src/machinst/lower.rs b/cranelift/codegen/src/machinst/lower.rs index 551eccad9..3dea3b279 100644 --- a/cranelift/codegen/src/machinst/lower.rs +++ b/cranelift/codegen/src/machinst/lower.rs @@ -19,13 +19,12 @@ use crate::machinst::{ LoweredBlock, MachLabel, Reg, SigSet, VCode, VCodeB...
2
95
79
7b5fd8408249aa7cfaa11bd75422af463408a5f3
Alex Crichton
2022-11-08T17:43:20
c-api: Avoid losing error context with instance traps (#5223) This commit was a mistake from #5149
diff --git a/crates/c-api/src/instance.rs b/crates/c-api/src/instance.rs index 2f93661ec..13fb96a36 100644 --- a/crates/c-api/src/instance.rs +++ b/crates/c-api/src/instance.rs @@ -98,13 +98,14 @@ pub(crate) fn handle_instantiate( *instance_ptr = i; None } - Err(e) => match e.d...
1
6
5
528a8dec1425453bda0a9261be2d828527c55ba9
Pat Hickey
2022-11-08T00:26:52
host: pass args
diff --git a/host/src/main.rs b/host/src/main.rs index b447b57c7..0fe897279 100644 --- a/host/src/main.rs +++ b/host/src/main.rs @@ -27,7 +27,7 @@ fn main() -> Result<()> { let (wasi, _instance) = Wasi::instantiate(&mut store, &component, &linker)?; - wasi.command(&mut store)?; + wasi.command(&mut store,...
1
1
1
5abb9d380d22b6bc9ad744cb0609e8f660f53eda
Pat Hickey
2022-11-08T00:26:02
adapter: take args, have two cabi_{import,export}_realloc funcs, and call adaptee start
diff --git a/src/lib.rs b/src/lib.rs index a63b60613..8693554f7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,7 +24,8 @@ impl wasi_command::WasiCommand for Export { fn command( stdin: wasi_filesystem::Descriptor, stdout: wasi_filesystem::Descriptor, /* TODO add the environment Vec<(String, Stri...
1
24
8
940d85c56a9a8d14139ab64a0c5fb789793f182a
Pat Hickey
2022-11-08T00:25:35
test programs: only use main, dont bindgen export an interface
diff --git a/test-programs/src/bin/hello_stdout.rs b/test-programs/src/bin/hello_stdout.rs index 05a7a80ff..fbb740570 100644 --- a/test-programs/src/bin/hello_stdout.rs +++ b/test-programs/src/bin/hello_stdout.rs @@ -1,16 +1,4 @@ -wit_bindgen_guest_rust::generate!({ - default: "../wit/command.wit.md", - name: "ap...
2
5
29
6d9ef7adac24d42eda003ea6b9f7d67437178309
Pat Hickey
2022-11-08T00:24:11
get rid of --import-memory in .cargo/config, and --export-table for guests
diff --git a/test-programs/macros/build.rs b/test-programs/macros/build.rs index a72f48eab..4992b2bcc 100644 --- a/test-programs/macros/build.rs +++ b/test-programs/macros/build.rs @@ -30,7 +30,6 @@ fn main() { .arg("--target=wasm32-wasi") .env("CARGO_TARGET_DIR", &out_dir) .env("CARGO_PROFIL...
1
0
1
980e9482390c9d0cf669d40337297ca18ae7af29
Alex Crichton
2022-11-07T17:28:17
Slim down temporary trampoline objects (#5212) I noticed this in the backtrace of something that timed out on oss-fuzz and there's no need to include this information in trampolines, so this removes the extra sections from being generated.
diff --git a/crates/wasmtime/src/trampoline/func.rs b/crates/wasmtime/src/trampoline/func.rs index 9de79001a..8799cf85e 100644 --- a/crates/wasmtime/src/trampoline/func.rs +++ b/crates/wasmtime/src/trampoline/func.rs @@ -120,7 +120,6 @@ where stub_fn::<F> as usize, &mut obj, )?; - engine.appen...
1
0
1
9814e8bfebcaa63e9fdbdb36f99223aa94e011ba
Afonso Bordado
2022-11-07T17:08:26
fuzzgen: Add a few more ops (#5201) Adds `bitselect`,`select` and `select_spectre_guard`
diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index 103c5d78f..4bd1522ad 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -73,6 +73,33 @@ fn insert_opcode( Ok(()) } +// `select_spectre_guard` is...
2
107
2
508dd81928ef7610bd15f5bb92b1857edf1671e1
Alphyr
2022-11-07T15:05:59
Impl `Debug` for `SharedMemory` and `Extern` (#5211)
diff --git a/crates/wasmtime/src/externals.rs b/crates/wasmtime/src/externals.rs index 11368216c..177edc18a 100644 --- a/crates/wasmtime/src/externals.rs +++ b/crates/wasmtime/src/externals.rs @@ -18,7 +18,7 @@ use wasmtime_runtime::{self as runtime, InstanceHandle}; /// as well as required by [`Instance::new`](crate:...
2
7
1
1ddf03aaa1f84f0b4bd282c60d91945a636b2599
Joe Shaw
2022-11-05T18:31:09
offer function-level control over tracing (#5194) * wiggle: fix compilation with async functions when tracing is off Fixes #5202 * switch tracing config from a boolean to a struct This will enable more complex tracing rules in the future * rename AsyncConfField to FunctionField It is going to be reused ...
diff --git a/crates/wiggle/generate/src/codegen_settings.rs b/crates/wiggle/generate/src/codegen_settings.rs index ced7b0cbe..616a12dd7 100644 --- a/crates/wiggle/generate/src/codegen_settings.rs +++ b/crates/wiggle/generate/src/codegen_settings.rs @@ -1,4 +1,4 @@ -use crate::config::{AsyncConf, ErrorConf}; +use crate:...
5
99
19
fba2287c543f1de0d6da3a495d14150c96b92603
Ulrich Weigand
2022-11-04T21:01:37
Fix mprotect failures by enabling cranelift-jit selinux-fix (#5204) The sample program in cranelift/filetests/src/function_runner.rs would abort with an mprotect failure under certain circumstances, see https://github.com/bytecodealliance/wasmtime/pull/4453#issuecomment-1303803222 Root cause was that enabling PRO...
diff --git a/cranelift/filetests/Cargo.toml b/cranelift/filetests/Cargo.toml index c143c7634..7b8ce9b1d 100644 --- a/cranelift/filetests/Cargo.toml +++ b/cranelift/filetests/Cargo.toml @@ -16,7 +16,7 @@ cranelift-interpreter = { workspace = true } cranelift-native = { workspace = true } cranelift-reader = { workspace...
2
7
7
d3a6181939015eabd30d0c154b1cf2922e9dc4ba
Alex Crichton
2022-11-04T20:56:34
Add support for keeping pooling allocator pages resident (#5207) When new wasm instances are created repeatedly in high-concurrency environments one of the largest bottlenecks is the contention on kernel-level locks having to do with the virtual memory. It's expected that usage in this environment is leveraging the...
diff --git a/crates/fuzzing/src/generators/pooling_config.rs b/crates/fuzzing/src/generators/pooling_config.rs index f6a49a5e7..f0cfef18b 100644 --- a/crates/fuzzing/src/generators/pooling_config.rs +++ b/crates/fuzzing/src/generators/pooling_config.rs @@ -14,6 +14,9 @@ pub struct PoolingAllocationConfig { pub ins...
5
320
52
7b7eeac1befb9ff63d7d4ef8331bdfe174544826
Joe Shaw
2022-11-04T18:43:00
wiggle: fix compilation with async functions when tracing is off (#5203) Fixes #5202
diff --git a/crates/wiggle/generate/src/funcs.rs b/crates/wiggle/generate/src/funcs.rs index 7fd595796..f124d066a 100644 --- a/crates/wiggle/generate/src/funcs.rs +++ b/crates/wiggle/generate/src/funcs.rs @@ -118,7 +118,11 @@ fn _define_func( }.instrument(_span) ) } else { - ...
2
21
1
387426e7f4dd740cbee2375079a64e35fc996ed5
11evan
2022-11-03T23:59:41
cranelift: improve syscall error/oom handling in JIT module (#5173) * cranelift: improve syscall error/oom handling in JIT module The JIT module has several places where it `expect`s or `panic`s on syscall or allocator errors. For example, `mmap` and `mprotect` can fail if Linux `vm.max_map_count` is not high eno...
diff --git a/cranelift/filetests/src/function_runner.rs b/cranelift/filetests/src/function_runner.rs index 51b9dbab0..39f607905 100644 --- a/cranelift/filetests/src/function_runner.rs +++ b/cranelift/filetests/src/function_runner.rs @@ -244,7 +244,7 @@ impl TestFileCompiler { // Finalize the functions which we...
6
69
24
342f8058123ae92e7f29a7e03c675fb1dab111ce
Ulrich Weigand
2022-11-03T20:36:38
Use vselect in NaN canonicalization pass. (#5192) Change add_nan_canon_seq to use vselect instead of bitselect. This is more straightforward and removes bitcast operations. Codegen should be unchanged.
diff --git a/cranelift/codegen/src/nan_canonicalization.rs b/cranelift/codegen/src/nan_canonicalization.rs index 6b8a882aa..2bcf3a1f1 100644 --- a/cranelift/codegen/src/nan_canonicalization.rs +++ b/cranelift/codegen/src/nan_canonicalization.rs @@ -70,11 +70,9 @@ fn add_nan_canon_seq(pos: &mut FuncCursor, inst: Inst) {...
1
7
9
22159848c59f9e6ae0107671994b33465decf3be
Alex Crichton
2022-11-03T16:53:51
Fix instruction size test for Rust 1.65.0 (#5188) Looks like Rust generously shrank our `enum` in 1.65.0, so update the test assertion to pass CI.
diff --git a/cranelift/codegen/src/isa/x64/inst/mod.rs b/cranelift/codegen/src/isa/x64/inst/mod.rs index cdc9dfed4..6a3eae120 100644 --- a/cranelift/codegen/src/isa/x64/inst/mod.rs +++ b/cranelift/codegen/src/isa/x64/inst/mod.rs @@ -48,7 +48,7 @@ pub struct CallInfo { fn inst_size_test() { // This test will help ...
1
1
1
311b01875f56c59ef69bf9c9a53819d1ecd3cebc
Afonso Bordado
2022-11-03T15:12:31
cranelift: Fuzz inline stack probes on x86 (#5185)
diff --git a/cranelift/fuzzgen/src/config.rs b/cranelift/fuzzgen/src/config.rs index d0247f590..971f6d27e 100644 --- a/cranelift/fuzzgen/src/config.rs +++ b/cranelift/fuzzgen/src/config.rs @@ -37,6 +37,8 @@ pub struct Config { pub static_stack_slots_per_function: RangeInclusive<usize>, /// Size in bytes ...
2
28
1
2688b44915731bea0402021e1e2a77e52c8aacc7
Jamey Sharp
2022-11-03T01:18:49
cranelift-isle: Factor out rule/pattern/expr visitors (#5174) This makes some rather tricky analysis available to other users besides the current IR. It shouldn't change current behavior, except if a rule attempts to bind its root term to a name. There's no Rust value for a root term, so the existing code silently ...
diff --git a/cranelift/isle/isle/src/ir.rs b/cranelift/isle/isle/src/ir.rs index d7c53307c..9266ebe74 100644 --- a/cranelift/isle/isle/src/ir.rs +++ b/cranelift/isle/isle/src/ir.rs @@ -3,7 +3,6 @@ use crate::lexer::Pos; use crate::log; use crate::sema::*; -use crate::StableMap; declare_id!( /// The id of an ...
2
381
268
e0c8a7f477525f4c70c4ee0b06ddd478d021360e
Alex Crichton
2022-11-02T16:59:01
Don't fail documentation without the default feature (#5180) This commit fixes `cargo doc -p wasmtime --no-default-features` where previously it would fail with many broken doc links because the crate is missing many items that links refer to. Instead they're emitted as warnings now which while noisy should prevent...
diff --git a/crates/wasmtime/src/lib.rs b/crates/wasmtime/src/lib.rs index 2ec92d144..1f0d0a9e0 100644 --- a/crates/wasmtime/src/lib.rs +++ b/crates/wasmtime/src/lib.rs @@ -379,12 +379,16 @@ //! # } //! ``` -#![allow(unknown_lints)] -#![deny(missing_docs, rustdoc::broken_intra_doc_links)] +#![deny(missing_docs)] #...
1
6
2
033758daaf3e7f0af4348e0d996f26de5c6ba4fc
Jamey Sharp
2022-11-02T00:17:11
cranelift-isle: trie construction and IR cleanups (#5171) One big change here is to stop using `Term::extractor_sig`, which was the only call that used a `TypeEnv`. However that function only uses type information to construct the fully-qualified name of the extractor, which is not used when building the IR. So rem...
diff --git a/cranelift/isle/isle/src/compile.rs b/cranelift/isle/isle/src/compile.rs index de0a33487..23c11df1b 100644 --- a/cranelift/isle/isle/src/compile.rs +++ b/cranelift/isle/isle/src/compile.rs @@ -8,6 +8,6 @@ pub fn compile(defs: &ast::Defs, options: &codegen::CodegenOptions) -> Result<St let mut typeenv =...
3
72
168
0c53941364aadc5d302175e3ca891196094ca361
Trevor Elliott
2022-11-01T17:05:45
Remove the need for count_operands by restructuring emit in s390x (#5164) Remove the need for count_operands by restructuring emit in the s390x backend to instead take the AllocationConsumer as an argument.
diff --git a/cranelift/codegen/src/isa/s390x/inst/emit.rs b/cranelift/codegen/src/isa/s390x/inst/emit.rs index a6db0f019..94739c490 100644 --- a/cranelift/codegen/src/isa/s390x/inst/emit.rs +++ b/cranelift/codegen/src/isa/s390x/inst/emit.rs @@ -5,7 +5,6 @@ use crate::ir::{MemFlags, RelSourceLoc, TrapCode}; use crate::...
2
37
53
d0673ff7dac7ad52ccc7ba5da1bb198390a9ad99
Nick Fitzgerald
2022-11-01T16:48:40
Cranelift: use iterators instead of indexing; clean up match expressions (#5161)
diff --git a/cranelift/codegen/src/isa/s390x/abi.rs b/cranelift/codegen/src/isa/s390x/abi.rs index 99c10038c..242253604 100644 --- a/cranelift/codegen/src/isa/s390x/abi.rs +++ b/cranelift/codegen/src/isa/s390x/abi.rs @@ -397,21 +397,15 @@ impl ABIMachineSpec for S390xMachineDeps { // After all arguments are ...
1
6
12
6d289723bd6e88fcee2f13dc786982e09f32edb8
Nick Fitzgerald
2022-10-31T21:32:17
Cranelift: Use a single, shared vector allocation for all `ABIArg`s (#5127) * Cranelift: Use a single, shared vector allocation for all `ABIArg`s Instead of two `SmallVec`s per `SigData`. * Remove `Deref` and `DerefMut` impls for `ArgsAccumulator`
diff --git a/cranelift/codegen/src/isa/aarch64/abi.rs b/cranelift/codegen/src/isa/aarch64/abi.rs index a9b82cbce..cf50abe59 100644 --- a/cranelift/codegen/src/isa/aarch64/abi.rs +++ b/cranelift/codegen/src/isa/aarch64/abi.rs @@ -93,7 +93,8 @@ impl ABIMachineSpec for AArch64MachineDeps { params: I, arg...
7
190
99
bb11e61d75c309b96307818c8805248302655e28
Robin Freyler
2022-10-31T19:42:35
Cleanup wasmi fuzzing code (#5140) * cleanup wasmi fuzzing code * apply rustfmt * change Into<DiffValue> to From<WasmiValue> for DiffValue impl block * add back unwrap in get_global and get_memory * apply code review suggestions * apply rustfmt * fix spelling mistake * fix spelling issue 2 It k...
diff --git a/crates/fuzzing/src/oracles/diff_wasmi.rs b/crates/fuzzing/src/oracles/diff_wasmi.rs index f06019d99..01ff817c4 100644 --- a/crates/fuzzing/src/oracles/diff_wasmi.rs +++ b/crates/fuzzing/src/oracles/diff_wasmi.rs @@ -76,36 +76,11 @@ impl DiffEngine for WasmiEngine { .downcast_ref::<wasmi::c...
1
52
57
95ecb7e4d440605165a74de607de5389508779be
Alex Crichton
2022-10-31T14:52:13
Add a CLI option for the maximum stack size (#5156) This should allow either increasing or decreasing it for debugging and otherwise prodding at stack overflow behavior from the CLI.
diff --git a/crates/cli-flags/src/lib.rs b/crates/cli-flags/src/lib.rs index 058522bbb..e4066edb9 100644 --- a/crates/cli-flags/src/lib.rs +++ b/crates/cli-flags/src/lib.rs @@ -229,6 +229,11 @@ pub struct CommonOptions { #[cfg(feature = "pooling-allocator")] #[clap(long)] pub pooling_allocator: bool, + +...
1
9
0
81f7ef7fbeee11a75d62694fddfeafef38766cd8
Alex Crichton
2022-10-28T22:55:34
Reduce calls to `section_by_name` loading artifacts (#5151) * Reduce calls to `section_by_name` loading artifacts Data is stored in binary artifacts as an ELF object and when loading an artifact lots of calls are made to the `object` crate's `section_by_name` method which ends up doing a linear search through the...
diff --git a/crates/jit/src/instantiate.rs b/crates/jit/src/instantiate.rs index 4a0521a52..e7ffbadae 100644 --- a/crates/jit/src/instantiate.rs +++ b/crates/jit/src/instantiate.rs @@ -287,7 +287,7 @@ pub fn finish_compile( } let section_id = obj.add_section( obj.segment_name(StandardSegm...
1
91
63
3b637e228aa521562ae55911eb8dc18b1ab86c9d
Pat Hickey
2022-10-28T21:14:14
notes for what to do next
diff --git a/src/lib.rs b/src/lib.rs index acc8fbff0..a63b60613 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,8 @@ wit_bindgen_guest_rust::generate!({ import: "wit/wasi-logging.wit.md", import: "wit/wasi-poll.wit.md", import: "wit/wasi-random.wit.md", - name: "wasi", + default: "wit/command.w...
1
28
1
bda213fad6f7d3ac4717eb4528dabffd3f3a909a
Pat Hickey
2022-10-28T21:14:14
notes for what to do next
diff --git a/host/tests/runtime.rs b/host/tests/runtime.rs index 3cb3994a4..62a01dde3 100644 --- a/host/tests/runtime.rs +++ b/host/tests/runtime.rs @@ -8,6 +8,8 @@ use wasmtime::{ test_programs_macros::tests!(); fn instantiate(path: &str) -> Result<(Store<WasiCtx>, Wasi)> { + println!("{}", path); + let mu...
3
15
4
7ff0f4001890c54288f8120bb3412c6b60afd936
Pat Hickey
2022-10-27T23:38:16
add tracing to the host tests this shows pretty convincingly that neither of the tests are calling any imports
diff --git a/host/Cargo.toml b/host/Cargo.toml index 8026b95ed..abb56d11b 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -7,7 +7,10 @@ edition = "2021" anyhow = "1" thiserror = "1" wasmtime = { git = "https://github.com/bytecodealliance/wasmtime" } -wit-bindgen-host-wasmtime-rust = { git = "https://github.com...
3
6
2
8183101ed56d04facf0ed6bd26f770b5b67be0d8
Pat Hickey
2022-10-27T23:26:20
add a test program that panics, we can catch that...
diff --git a/host/tests/runtime.rs b/host/tests/runtime.rs index 15082e7a6..3cb3994a4 100644 --- a/host/tests/runtime.rs +++ b/host/tests/runtime.rs @@ -7,7 +7,7 @@ use wasmtime::{ test_programs_macros::tests!(); -fn run(path: &str) -> Result<()> { +fn instantiate(path: &str) -> Result<(Store<WasiCtx>, Wasi)> { ...
3
29
3
d1eeba5a68e8e73668a413e90b2562e86bceb9a5
Pat Hickey
2022-10-27T22:40:08
add a crate full of guest programs to test, and a macro to build them
diff --git a/host/Cargo.toml b/host/Cargo.toml index 8fcddb2f3..8026b95ed 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" anyhow = "1" thiserror = "1" wasmtime = { git = "https://github.com/bytecodealliance/wasmtime" } -wit-component = { git = "https://github.com/bytecodealliance/...
9
152
38
270261942739db14ff84814dc73b844b145d5db3
Pat Hickey
2022-10-27T18:26:54
wiggle: allow disable tracing in Wiggle-generated code (#5146) Wiggle generates code that instruments APIs with tracing code. This is handy for diagnosing issues at runtime, but when inspecting the output of Wiggle, it can make the generated code difficult for a human to decipher. This change makes tracing a defaul...
diff --git a/crates/wasi-common/src/snapshots/preview_1.rs b/crates/wasi-common/src/snapshots/preview_1.rs index 3b8eae51f..664a0508e 100644 --- a/crates/wasi-common/src/snapshots/preview_1.rs +++ b/crates/wasi-common/src/snapshots/preview_1.rs @@ -25,7 +25,7 @@ wiggle::from_witx!({ // keeping that set the same in...
5
63
20
3cbd490d5238e335811dc237f83ae57b7109c6e6
Afonso Bordado
2022-10-27T18:01:03
fuzzgen: Add more opcodes (#5124) * fuzzgen: Add a few more opcodes * fuzzgen: Add more bmask variations
diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs index 5e8fcefc2..88e0f62ef 100644 --- a/cranelift/fuzzgen/src/function_generator.rs +++ b/cranelift/fuzzgen/src/function_generator.rs @@ -277,6 +277,72 @@ const OPCODE_SIGNATURES: &'static [( // aarch64: https:...
1
156
0
b20128a6cbcbcbcb0b8fcdc057369ce6c5146e0c
Saúl Cabrera
2022-10-27T14:38:44
Expose type information in module translation (#5139) This adds a new field `types` to `ModuleTranslation`, so that consumers can have access to the module type information known after validation has finished. This change is useful when consumers want to have access to the type information in wasmparser's terms rat...
diff --git a/crates/environ/src/module_environ.rs b/crates/environ/src/module_environ.rs index e8f1e8e29..a48ad952f 100644 --- a/crates/environ/src/module_environ.rs +++ b/crates/environ/src/module_environ.rs @@ -14,7 +14,7 @@ use std::convert::{TryFrom, TryInto}; use std::path::PathBuf; use std::sync::Arc; use wasm...
1
16
3
2c49ea9ec8459db9909f07fd4188075b0c6c79b2
Pat Hickey
2022-10-26T21:27:02
latest wasmtime & wit-bindgen, and get rid of chrono
diff --git a/host/Cargo.toml b/host/Cargo.toml index 7c9cf0d9d..8fcddb2f3 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] anyhow = "1" thiserror = "1" -chrono = "0.4" wasmtime = { git = "https://github.com/bytecodealliance/wasmtime" } wit-component = { git = "http...
2
4
5
9a8a710d8b050b6fdc1c37b07458ce506f277388
Christopher Serr
2022-10-26T20:42:31
Add missing `Win32_Foundation` feature (#5134) This is necessary for the `wasmtime-runtime` crate to compile on Windows.
diff --git a/crates/runtime/Cargo.toml b/crates/runtime/Cargo.toml index 2c002cdca..792c358f1 100644 --- a/crates/runtime/Cargo.toml +++ b/crates/runtime/Cargo.toml @@ -36,6 +36,7 @@ rustix = { workspace = true, features = ["mm"] } [target.'cfg(target_os = "windows")'.dependencies.windows-sys] workspace = true featu...
1
1
0
e079195322a70764ecd42ee23f691cd7d652230f
Jamey Sharp
2022-10-26T19:49:08
Simplify overlap checking after removing Rayon (#5131) Now that we aren't trying to do overlap checking in parallel, we can fuse the loop that generates a list of rule pairs with the loop that checks those pairs. Removing the intermediate vector of pairs should save a little time and memory. But it also means we...
diff --git a/cranelift/isle/isle/src/overlap.rs b/cranelift/isle/isle/src/overlap.rs index ecee90391..789e7d450 100644 --- a/cranelift/isle/isle/src/overlap.rs +++ b/cranelift/isle/isle/src/overlap.rs @@ -108,6 +108,11 @@ fn check_overlaps(env: &TermEnv) -> Errors { continue; } + ...
1
14
20
b3333bf9ea465a708b1504c10122d1626e13d5a9
Chris Fallin
2022-10-25T23:51:55
Cranelift: disable egraphs in fuzzing for now. (#5128) * Cranelift: disable egraphs in fuzzing for now. As per [this comment], with a few recent discussions it's become clear that we want to refactor egraphs in a way that will subsume, or make irrelevant, some of the recent fuzzbugs that have arisen (and likely ...
diff --git a/cranelift/fuzzgen/src/lib.rs b/cranelift/fuzzgen/src/lib.rs index 4e9a64c83..7c24139b1 100644 --- a/cranelift/fuzzgen/src/lib.rs +++ b/cranelift/fuzzgen/src/lib.rs @@ -254,7 +254,6 @@ where "enable_incremental_compilation_cache_checks", "regalloc_checker", "enable_llv...
2
0
3
b61e6783094996b2fa62d7132c6a068b30437ad7
Ulrich Weigand
2022-10-25T18:04:31
s390x: Fix more regalloc checker errors (#5121) For VecInsertLane[Undef] and VecExtractLane, if lane_reg is zero_reg(), the instruction does not actually use any register value. Fixes https://github.com/bytecodealliance/wasmtime/issues/5090
diff --git a/cranelift/codegen/src/isa/s390x/inst/mod.rs b/cranelift/codegen/src/isa/s390x/inst/mod.rs index 706c50d4d..8e3e4eda5 100644 --- a/cranelift/codegen/src/isa/s390x/inst/mod.rs +++ b/cranelift/codegen/src/isa/s390x/inst/mod.rs @@ -974,21 +974,27 @@ fn s390x_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, colle...
1
9
3
441401f9d69146da1f10b7043d9e863161448991
bjorn3
2022-10-25T17:03:48
Fix zero init sequence for i128 in cranelift-frontend (#5115) iconst.i128 is no longer allowed, so we have to use iconst.i64 + uextend instead.
diff --git a/cranelift/frontend/src/ssa.rs b/cranelift/frontend/src/ssa.rs index 64331a916..0f2b88e74 100644 --- a/cranelift/frontend/src/ssa.rs +++ b/cranelift/frontend/src/ssa.rs @@ -15,7 +15,7 @@ use cranelift_codegen::cursor::{Cursor, FuncCursor}; use cranelift_codegen::entity::{EntityList, EntitySet, ListPool, Se...
1
5
2
ba7b874ca3664d0b4916cf8f41e03813d5e2798b
Afonso Bordado
2022-10-25T17:03:04
cranelift: Add RISC-V disassembly capabilities to clif-util (#5117) This just correctly maps our RISC-V ISA to capstone.
diff --git a/cranelift/src/disasm.rs b/cranelift/src/disasm.rs index a950d6b98..67caf28bc 100644 --- a/cranelift/src/disasm.rs +++ b/cranelift/src/disasm.rs @@ -118,6 +118,18 @@ cfg_if! { .mode(arch::sysz::ArchMode::Default) .build() .map_err(map_caperr)?, ...
1
12
0
21b0dd38bf6230e5c0957540e545e9723de2f3a7
Pat Hickey
2022-10-25T01:19:03
stub out the rest of the interfaces too
diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs new file mode 100644 index 000000000..f62ea3387 --- /dev/null +++ b/host/src/filesystem.rs @@ -0,0 +1,215 @@ +#![allow(unused_variables)] + +use crate::{wasi_filesystem, WasiCtx}; +use wit_bindgen_host_wasmtime_rust::Result as HostResult; + +impl wasi_filesys...
5
261
0
339367cbc4f9fd9dd09cc46ae946943cd7189476
Pat Hickey
2022-10-25T00:41:39
host: build the adapter, and use it to adapt a preview1 module
diff --git a/host/Cargo.toml b/host/Cargo.toml index b544ff5c1..7c9cf0d9d 100644 --- a/host/Cargo.toml +++ b/host/Cargo.toml @@ -3,12 +3,11 @@ name = "host" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] anyhow ...
4
79
2
097d1087e02e5e4b6a03289aae760948ae55de69
Nick Fitzgerald
2022-10-25T00:21:34
Cranelift: Avoid calling `ensure_struct_return_pointer_is_returned` and cloning sigs for every call (#5113) * Cranelift: pass iterators to `ABIMachineSpec::compute_arg_locs` Instead of slices. This gives us more flexibility to pass custom sequences without needing to allocate a `Vec` to hold them and pass in as a ...
diff --git a/cranelift/codegen/src/machinst/abi.rs b/cranelift/codegen/src/machinst/abi.rs index d6d129cc7..2ff928b81 100644 --- a/cranelift/codegen/src/machinst/abi.rs +++ b/cranelift/codegen/src/machinst/abi.rs @@ -586,14 +586,15 @@ impl SigData { sig: &ir::Signature, flags: &settings::Flags, )...
1
21
14
5db1242d99005c14617d62a740527dd7f6527bc6
Pat Hickey
2022-10-24T22:05:14
switch to latest wit_bindgen_guest_rust macro
diff --git a/src/lib.rs b/src/lib.rs index 49f199efc..acc8fbff0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,14 +1,13 @@ #![allow(unused_variables)] // TODO: remove this when more things are implemented -wit_bindgen_guest_rust::import!({ - paths: [ - "wit/wasi-clocks.wit.md", - "wit/wasi-default-c...
1
8
9
c0e6457e224723c22e8b4d5ecfcbfc1bf9cd10db
Pat Hickey
2022-10-24T21:49:40
add very start of a host implementation really just stubbing things out to show table mechanisms work as expected
diff --git a/host/Cargo.toml b/host/Cargo.toml new file mode 100644 index 000000000..b544ff5c1 --- /dev/null +++ b/host/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "host" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[depen...
4
290
0
66f6c66431d8a47b3df2284e783d78a13750f11b
Pat Hickey
2022-10-24T21:49:30
fd_info fixup
diff --git a/src/lib.rs b/src/lib.rs index 0e367754b..49f199efc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -189,7 +189,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
3
2
37c33423740483f372f8dcf3ff299b93cd80d727
Alex Crichton
2022-10-24T14:14:42
Fix accidental infinite loop in fuzz targets (#5103) The `libfuzzer-sys` update in #5068 included some changes to the `fuzz_target!` macro which caused a bare `run` function to be shadowed by the macro-defined `run` function (changed in rust-fuzz/libfuzzer#95) which meant that some of our fuzz targets were infinit...
diff --git a/fuzz/fuzz_targets/differential.rs b/fuzz/fuzz_targets/differential.rs index 5ba5ea06d..e6a1f5012 100644 --- a/fuzz/fuzz_targets/differential.rs +++ b/fuzz/fuzz_targets/differential.rs @@ -53,10 +53,10 @@ fuzz_target!(|data: &[u8]| { // Errors in `run` have to do with not enough input in `data`, whic...
2
4
4
470070ab7197ef39b47bad4f307fd20b04b24f14
bjorn3
2022-10-23T22:13:14
Remove rayon dependency of cranelift-isle (#5101) Using rayon adds a lot of dependencies to Cranelift. The total unparallelized time the code that uses rayon takes is less than half a second and it runs at compile time, so there is pretty much no benefit to parallelizing it.
diff --git a/Cargo.lock b/Cargo.lock index 5aab66c85..6ac9187cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -647,7 +647,6 @@ version = "0.90.0" dependencies = [ "log", "miette", - "rayon", "tempfile", ] diff --git a/cranelift/isle/isle/Cargo.toml b/cranelift/isle/isle/Cargo.toml index 4e31567d8..9689717a5 100...
3
2
19
442f9fa01b7560ce1df8ddeb16f883c6ad645f40
Nick Fitzgerald
2022-10-21T23:08:09
Cranelift: pass iterators to `ABIMachineSpec::compute_arg_locs` (#5095) Instead of slices. This gives us more flexibility to pass custom sequences without needing to allocate a `Vec` to hold them and pass in as a slice.
diff --git a/cranelift/codegen/src/isa/aarch64/abi.rs b/cranelift/codegen/src/isa/aarch64/abi.rs index 6bd8f946c..a9b82cbce 100644 --- a/cranelift/codegen/src/isa/aarch64/abi.rs +++ b/cranelift/codegen/src/isa/aarch64/abi.rs @@ -87,13 +87,16 @@ impl ABIMachineSpec for AArch64MachineDeps { 16 } - fn c...
5
30
16
5c5fa192f7d94c7795f3d304beccdab339fbbb10
Nick Fitzgerald
2022-10-21T20:08:56
Cranelift: use `.enumerate()` to avoid indexing in s390x backend (#5094) This can help rustc/llvm avoid bounds checks, but more importantly I will have future changes here that remove indexing of params, and instead hand them out as an iterator.
diff --git a/cranelift/codegen/src/isa/s390x/abi.rs b/cranelift/codegen/src/isa/s390x/abi.rs index 8d48e4bc9..3f7c6bf5e 100644 --- a/cranelift/codegen/src/isa/s390x/abi.rs +++ b/cranelift/codegen/src/isa/s390x/abi.rs @@ -245,9 +245,7 @@ impl ABIMachineSpec for S390xMachineDeps { next_gpr += 1; } ...
1
1
3
4a66c3b855d83da0de93cbaaaafc065454f4dd8b
Nick Fitzgerald
2022-10-21T20:08:44
Cranelift: Remove duplicate IR signature legalizations (#5093) The `SigData::from_func_sig` constructor will already ensure that the struct return pointer is returned, so this is a purely unnecessary call. Note that this is not a performance speed up, since `ensure_struct_return_ptr_is_returned` doesn't do any si...
diff --git a/cranelift/codegen/src/machinst/abi.rs b/cranelift/codegen/src/machinst/abi.rs index a7d21dd59..f79927cee 100644 --- a/cranelift/codegen/src/machinst/abi.rs +++ b/cranelift/codegen/src/machinst/abi.rs @@ -773,8 +773,7 @@ impl SigSet { // `ir::Signature`. debug_assert!(!self.have_abi_sig_fo...
1
2
4
204d4c332c3a731985036259a9b45bf9717117a8
Alex Crichton
2022-10-21T04:13:19
Increase attempts and timeout in publish script (#5084) The 2.0.0 publication failed due to the index not being updated, so do more attempts and wait longer to try to get things working.
diff --git a/scripts/publish.rs b/scripts/publish.rs index 932ee3493..4baa4d559 100644 --- a/scripts/publish.rs +++ b/scripts/publish.rs @@ -156,7 +156,7 @@ fn main() { // publish in a loop and we remove crates once they're successfully // published. Failed-to-publish crates get enqueued for a...
1
2
2
51d8734235e989d50e41c5da4e2e5f897390e6f0
Afonso Bordado
2022-10-20T23:40:50
fuzzgen: Generate compiler flags (#5020) * fuzzgen: Test compiler flags * cranelift: Generate `all()` function for all enum flags This allows a user to iterate all flags that exist. * fuzzgen: Minimize regalloc_checker compiles * fuzzgen: Limit the amount of test case inputs * fuzzgen: Add egraphs flag ...
diff --git a/cranelift/codegen/meta/src/gen_settings.rs b/cranelift/codegen/meta/src/gen_settings.rs index 3c1de7cd6..01a4f731a 100644 --- a/cranelift/codegen/meta/src/gen_settings.rs +++ b/cranelift/codegen/meta/src/gen_settings.rs @@ -98,6 +98,26 @@ fn gen_iterator(group: &SettingGroup, fmt: &mut Formatter) { fm...
5
138
29
c392e461a3458a011f79dca7ec22773b873006cd
Chris Fallin
2022-10-19T18:05:00
egraphs: a few miscellaneous compile-time optimizations. (#5072) * egraphs: a few miscellaneous compile-time optimizations. These optimizations together are worth about a 2% compile-time reduction, as measured on one core with spidermonkey.wasm as an input, using `hyperfine` on `wasmtime compile`. The changes ...
diff --git a/cranelift/codegen/src/egraph.rs b/cranelift/codegen/src/egraph.rs index f9216596a..d8d625671 100644 --- a/cranelift/codegen/src/egraph.rs +++ b/cranelift/codegen/src/egraph.rs @@ -1,6 +1,7 @@ //! Egraph-based mid-end optimization framework. use crate::dominator_tree::DominatorTree; +use crate::egraph::...
9
206
139
0667a412d70c6b4d9f97502a351db54373c18c91
bjorn3
2022-10-19T15:52:24
Export a couple of types from cranelift_module that were meant to be exported (#5074)
diff --git a/cranelift/module/src/lib.rs b/cranelift/module/src/lib.rs index b14bc4a6b..405a9b543 100644 --- a/cranelift/module/src/lib.rs +++ b/cranelift/module/src/lib.rs @@ -42,8 +42,9 @@ mod traps; pub use crate::data_context::{DataContext, DataDescription, Init}; pub use crate::module::{ - DataId, FuncId, F...
2
10
2
12e4a1ba18f9697b13576c42efdc86e0b2e88499
Pat Hickey
2022-10-18T20:40:57
component model: async host function & embedding support (#5055) * func_wrap_async typechecks * func call async * instantiate_async * fixes * async engine creation for tests * start adding a component model test for async * fix wrong check for async support, factor out Instance::new_started to an unc...
diff --git a/crates/misc/component-test-util/src/lib.rs b/crates/misc/component-test-util/src/lib.rs index 6636dc7d5..1fad5bb6c 100644 --- a/crates/misc/component-test-util/src/lib.rs +++ b/crates/misc/component-test-util/src/lib.rs @@ -65,6 +65,12 @@ pub fn engine() -> Engine { Engine::new(&config()).unwrap() } ...
8
351
17
25bc12ec82c842b86a67b330dbaccb86ae49978b
Chris Fallin
2022-10-18T17:22:37
Add egraphs option to Wasmtime config, and add it to fuzzing config generation. (#5067) * Add egraphs option to Wasmtime config, and add it to fuzzing config generation. This PR adds a wrapper method for Cranelift's `use_egraphs` setting to Wasmtime's `Config`, named `cranelift_use_egraphs` analogously to its exi...
diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs index 4b94f278b..1029cd4b9 100644 --- a/crates/fuzzing/src/generators/config.rs +++ b/crates/fuzzing/src/generators/config.rs @@ -163,6 +163,7 @@ impl Config { .native_unwind_info(self.wasmtime.native_unwind_info...
2
27
3
b5175d35a5f969fa2f16fd5d7ba3dbb41b49ec3f
Dan Gohman
2022-10-18T16:07:05
Convert to use `u32` indices instead of handles. This is a temporary experiment.
diff --git a/src/lib.rs b/src/lib.rs index 261df1427..0e367754b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -174,7 +174,7 @@ pub unsafe extern "C" fn fd_close(fd: Fd) -> Errno { #[no_mangle] pub unsafe extern "C" fn fd_datasync(fd: Fd) -> Errno { match Descriptor::get(fd) { - Descriptor::File(file) => mat...
1
9
13