Merge remote-tracking branch 'origin/main' into pch/factor_borrowchecker_out_of_wiggle

This commit is contained in:
Pat Hickey
2020-06-30 11:25:23 -07:00
31 changed files with 236 additions and 74 deletions

View File

@@ -13,7 +13,7 @@ edition = "2018"
[dependencies]
gimli = "0.21.0"
wasmparser = "0.57.0"
wasmparser = "0.58.0"
object = { version = "0.19", default-features = false, features = ["write"] }
wasmtime-environ = { path = "../environ", version = "0.18.0" }
target-lexicon = { version = "0.10.0", default-features = false }

View File

@@ -6,7 +6,7 @@ use gimli::{
};
use std::collections::HashMap;
use std::path::PathBuf;
use wasmparser::{self, ModuleReader, SectionCode};
use wasmparser::{self, ModuleReader, SectionCode, TypeDef};
trait Reader: gimli::Reader<Offset = usize, Endian = LittleEndian> {}
@@ -186,7 +186,13 @@ pub fn read_debuginfo(data: &[u8]) -> Result<DebugInfoData> {
signatures_params = section
.get_type_section_reader()?
.into_iter()
.map(|ft| Ok(ft?.params))
.map(|ft| {
if let Ok(TypeDef::Func(ft)) = ft {
Ok(ft.params)
} else {
unimplemented!("module linking not implemented yet")
}
})
.collect::<Result<Vec<_>>>()?;
}
SectionCode::Import => {

View File

@@ -16,7 +16,7 @@ anyhow = "1.0"
cranelift-codegen = { path = "../../cranelift/codegen", version = "0.65.0", features = ["enable-serde"] }
cranelift-entity = { path = "../../cranelift/entity", version = "0.65.0", features = ["enable-serde"] }
cranelift-wasm = { path = "../../cranelift/wasm", version = "0.65.0", features = ["enable-serde"] }
wasmparser = "0.57.0"
wasmparser = "0.58.0"
lightbeam = { path = "../lightbeam", optional = true, version = "0.18.0" }
indexmap = "1.0.2"
rayon = "1.2.1"

View File

@@ -13,7 +13,7 @@ binaryen = { version = "0.10.0", optional = true }
env_logger = "0.7.1"
log = "0.4.8"
rayon = "1.2.1"
wasmparser = "0.57.0"
wasmparser = "0.58.0"
wasmprinter = "0.2.5"
wasmtime = { path = "../wasmtime" }
wasmtime-wast = { path = "../wast" }

View File

@@ -24,7 +24,7 @@ wasmtime-profiling = { path = "../profiling", version = "0.18.0" }
region = "2.1.0"
thiserror = "1.0.4"
target-lexicon = { version = "0.10.0", default-features = false }
wasmparser = "0.57.0"
wasmparser = "0.58.0"
more-asserts = "0.2.1"
anyhow = "1.0"
cfg-if = "0.1.9"

View File

@@ -24,7 +24,7 @@ smallvec = "1.0.0"
staticvec = "0.10"
thiserror = "1.0.9"
typemap = "0.3"
wasmparser = "0.57.0"
wasmparser = "0.58.0"
[dev-dependencies]
lazy_static = "1.2"

View File

@@ -5,14 +5,18 @@ use cranelift_codegen::{binemit, ir};
use wasmparser::{
CodeSectionReader, DataSectionReader, ElementSectionReader, ExportSectionReader, FuncType,
FunctionSectionReader, GlobalSectionReader, ImportSectionReader, MemorySectionReader,
MemoryType, TableSectionReader, TableType, TypeSectionReader,
MemoryType, TableSectionReader, TableType, TypeDef, TypeSectionReader,
};
/// Parses the Type section of the wasm module.
pub fn type_(types_reader: TypeSectionReader) -> Result<Vec<FuncType>, Error> {
types_reader
.into_iter()
.map(|r| r.map_err(Into::into))
.map(|r| match r {
Ok(TypeDef::Func(ft)) => Ok(ft),
Ok(_) => unimplemented!("module linking is not implemented yet"),
Err(e) => Err(e.into()),
})
.collect()
}

View File

@@ -21,7 +21,7 @@
//! The `VMExternData` struct is *preceded* by the dynamically-sized value boxed
//! up and referenced by one or more `VMExternRef`s:
//!
//! ```ignore
//! ```text
//! ,-------------------------------------------------------.
//! | |
//! V |

View File

@@ -14,7 +14,7 @@ wasmtime-runtime = { path = "../runtime", version = "0.18.0" }
wasmtime-environ = { path = "../environ", version = "0.18.0" }
wasmtime-jit = { path = "../jit", version = "0.18.0" }
wasmtime-profiling = { path = "../profiling", version = "0.18.0" }
wasmparser = "0.57.0"
wasmparser = "0.58.0"
target-lexicon = { version = "0.10.0", default-features = false }
anyhow = "1.0.19"
region = "2.1.0"

View File

@@ -89,6 +89,7 @@ impl Config {
enable_simd: false,
enable_multi_value: true,
enable_tail_call: false,
enable_module_linking: false,
},
},
flags,

View File

@@ -61,7 +61,7 @@ pub use region::Region;
///
/// # Using References
///
/// The [`GuestMemory::as_slice`] or [`GuestPtr::as_str`] will return smart
/// The [`GuestPtr::as_slice`] or [`GuestPtr::as_str`] will return smart
/// pointers [`GuestSlice`] and [`GuestStr`]. These types, which implement
/// [`std::ops::Deref`] and [`std::ops::DerefMut`], provide mutable references
/// into the memory region given by a `GuestMemory`.

View File

@@ -21,7 +21,7 @@ use config::{MissingMemoryConf, ModuleConf, TargetConf};
/// where the macro is invoked. `witx_literal` takes a string of the witx document, e.g.
/// `"(typename $foo u8)"`.
/// * `ctx`: The context struct used for the Wiggle implementation. This must be the same
/// type as the [`wasmtime_wiggle::from_witx`] macro at `target` was invoked with. However, it
/// type as the `wasmtime_wiggle::from_witx` macro at `target` was invoked with. However, it
/// must be imported to the current scope so that it is a bare identifier e.g. `CtxType`, not
/// `path::to::CtxType`.
/// * `modules`: Describes how any modules in the witx document will be implemented as Wasmtime