Update wasm-tools crates

Nothing major here, just a routine update with a few extra things to
handle here-and-there.
This commit is contained in:
Alex Crichton
2022-02-02 09:45:43 -08:00
parent c83968575a
commit 65486a0680
15 changed files with 102 additions and 42 deletions

28
Cargo.lock generated
View File

@@ -3033,9 +3033,9 @@ checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
version = "0.1.8" version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
@@ -3340,15 +3340,15 @@ dependencies = [
[[package]] [[package]]
name = "wasmparser" name = "wasmparser"
version = "0.81.0" version = "0.82.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98930446519f63d00a836efdc22f67766ceae8dbcc1571379f2bcabc6b2b9abc" checksum = "0559cc0f1779240d6f894933498877ea94f693d84f3ee39c9a9932c6c312bd70"
[[package]] [[package]]
name = "wasmprinter" name = "wasmprinter"
version = "0.2.31" version = "0.2.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a00ad4a51ba74183137c776ab37dea50b9f71db7454d7b654c2ba69ac5d9b223" checksum = "6d7e1e9d5e3540363f038518bc21f568caabaad20d4e371deabe37424ef15a8d"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"wasmparser", "wasmparser",
@@ -3484,7 +3484,7 @@ dependencies = [
"wasmtime-wasi-crypto", "wasmtime-wasi-crypto",
"wasmtime-wasi-nn", "wasmtime-wasi-nn",
"wasmtime-wast", "wasmtime-wast",
"wast 38.0.1", "wast 39.0.0",
"wat", "wat",
"winapi", "winapi",
] ]
@@ -3672,7 +3672,7 @@ version = "0.33.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"wasmtime", "wasmtime",
"wast 38.0.1", "wast 39.0.0",
] ]
[[package]] [[package]]
@@ -3686,20 +3686,22 @@ dependencies = [
[[package]] [[package]]
name = "wast" name = "wast"
version = "38.0.1" version = "39.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae0d7b256bef26c898fa7344a2d627e8499f5a749432ce0a05eae1a64ff0c271" checksum = "e9bbbd53432b267421186feee3e52436531fa69a7cfee9403f5204352df3dd05"
dependencies = [ dependencies = [
"leb128", "leb128",
"memchr",
"unicode-width",
] ]
[[package]] [[package]]
name = "wat" name = "wat"
version = "1.0.40" version = "1.0.41"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adcfaeb27e2578d2c6271a45609f4a055e6d7ba3a12eff35b1fd5ba147bdf046" checksum = "ab98ed25494f97c69f28758617f27c3e92e5336040b5c3a14634f2dd3fe61830"
dependencies = [ dependencies = [
"wast 38.0.1", "wast 39.0.0",
] ]
[[package]] [[package]]

View File

@@ -37,7 +37,7 @@ file-per-thread-logger = "0.1.1"
libc = "0.2.60" libc = "0.2.60"
rayon = "1.5.0" rayon = "1.5.0"
humantime = "2.0.0" humantime = "2.0.0"
wasmparser = "0.81.0" wasmparser = "0.82.0"
lazy_static = "1.4.0" lazy_static = "1.4.0"
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
@@ -54,7 +54,7 @@ test-programs = { path = "crates/test-programs" }
wasmtime-runtime = { path = "crates/runtime" } wasmtime-runtime = { path = "crates/runtime" }
tokio = { version = "1.8.0", features = ["rt", "time", "macros", "rt-multi-thread"] } tokio = { version = "1.8.0", features = ["rt", "time", "macros", "rt-multi-thread"] }
tracing-subscriber = "0.3.1" tracing-subscriber = "0.3.1"
wast = "38.0.0" wast = "39.0.0"
criterion = "0.3.4" criterion = "0.3.4"
num_cpus = "1.13.0" num_cpus = "1.13.0"
winapi = { version = "0.3.9", features = ['memoryapi'] } winapi = { version = "0.3.9", features = ['memoryapi'] }

View File

@@ -12,7 +12,7 @@ keywords = ["webassembly", "wasm"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
wasmparser = { version = "0.81", default-features = false } wasmparser = { version = "0.82", default-features = false }
cranelift-codegen = { path = "../codegen", version = "0.80.0", default-features = false } cranelift-codegen = { path = "../codegen", version = "0.80.0", default-features = false }
cranelift-entity = { path = "../entity", version = "0.80.0" } cranelift-entity = { path = "../entity", version = "0.80.0" }
cranelift-frontend = { path = "../frontend", version = "0.80.0", default-features = false } cranelift-frontend = { path = "../frontend", version = "0.80.0", default-features = false }

View File

@@ -2013,6 +2013,25 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
Operator::ReturnCall { .. } | Operator::ReturnCallIndirect { .. } => { Operator::ReturnCall { .. } | Operator::ReturnCallIndirect { .. } => {
return Err(wasm_unsupported!("proposed tail-call operator {:?}", op)); return Err(wasm_unsupported!("proposed tail-call operator {:?}", op));
} }
Operator::I8x16SwizzleRelaxed
| Operator::I32x4TruncSatF32x4SRelaxed
| Operator::I32x4TruncSatF32x4URelaxed
| Operator::I32x4TruncSatF64x2SZeroRelaxed
| Operator::I32x4TruncSatF64x2UZeroRelaxed
| Operator::F32x4FmaRelaxed
| Operator::F32x4FmsRelaxed
| Operator::F64x2FmaRelaxed
| Operator::F64x2FmsRelaxed
| Operator::I8x16LaneSelect
| Operator::I16x8LaneSelect
| Operator::I32x4LaneSelect
| Operator::I64x2LaneSelect
| Operator::F32x4MinRelaxed
| Operator::F64x2MinRelaxed
| Operator::F32x4MaxRelaxed
| Operator::F64x2MaxRelaxed => {
return Err(wasm_unsupported!("proposed relaxed-simd operator {:?}", op));
}
}; };
Ok(()) Ok(())
} }

