Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 2d1bba3

Browse files
authored
Merge pull request #173 from alexcrichton/merge
Merge upstream/main
2 parents ac09ef4 + a12b6be commit 2d1bba3

202 files changed

Lines changed: 2912 additions & 2150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ http = { workspace = true, optional = true }
8888
http-body-util = { workspace = true, optional = true }
8989

9090
[target.'cfg(unix)'.dependencies]
91-
rustix = { workspace = true, features = ["mm", "param", "process"] }
91+
rustix = { workspace = true, features = ["mm", "process"] }
9292

9393
[dev-dependencies]
9494
# depend again on wasmtime to activate its default features for tests
@@ -134,6 +134,9 @@ futures = { workspace = true }
134134
[target.'cfg(windows)'.dev-dependencies]
135135
windows-sys = { workspace = true, features = ["Win32_System_Memory"] }
136136

137+
[target.'cfg(unix)'.dev-dependencies]
138+
rustix = { workspace = true, features = ["param"] }
139+
137140
[build-dependencies]
138141
anyhow = { workspace = true, features = ['std'] }
139142

@@ -206,10 +209,12 @@ map_clone = 'warn'
206209
uninlined_format_args = 'warn'
207210
unnecessary_to_owned = 'warn'
208211
manual_strip = 'warn'
212+
useless_conversion = 'warn'
209213
unnecessary_mut_passed = 'warn'
210214
unnecessary_fallible_conversions = 'warn'
211215
unnecessary_cast = 'warn'
212216
allow_attributes_without_reason = 'warn'
217+
from_over_into = 'warn'
213218

214219
[workspace.dependencies]
215220
arbitrary = { version = "1.4.0" }

benches/thread_eager_init.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fn measure_execution_time(c: &mut Criterion) {
1212
let (engine, module) = test_setup();
1313
b.iter_custom(move |iters| {
1414
(0..iters)
15-
.into_iter()
1615
.map(|_| lazy_thread_instantiate(engine.clone(), module.clone()))
1716
.sum()
1817
})
@@ -24,7 +23,6 @@ fn measure_execution_time(c: &mut Criterion) {
2423
let (engine, module) = test_setup();
2524
b.iter_custom(move |iters| {
2625
(0..iters)
27-
.into_iter()
2826
.map(|_| {
2927
let (init, _call) = eager_thread_instantiate(engine.clone(), module.clone());
3028
init
@@ -39,7 +37,6 @@ fn measure_execution_time(c: &mut Criterion) {
3937
let (engine, module) = test_setup();
4038
b.iter_custom(move |iters| {
4139
(0..iters)
42-
.into_iter()
4340
.map(|_| {
4441
let (_init, call) = eager_thread_instantiate(engine.clone(), module.clone());
4542
call

cranelift/assembler-x64/meta/src/dsl.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ mod features;
99
pub mod format;
1010

1111
pub use encoding::{
12-
Encoding, Group1Prefix, Group2Prefix, Group3Prefix, Group4Prefix, Opcodes, Prefixes, Rex,
12+
Encoding, Group1Prefix, Group2Prefix, Group3Prefix, Group4Prefix, Opcodes, Prefixes, Rex, Vex,
13+
VexLength, VexMMMMM, VexPP, rex, vex,
1314
};
14-
pub use encoding::{rex, vex};
1515
pub use features::{ALL_FEATURES, Feature, Features};
1616
pub use format::{Extension, Format, Location, Mutability, Operand, OperandKind, RegClass};
1717
pub use format::{align, fmt, implicit, r, rw, sxl, sxq, sxw, w};
@@ -30,6 +30,7 @@ pub fn inst(
3030
format,
3131
encoding,
3232
features: features.into(),
33+
has_trap: false,
3334
}
3435
}
3536

@@ -56,6 +57,9 @@ pub struct Inst {
5657
/// "64-bit/32-bit Mode Support" and "CPUID Feature Flag" columns of the x64
5758
/// reference manual.
5859
pub features: Features,
60+
/// Whether or not this instruction can trap and thus needs a `TrapCode`
61+
/// payload in the instruction itself.
62+
pub has_trap: bool,
5963
}
6064

6165
impl Inst {
@@ -77,6 +81,13 @@ impl Inst {
7781
self.format.name.to_lowercase()
7882
)
7983
}
84+
85+
/// Flags this instruction as being able to trap, so needs a `TrapCode` at
86+
/// compile time to track this.
87+
pub fn has_trap(mut self) -> Self {
88+
self.has_trap = true;
89+
self
90+
}
8091
}
8192

8293
impl core::fmt::Display for Inst {
@@ -86,11 +97,15 @@ impl core::fmt::Display for Inst {
8697
format,
8798
encoding,
8899
features,
100+
has_trap,
89101
} = self;
90102
write!(f, "{name}: {format} => {encoding}")?;
91103
if !features.is_empty() {
92104
write!(f, " [{features}]")?;
93105
}
106+
if *has_trap {
107+
write!(f, " has_trap")?;
108+
}
94109
Ok(())
95110
}
96111
}

0 commit comments

Comments
 (0)