View File

@@ -362,7 +362,12 @@ pub fn parse_element_section<'data>(
environ.reserve_table_elements(elements.get_count())?; environ.reserve_table_elements(elements.get_count())?;
for (index, entry) in elements.into_iter().enumerate() { for (index, entry) in elements.into_iter().enumerate() {
let Element { kind, items, ty: _ } = entry?; let Element {
kind,
items,
ty: _,
range: _,
} = entry?;
let segments = read_elems(&items)?; let segments = read_elems(&items)?;
match kind { match kind {
ElementKind::Active { ElementKind::Active {
@@ -409,7 +414,11 @@ pub fn parse_data_section<'data>(
environ.reserve_data_initializers(data.get_count())?; environ.reserve_data_initializers(data.get_count())?;
for (index, entry) in data.into_iter().enumerate() { for (index, entry) in data.into_iter().enumerate() {
let Data { kind, data } = entry?; let Data {
kind,
data,
range: _,
} = entry?;
match kind { match kind {
DataKind::Active { DataKind::Active {
memory_index, memory_index,

View File

@@ -19,7 +19,7 @@ cranelift-codegen = { path = "../../cranelift/codegen", version = "0.80.0" }
cranelift-frontend = { path = "../../cranelift/frontend", version = "0.80.0" } cranelift-frontend = { path = "../../cranelift/frontend", version = "0.80.0" }
cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0" } cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0" }
cranelift-native = { path = "../../cranelift/native", version = "0.80.0" } cranelift-native = { path = "../../cranelift/native", version = "0.80.0" }
wasmparser = "0.81.0" wasmparser = "0.82.0"
target-lexicon = "0.12" target-lexicon = "0.12"
gimli = { version = "0.26.0", default-features = false, features = ['read', 'std'] } gimli = { version = "0.26.0", default-features = false, features = ['read', 'std'] }
object = { version = "0.27.0", default-features = false, features = ['write'] } object = { version = "0.27.0", default-features = false, features = ['write'] }

View File

@@ -14,7 +14,7 @@ edition = "2018"
anyhow = "1.0" anyhow = "1.0"
cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0" } cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0" }
wasmtime-types = { path = "../types", version = "0.33.0" } wasmtime-types = { path = "../types", version = "0.33.0" }
wasmparser = "0.81" wasmparser = "0.82"
indexmap = { version = "1.0.2", features = ["serde-1"] } indexmap = { version = "1.0.2", features = ["serde-1"] }
thiserror = "1.0.4" thiserror = "1.0.4"
serde = { version = "1.0.94", features = ["derive"] } serde = { version = "1.0.94", features = ["derive"] }

View File

@@ -516,7 +516,12 @@ impl<'data> ModuleEnvironment<'data> {
self.result.module.table_initializers.reserve_exact(cnt); self.result.module.table_initializers.reserve_exact(cnt);
for (index, entry) in elements.into_iter().enumerate() { for (index, entry) in elements.into_iter().enumerate() {
let wasmparser::Element { kind, items, ty: _ } = entry?; let wasmparser::Element {
kind,
items,
ty: _,
range: _,
} = entry?;
// Build up a list of `FuncIndex` corresponding to all the // Build up a list of `FuncIndex` corresponding to all the
// entries listed in this segment. Note that it's not // entries listed in this segment. Note that it's not
@@ -646,7 +651,11 @@ impl<'data> ModuleEnvironment<'data> {
self.result.data.reserve_exact(cnt); self.result.data.reserve_exact(cnt);
for (index, entry) in data.into_iter().enumerate() { for (index, entry) in data.into_iter().enumerate() {
let wasmparser::Data { kind, data } = entry?; let wasmparser::Data {
kind,
data,
range: _,
} = entry?;
let mk_range = |total: &mut u32| -> Result<_, WasmError> { let mk_range = |total: &mut u32| -> Result<_, WasmError> {
let range = u32::try_from(data.len()) let range = u32::try_from(data.len())
.ok() .ok()

View File

@@ -13,7 +13,7 @@ arbitrary = { version = "1.0.0", features = ["derive"] }
env_logger = "0.8.1" env_logger = "0.8.1"
log = "0.4.8" log = "0.4.8"
rayon = "1.2.1" rayon = "1.2.1"
wasmparser = "0.81" wasmparser = "0.82"
wasmprinter = "0.2.31" wasmprinter = "0.2.31"
wasmtime = { path = "../wasmtime" } wasmtime = { path = "../wasmtime" }
wasmtime-wast = { path = "../wast" } wasmtime-wast = { path = "../wast" }

View File

@@ -12,4 +12,4 @@ edition = "2018"
cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0", features = ['enable-serde'] } cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0", features = ['enable-serde'] }
serde = { version = "1.0.94", features = ["derive"] } serde = { version = "1.0.94", features = ["derive"] }
thiserror = "1.0.4" thiserror = "1.0.4"
wasmparser = { version = "0.81", default-features = false } wasmparser = { version = "0.82", default-features = false }

View File

@@ -20,7 +20,7 @@ wasmtime-cache = { path = "../cache", version = "=0.33.0", optional = true }
wasmtime-fiber = { path = "../fiber", version = "=0.33.0", optional = true } wasmtime-fiber = { path = "../fiber", version = "=0.33.0", optional = true }
wasmtime-cranelift = { path = "../cranelift", version = "=0.33.0", optional = true } wasmtime-cranelift = { path = "../cranelift", version = "=0.33.0", optional = true }
target-lexicon = { version = "0.12.0", default-features = false } target-lexicon = { version = "0.12.0", default-features = false }
wasmparser = "0.81" wasmparser = "0.82"
anyhow = "1.0.19" anyhow = "1.0.19"
region = "2.2.0" region = "2.2.0"
libc = "0.2" libc = "0.2"

View File

@@ -77,6 +77,8 @@ struct WasmFeatures {
pub multi_memory: bool, pub multi_memory: bool,
pub exceptions: bool, pub exceptions: bool,
pub memory64: bool, pub memory64: bool,
pub relaxed_simd: bool,
pub extended_const: bool,
} }
impl From<&wasmparser::WasmFeatures> for WasmFeatures { impl From<&wasmparser::WasmFeatures> for WasmFeatures {
@@ -93,20 +95,24 @@ impl From<&wasmparser::WasmFeatures> for WasmFeatures {
multi_memory, multi_memory,
exceptions, exceptions,
memory64, memory64,
} = other; relaxed_simd,
extended_const,
} = *other;
Self { Self {
reference_types: *reference_types, reference_types,
multi_value: *multi_value, multi_value,
bulk_memory: *bulk_memory, bulk_memory,
module_linking: *module_linking, module_linking,
simd: *simd, simd,
threads: *threads, threads,
tail_call: *tail_call, tail_call,
deterministic_only: *deterministic_only, deterministic_only,
multi_memory: *multi_memory, multi_memory,
exceptions: *exceptions, exceptions,
memory64: *memory64, memory64,
relaxed_simd,
extended_const,
} }
} }
} }
@@ -669,6 +675,8 @@ impl<'a> SerializedModule<'a> {
multi_memory, multi_memory,
exceptions, exceptions,
memory64, memory64,
relaxed_simd,
extended_const,
} = self.metadata.features; } = self.metadata.features;
Self::check_bool( Self::check_bool(
@@ -714,6 +722,16 @@ impl<'a> SerializedModule<'a> {
other.memory64, other.memory64,
"WebAssembly 64-bit memory support", "WebAssembly 64-bit memory support",
)?; )?;
Self::check_bool(
extended_const,
other.extended_const,
"WebAssembly extended-const support",
)?;
Self::check_bool(
relaxed_simd,
other.relaxed_simd,
"WebAssembly relaxed-simd support",
)?;
Ok(()) Ok(())
} }

View File

@@ -12,7 +12,7 @@ edition = "2018"
[dependencies] [dependencies]
anyhow = "1.0.19" anyhow = "1.0.19"
wasmtime = { path = "../wasmtime", version = "0.33.0", default-features = false, features = ['cranelift'] } wasmtime = { path = "../wasmtime", version = "0.33.0", default-features = false, features = ['cranelift'] }
wast = "38.0.0" wast = "39.0.0"
[badges] [badges]
maintenance = { status = "actively-developed" } maintenance = { status = "actively-developed" }

View File

@@ -4,6 +4,7 @@ use std::fmt::{Display, LowerHex};
use std::path::Path; use std::path::Path;
use std::str; use std::str;
use wasmtime::*; use wasmtime::*;
use wast::lexer::Lexer;
use wast::Wat; use wast::Wat;
use wast::{ use wast::{
parser::{self, ParseBuffer}, parser::{self, ParseBuffer},
@@ -215,8 +216,10 @@ impl<T> WastContext<T> {
err err
}; };
let buf = wast::parser::ParseBuffer::new(wast).map_err(adjust_wast)?; let mut lexer = Lexer::new(wast);
let ast = wast::parser::parse::<wast::Wast>(&buf).map_err(adjust_wast)?; lexer.allow_confusing_unicode(filename.ends_with("names.wast"));
let buf = ParseBuffer::new_with_lexer(lexer).map_err(adjust_wast)?;
let ast = parser::parse::<wast::Wast>(&buf).map_err(adjust_wast)?;
for directive in ast.directives { for directive in ast.directives {
let sp = directive.span(); let sp = directive.span();

View File

@@ -118,7 +118,7 @@
i32.const 1 i32.const 1
i32.const 0 i32.const 0
i32.const 4 i32.const 4
memory.init $d $m1 memory.init $m1 $d
i32.const 1 i32.const 1
i32.load) i32.load)
@@ -126,7 +126,7 @@
i32.const 1 i32.const 1
i32.const 4 i32.const 4
i32.const 4 i32.const 4
memory.init $d $m2 memory.init $m2 $d
i32.const 1 i32.const 1
i32.load (memory $m2)) i32.load (memory $m2))