Merge branch 'master' into clif-backend

This commit is contained in:
Brandon Fish 2019-08-01 11:59:02 -06:00 committed by GitHub
commit dfef2b6899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 798 additions and 579 deletions

View File

@ -47,16 +47,17 @@ install:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
build_script: build_script:
- cargo build --release --verbose - cargo build --release --verbose --features backend-llvm
- git submodule init
- git submodule update
- if %APPVEYOR_REPO_BRANCH%==master cargo build --release --manifest-path wapm-cli/Cargo.toml --features "telemetry update-notifications"
- cargo build --release --manifest-path lib/runtime-c-api/Cargo.toml - cargo build --release --manifest-path lib/runtime-c-api/Cargo.toml
test_script: test_script:
- cargo test --manifest-path lib/spectests/Cargo.toml --features clif - cargo test --manifest-path lib/spectests/Cargo.toml --features clif
before_deploy: before_deploy:
- appveyor PushArtifact target\release\wasmer_runtime_c_api.dll
- git submodule init
- git submodule update
- cargo build --release --manifest-path wapm-cli/Cargo.toml --features "telemetry update-notifications"
- cd ./src/installer - cd ./src/installer
- iscc wasmer.iss - iscc wasmer.iss
- copy /y .\WasmerInstaller.exe ..\..\WasmerInstaller-%APPVEYOR_REPO_TAG_NAME%.exe - copy /y .\WasmerInstaller.exe ..\..\WasmerInstaller-%APPVEYOR_REPO_TAG_NAME%.exe

View File

@ -75,9 +75,6 @@ jobs:
make cranelift make cranelift
make llvm make llvm
make test-rest make test-rest
- run:
name: Release
command: make release-fast
- run: - run:
name: Integration Tests name: Integration Tests
command: make integration-tests command: make integration-tests
@ -116,10 +113,8 @@ jobs:
command: | command: |
make check make check
make compile-bench-singlepass make compile-bench-singlepass
# TODO: add compile-bench-llvm and compile-bench-clif when they work make compile-bench-llvm
- run: # TODO: add compile-bench-clif when it works
name: Release
command: make release-fast
- run: - run:
name: Integration Tests name: Integration Tests
command: make integration-tests command: make integration-tests
@ -195,11 +190,6 @@ jobs:
export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH"
export LLVM_SYS_80_PREFIX="`pwd`/clang+llvm-8.0.0-x86_64-apple-darwin/" export LLVM_SYS_80_PREFIX="`pwd`/clang+llvm-8.0.0-x86_64-apple-darwin/"
make check make check
- run:
name: Release
command: |
export PATH="$HOME/.cargo/bin:$PATH"
make release-fast
- run: - run:
name: Integration Tests name: Integration Tests
command: | command: |

View File

@ -5,6 +5,10 @@ All PRs to the Wasmer repository must add to this file.
Blocks of changes will separated by version increments. Blocks of changes will separated by version increments.
## **[Unreleased]** ## **[Unreleased]**
- [#609](https://github.com/wasmerio/wasmer/issues/609) Update dependencies
## 0.6.0 - 2019-07-31
- [#603](https://github.com/wasmerio/wasmer/pull/603) Update Wapm-cli, bump version numbers
- [#595](https://github.com/wasmerio/wasmer/pull/595) Add unstable public API for interfacing with the WASI file system in plugin-like usecases - [#595](https://github.com/wasmerio/wasmer/pull/595) Add unstable public API for interfacing with the WASI file system in plugin-like usecases
- [#598](https://github.com/wasmerio/wasmer/pull/598) LLVM Backend is now supported in Windows - [#598](https://github.com/wasmerio/wasmer/pull/598) LLVM Backend is now supported in Windows
- [#599](https://github.com/wasmerio/wasmer/pull/599) Fix llvm backend failures in fat spec tests and simd_binaryen spec test. - [#599](https://github.com/wasmerio/wasmer/pull/599) Fix llvm backend failures in fat spec tests and simd_binaryen spec test.

726
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer" name = "wasmer"
version = "0.5.7" version = "0.6.0"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018" edition = "2018"
repository = "https://github.com/wasmerio/wasmer" repository = "https://github.com/wasmerio/wasmer"
@ -19,11 +19,10 @@ include = [
] ]
[dependencies] [dependencies]
byteorder = "1.3.1" byteorder = "1.3.2"
errno = "0.2.4" errno = "0.2.4"
structopt = "0.2.11" structopt = "0.2.18"
wabt = "0.9.0" wabt = "0.9.0"
hashbrown = "0.1.8"
wasmer-clif-backend = { path = "lib/clif-backend" } wasmer-clif-backend = { path = "lib/clif-backend" }
wasmer-singlepass-backend = { path = "lib/singlepass-backend", optional = true } wasmer-singlepass-backend = { path = "lib/singlepass-backend", optional = true }
wasmer-middleware-common = { path = "lib/middleware-common" } wasmer-middleware-common = { path = "lib/middleware-common" }
@ -62,7 +61,7 @@ members = [
[build-dependencies] [build-dependencies]
wabt = "0.9.0" wabt = "0.9.0"
glob = "0.2.11" glob = "0.3.0"
rustc_version = "0.2.3" rustc_version = "0.2.3"
[features] [features]

View File

@ -104,7 +104,7 @@ test: spectests emtests middleware wasitests circleci-clean test-rest
# Integration tests # Integration tests
integration-tests: release-fast integration-tests: release-clif
echo "Running Integration Tests" echo "Running Integration Tests"
./integration_tests/lua/test.sh ./integration_tests/lua/test.sh
./integration_tests/nginx/test.sh ./integration_tests/nginx/test.sh
@ -130,7 +130,7 @@ release:
cargo build --release --features backend-singlepass,backend-llvm,loader-kernel cargo build --release --features backend-singlepass,backend-llvm,loader-kernel
# Only one backend (cranelift) # Only one backend (cranelift)
release-fast: release-clif:
# If you are in OS-X, you will need mingw-w64 for cross compiling to windows # If you are in OS-X, you will need mingw-w64 for cross compiling to windows
# brew install mingw-w64 # brew install mingw-w64
cargo build --release cargo build --release

View File

@ -29,10 +29,13 @@ Install Wasmer with:
curl https://get.wasmer.io -sSfL | sh curl https://get.wasmer.io -sSfL | sh
``` ```
> Note: *Wasmer is also available on Windows. Download the [`WasmerInstaller.exe` from the Github Releases](https://github.com/wasmerio/wasmer/releases) page.*
Wasmer runtime can also be embedded in different languages, so you can use WebAssembly anywhere ✨: Wasmer runtime can also be embedded in different languages, so you can use WebAssembly anywhere ✨:
* [🦀 **Rust**](https://github.com/wasmerio/wasmer-rust-example) * [**🦀 Rust**](https://github.com/wasmerio/wasmer-rust-example)
* [**C/C++**](https://github.com/wasmerio/wasmer-c-api) * [**🔗 C/C++**](https://github.com/wasmerio/wasmer-c-api)
* [**#️⃣ C#**](https://github.com/migueldeicaza/WasmerSharp)
* [**🐘 PHP**](https://github.com/wasmerio/php-ext-wasm) * [**🐘 PHP**](https://github.com/wasmerio/php-ext-wasm)
* [**🐍 Python**](https://github.com/wasmerio/python-ext-wasm) * [**🐍 Python**](https://github.com/wasmerio/python-ext-wasm)
* [**💎 Ruby**](https://github.com/wasmerio/ruby-ext-wasm) * [**💎 Ruby**](https://github.com/wasmerio/ruby-ext-wasm)
@ -82,7 +85,7 @@ Wasmer is structured into different directories:
Building Wasmer requires [rustup](https://rustup.rs/). Building Wasmer requires [rustup](https://rustup.rs/).
To build on Windows, download and run [`rustup-init.exe`](https://win.rustup.rs/) To build Wasmer on Windows, download and run [`rustup-init.exe`](https://win.rustup.rs/)
then follow the onscreen instructions. then follow the onscreen instructions.
To build on other systems, run: To build on other systems, run:
@ -146,8 +149,8 @@ pkg install cmake
#### Windows (MSVC) #### Windows (MSVC)
Windows support is _highly experimental_. Only simple Wasm programs may be run, and no syscalls are allowed. This means Windows support is _experimental_. WASI is fully supported, but Emscripten support is on the works (this means
nginx and Lua do not work on Windows. See [this issue](https://github.com/wasmerio/wasmer/issues/176) regarding Emscripten syscall polyfills for Windows. nginx and Lua do not work on Windows - you can track the progress on [this issue](https://github.com/wasmerio/wasmer/issues/176)).
1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) 1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15)
@ -181,8 +184,14 @@ git clone https://github.com/wasmerio/wasmer.git
cd wasmer cd wasmer
# install tools # install tools
# make sure that `python` is accessible. make release-clif # To build with cranelift (default)
make install
make release-llvm # To build with llvm support
make release-singlepass # To build with singlepass support
# or
make release # To build with singlepass, cranelift and llvm support
``` ```
## Testing ## Testing
@ -240,7 +249,7 @@ Below are some of the goals of this project (in order of priority):
## Architecture ## Architecture
If you would like to know how Wasmer works under the hood, please see [ARCHITECTURE.md](./ARCHITECTURE.md). If you would like to know how Wasmer works under the hood, please see [docs/architecture.md](./docs/architecture.md).
## License ## License

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-clif-backend" name = "wasmer-clif-backend"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime Cranelift compiler backend" description = "Wasmer runtime Cranelift compiler backend"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -9,33 +9,33 @@ edition = "2018"
readme = "README.md" readme = "README.md"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
cranelift-native = { version = "0.31" } cranelift-native = { version = "0.31" }
cranelift-codegen = { version = "0.31" } cranelift-codegen = { version = "0.31" }
cranelift-entity = { version = "0.31" } cranelift-entity = { version = "0.31" }
cranelift-frontend = { package = "wasmer-clif-fork-frontend", version = "0.32" } cranelift-frontend = { package = "wasmer-clif-fork-frontend", version = "0.33" }
cranelift-wasm = { package = "wasmer-clif-fork-wasm", version = "0.32" } cranelift-wasm = { package = "wasmer-clif-fork-wasm", version = "0.33" }
hashbrown = "0.1"
target-lexicon = "0.4.0" target-lexicon = "0.4.0"
wasmparser = "0.34.0" wasmparser = "0.35.1"
byteorder = "1" byteorder = "1.3.2"
nix = "0.14.0" nix = "0.14.1"
libc = "0.2.49" libc = "0.2.60"
rayon = "1.0" rayon = "1.1.0"
# Dependencies for caching. # Dependencies for caching.
[dependencies.serde] [dependencies.serde]
version = "1.0" version = "1.0.98"
features = ["rc"]
[dependencies.serde_derive] [dependencies.serde_derive]
version = "1.0" version = "1.0.98"
[dependencies.serde_bytes] [dependencies.serde_bytes]
version = "0.10" version = "0.11.1"
[dependencies.serde-bench] [dependencies.serde-bench]
version = "0.0.7" version = "0.0.7"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["errhandlingapi", "minwindef", "minwinbase", "winnt"] } winapi = { version = "0.3.7", features = ["errhandlingapi", "minwindef", "minwinbase", "winnt"] }
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.5.7" } wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.6.0" }
[features] [features]
debug = ["wasmer-runtime-core/debug"] debug = ["wasmer-runtime-core/debug"]

View File

@ -1,6 +1,6 @@
use crate::relocation::{ExternalRelocation, TrapSink}; use crate::relocation::{ExternalRelocation, TrapSink};
use hashbrown::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
use wasmer_runtime_core::{ use wasmer_runtime_core::{
backend::{sys::Memory, CacheGen}, backend::{sys::Memory, CacheGen},

View File

@ -5,7 +5,7 @@ use cranelift_codegen::{
ir::{self, InstBuilder}, ir::{self, InstBuilder},
isa, Context, isa, Context,
}; };
use hashbrown::HashMap; use std::collections::HashMap;
use std::{iter, mem, ptr::NonNull}; use std::{iter, mem, ptr::NonNull};
use wasmer_runtime_core::{ use wasmer_runtime_core::{
backend::sys::{Memory, Protect}, backend::sys::{Memory, Protect},

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-dev-utils" name = "wasmer-dev-utils"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime core library" description = "Wasmer runtime core library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,4 +8,4 @@ edition = "2018"
repository = "https://github.com/wasmerio/wasmer" repository = "https://github.com/wasmerio/wasmer"
[dependencies] [dependencies]
libc = "0.2.49" libc = "0.2.60"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-emscripten-tests" name = "wasmer-emscripten-tests"
version = "0.5.7" version = "0.6.0"
description = "Tests for our Emscripten implementation" description = "Tests for our Emscripten implementation"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -9,18 +9,18 @@ publish = false
build = "build/mod.rs" build = "build/mod.rs"
[dependencies] [dependencies]
wasmer-emscripten = { path = "../emscripten", version = "0.5.7" } wasmer-emscripten = { path = "../emscripten", version = "0.6.0" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.7" } wasmer-clif-backend = { path = "../clif-backend", version = "0.6.0" }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.7", optional = true } wasmer-llvm-backend = { path = "../llvm-backend", version = "0.6.0", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.7", optional = true } wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.6.0", optional = true }
[dev-dependencies] [dev-dependencies]
wabt = "0.9.0" wabt = "0.9.0"
wasmer-dev-utils = { path = "../dev-utils", version = "0.5.7"} wasmer-dev-utils = { path = "../dev-utils", version = "0.6.0"}
[build-dependencies] [build-dependencies]
glob = "0.2.11" glob = "0.3.0"
[features] [features]
clif = [] clif = []

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-emscripten" name = "wasmer-emscripten"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime emscripten implementation library" description = "Wasmer runtime emscripten implementation library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,15 +8,14 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
byteorder = "1" byteorder = "1.3.2"
hashbrown = "0.1" lazy_static = "1.3.0"
lazy_static = "1.2.0" libc = "0.2.60"
libc = "0.2.49" time = "0.1.42"
time = "0.1.41" wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" }
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
rand = "0.6" rand = "0.7.0"
[features] [features]
debug = ["wasmer-runtime-core/debug"] debug = ["wasmer-runtime-core/debug"]

View File

@ -3,9 +3,9 @@
#[macro_use] #[macro_use]
extern crate wasmer_runtime_core; extern crate wasmer_runtime_core;
use hashbrown::HashMap;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::cell::UnsafeCell; use std::cell::UnsafeCell;
use std::collections::HashMap;
use std::path::PathBuf; use std::path::PathBuf;
use std::{f64, ffi::c_void}; use std::{f64, ffi::c_void};
use wasmer_runtime_core::{ use wasmer_runtime_core::{

View File

@ -5,5 +5,5 @@ authors = ["Heyang Zhou <zhy20000919@hotmail.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
libc = "0.2.49" libc = "0.2.60"
wasmer-runtime-core = { path = "../runtime-core" } wasmer-runtime-core = { path = "../runtime-core" }

View File

@ -1,19 +1,18 @@
[package] [package]
name = "wasmer-llvm-backend" name = "wasmer-llvm-backend"
version = "0.5.7" version = "0.6.0"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018" edition = "2018"
readme = "README.md" readme = "README.md"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
wasmparser = "0.34.0" wasmparser = "0.35.1"
hashbrown = "0.1.8" smallvec = "0.6.10"
smallvec = "0.6.8" goblin = "0.0.24"
goblin = "0.0.20" libc = "0.2.60"
libc = "0.2.49" nix = "0.14.1"
nix = "0.14.0" capstone = { version = "0.6.0", optional = true }
capstone = { version = "0.5.0", optional = true }
[dependencies.inkwell] [dependencies.inkwell]
git = "https://github.com/wasmerio/inkwell" git = "https://github.com/wasmerio/inkwell"
@ -22,12 +21,12 @@ default-features = false
features = ["llvm8-0", "target-x86"] features = ["llvm8-0", "target-x86"]
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["memoryapi"] } winapi = { version = "0.3.7", features = ["memoryapi"] }
[build-dependencies] [build-dependencies]
cc = "1.0" cc = "1.0"
lazy_static = "1.2.0" lazy_static = "1.3.0"
regex = "1.1.0" regex = "1.2.0"
semver = "0.9" semver = "0.9"
rustc_version = "0.2.3" rustc_version = "0.2.3"

View File

@ -594,14 +594,6 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
} }
fn feed_event(&mut self, event: Event, module_info: &ModuleInfo) -> Result<(), CodegenError> { fn feed_event(&mut self, event: Event, module_info: &ModuleInfo) -> Result<(), CodegenError> {
let op = match event {
Event::Wasm(x) => x,
Event::Internal(_x) => {
return Ok(());
}
Event::WasmOwned(ref x) => x,
};
let mut state = &mut self.state; let mut state = &mut self.state;
let builder = self.builder.as_ref().unwrap(); let builder = self.builder.as_ref().unwrap();
let context = self.context.as_ref().unwrap(); let context = self.context.as_ref().unwrap();
@ -612,6 +604,38 @@ impl FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator {
let signatures = &self.signatures; let signatures = &self.signatures;
let mut ctx = self.ctx.as_mut().unwrap(); let mut ctx = self.ctx.as_mut().unwrap();
let op = match event {
Event::Wasm(x) => x,
Event::WasmOwned(ref x) => x,
Event::Internal(x) => {
match x {
InternalEvent::FunctionBegin(_) | InternalEvent::FunctionEnd => {
return Ok(());
}
InternalEvent::Breakpoint(_callback) => {
return Ok(());
}
InternalEvent::GetInternal(idx) => {
if state.reachable {
let idx = idx as usize;
let field_ptr = ctx.internal_field(idx, intrinsics, builder);
let result = builder.build_load(field_ptr, "get_internal");
state.push1(result);
}
}
InternalEvent::SetInternal(idx) => {
if state.reachable {
let idx = idx as usize;
let field_ptr = ctx.internal_field(idx, intrinsics, builder);
let v = state.pop1()?;
builder.build_store(field_ptr, v);
}
}
}
return Ok(());
}
};
if !state.reachable { if !state.reachable {
match *op { match *op {
Operator::Block { ty: _ } | Operator::Loop { ty: _ } | Operator::If { ty: _ } => { Operator::Block { ty: _ } | Operator::Loop { ty: _ } | Operator::If { ty: _ } => {

View File

@ -1,4 +1,3 @@
use hashbrown::HashMap;
use inkwell::{ use inkwell::{
builder::Builder, builder::Builder,
context::Context, context::Context,
@ -9,6 +8,7 @@ use inkwell::{
values::{BasicValue, BasicValueEnum, FloatValue, FunctionValue, IntValue, PointerValue}, values::{BasicValue, BasicValueEnum, FloatValue, FunctionValue, IntValue, PointerValue},
AddressSpace, AddressSpace,
}; };
use std::collections::HashMap;
use std::marker::PhantomData; use std::marker::PhantomData;
use wasmer_runtime_core::{ use wasmer_runtime_core::{
memory::MemoryType, memory::MemoryType,
@ -18,7 +18,7 @@ use wasmer_runtime_core::{
GlobalIndex, ImportedFuncIndex, LocalFuncIndex, LocalOrImport, MemoryIndex, SigIndex, GlobalIndex, ImportedFuncIndex, LocalFuncIndex, LocalOrImport, MemoryIndex, SigIndex,
TableIndex, Type, TableIndex, Type,
}, },
vm::Ctx, vm::{Ctx, INTERNALS_SIZE},
}; };
fn type_to_llvm_ptr(intrinsics: &Intrinsics, ty: Type) -> PointerType { fn type_to_llvm_ptr(intrinsics: &Intrinsics, ty: Type) -> PointerType {
@ -942,4 +942,31 @@ impl<'a> CtxType<'a> {
(imported_func_cache.func_ptr, imported_func_cache.ctx_ptr) (imported_func_cache.func_ptr, imported_func_cache.ctx_ptr)
} }
pub fn internal_field(
&mut self,
index: usize,
intrinsics: &Intrinsics,
builder: &Builder,
) -> PointerValue {
assert!(index < INTERNALS_SIZE);
let local_internals_ptr_ptr = unsafe {
builder.build_struct_gep(
self.ctx_ptr_value,
offset_to_index(Ctx::offset_internals()),
"local_internals_ptr_ptr",
)
};
let local_internals_ptr = builder
.build_load(local_internals_ptr_ptr, "local_internals_ptr")
.into_pointer_value();
unsafe {
builder.build_in_bounds_gep(
local_internals_ptr,
&[intrinsics.i32_ty.const_int(index as u64, false)],
"local_internal_field_ptr",
)
}
}
} }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-middleware-common" name = "wasmer-middleware-common"
version = "0.5.7" version = "0.6.0"
repository = "https://github.com/wasmerio/wasmer" repository = "https://github.com/wasmerio/wasmer"
description = "Wasmer runtime common middlewares" description = "Wasmer runtime common middlewares"
license = "MIT" license = "MIT"
@ -9,9 +9,9 @@ edition = "2018"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core" } wasmer-runtime-core = { path = "../runtime-core" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.7" } wasmer-clif-backend = { path = "../clif-backend", version = "0.6.0" }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.7", optional = true } wasmer-llvm-backend = { path = "../llvm-backend", version = "0.6.0", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.7", optional = true } wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.6.0", optional = true }
[dev-dependencies] [dev-dependencies]
wabt = "0.9.0" wabt = "0.9.0"

View File

@ -135,10 +135,9 @@ static WAT_GAS: &'static str = r#"
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
fn get_compiler(limit: u64, metering: bool) -> impl Compiler { fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
use wasmer_llvm_backend::code::LLVMModuleCodeGenerator; use wasmer_llvm_backend::ModuleCodeGenerator;
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
let c: StreamingCompiler<LLVMModuleCodeGenerator, _, _, _, _> = let c: StreamingCompiler<ModuleCodeGenerator, _, _, _, _> = StreamingCompiler::new(move || {
StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new(); let mut chain = MiddlewareChain::new();
if metering { if metering {
chain.push(Metering::new(limit)); chain.push(Metering::new(limit));

View File

@ -134,14 +134,13 @@ mod tests {
use super::*; use super::*;
use wabt::wat2wasm; use wabt::wat2wasm;
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func}; use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func};
#[cfg(feature = "llvm")] #[cfg(feature = "llvm")]
fn get_compiler(limit: u64) -> impl Compiler { fn get_compiler(limit: u64) -> impl Compiler {
use wasmer_llvm_backend::code::LLVMModuleCodeGenerator; use wasmer_llvm_backend::ModuleCodeGenerator as LLVMMCG;
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler}; let c: StreamingCompiler<LLVMMCG, _, _, _, _> = StreamingCompiler::new(move || {
let c: StreamingCompiler<LLVMModuleCodeGenerator, _, _, _, _> =
StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new(); let mut chain = MiddlewareChain::new();
chain.push(Metering::new(limit)); chain.push(Metering::new(limit));
chain chain
@ -151,7 +150,6 @@ mod tests {
#[cfg(feature = "singlepass")] #[cfg(feature = "singlepass")]
fn get_compiler(limit: u64) -> impl Compiler { fn get_compiler(limit: u64) -> impl Compiler {
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG; use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || { let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new(); let mut chain = MiddlewareChain::new();

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-runtime-abi" name = "wasmer-runtime-abi"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime core library" description = "Wasmer runtime core library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,12 +8,11 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
libc = "0.2.50" libc = "0.2.60"
wasmer-runtime-core = { path = "../runtime-core" } wasmer-runtime-core = { path = "../runtime-core" }
hashbrown = "0.1"
failure = "0.1" failure = "0.1"
tar = "0.4" tar = "0.4"
wasmparser = "0.34.0" wasmparser = "0.35.1"
zstd = "0.4" zstd = "0.4"
# [target.'cfg(unix)'.dependencies.zbox] # [target.'cfg(unix)'.dependencies.zbox]

View File

@ -1,7 +1,7 @@
use crate::vfs::file_like::FileLike; use crate::vfs::file_like::FileLike;
use crate::vfs::vfs_header::{header_from_bytes, ArchiveType, CompressionType}; use crate::vfs::vfs_header::{header_from_bytes, ArchiveType, CompressionType};
use crate::vfs::virtual_file::VirtualFile; use crate::vfs::virtual_file::VirtualFile;
use hashbrown::HashMap; use std::collections::HashMap;
use std::cell::RefCell; use std::cell::RefCell;
use std::io; use std::io;
use std::io::Read; use std::io::Read;

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-runtime-c-api" name = "wasmer-runtime-c-api"
version = "0.5.7" version = "0.6.0"
description = "Wasmer C API library" description = "Wasmer C API library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -12,19 +12,19 @@ readme = "README.md"
crate-type = ["cdylib", "rlib", "staticlib"] crate-type = ["cdylib", "rlib", "staticlib"]
[dependencies] [dependencies]
libc = "0.2" libc = "0.2.60"
[dependencies.wasmer-runtime] [dependencies.wasmer-runtime]
path = "../runtime" path = "../runtime"
version = "0.5.7" version = "0.6.0"
[dependencies.wasmer-runtime-core] [dependencies.wasmer-runtime-core]
path = "../runtime-core" path = "../runtime-core"
version = "0.5.7" version = "0.6.0"
[features] [features]
debug = ["wasmer-runtime/debug"] debug = ["wasmer-runtime/debug"]
llvm = ["wasmer-runtime/llvm"] llvm = ["wasmer-runtime/llvm"]
[build-dependencies] [build-dependencies]
cbindgen = "0.8" cbindgen = "0.9.0"

View File

@ -11,7 +11,7 @@ thread_local! {
static LAST_ERROR: RefCell<Option<Box<Error>>> = RefCell::new(None); static LAST_ERROR: RefCell<Option<Box<Error>>> = RefCell::new(None);
} }
pub(crate) fn update_last_error<E: Error + 'static>(err: E) { pub fn update_last_error<E: Error + 'static>(err: E) {
LAST_ERROR.with(|prev| { LAST_ERROR.with(|prev| {
*prev.borrow_mut() = Some(Box::new(err)); *prev.borrow_mut() = Some(Box::new(err));
}); });
@ -89,8 +89,8 @@ pub unsafe extern "C" fn wasmer_last_error_message(buffer: *mut c_char, length:
} }
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct CApiError { pub struct CApiError {
pub(crate) msg: String, pub msg: String,
} }
impl Display for CApiError { impl Display for CApiError {

View File

@ -108,6 +108,19 @@ pub unsafe extern "C" fn wasmer_instantiate(
wasmer_result_t::WASMER_OK wasmer_result_t::WASMER_OK
} }
/// Extracts the instance's context and returns it.
#[allow(clippy::cast_ptr_alignment)]
#[no_mangle]
pub unsafe extern "C" fn wasmer_instance_context_get(
instance: *mut wasmer_instance_t,
) -> *const wasmer_instance_context_t {
let instance_ref = &*(instance as *const Instance);
let ctx: *const Ctx = instance_ref.context() as *const _;
ctx as *const wasmer_instance_context_t
}
/// Calls an instances exported function by `name` with the provided parameters. /// Calls an instances exported function by `name` with the provided parameters.
/// Results are set using the provided `results` pointer. /// Results are set using the provided `results` pointer.
/// ///

View File

@ -118,6 +118,6 @@ pub struct wasmer_limit_option_t {
#[repr(C)] #[repr(C)]
pub struct wasmer_byte_array { pub struct wasmer_byte_array {
bytes: *const u8, pub bytes: *const u8,
bytes_len: u32, pub bytes_len: u32,
} }

View File

@ -23,3 +23,4 @@ test-module-imports
test-module-serialize test-module-serialize
test-tables test-tables
test-validate test-validate
test-context

View File

@ -14,6 +14,7 @@ add_executable(test-module-imports test-module-imports.c)
add_executable(test-module-serialize test-module-serialize.c) add_executable(test-module-serialize test-module-serialize.c)
add_executable(test-tables test-tables.c) add_executable(test-tables test-tables.c)
add_executable(test-validate test-validate.c) add_executable(test-validate test-validate.c)
add_executable(test-context test-context.c)
find_library( find_library(
WASMER_LIB NAMES libwasmer_runtime_c_api.dylib libwasmer_runtime_c_api.so libwasmer_runtime_c_api.dll WASMER_LIB NAMES libwasmer_runtime_c_api.dylib libwasmer_runtime_c_api.so libwasmer_runtime_c_api.dll
@ -87,3 +88,7 @@ add_test(test-tables test-tables)
target_link_libraries(test-validate general ${WASMER_LIB}) target_link_libraries(test-validate general ${WASMER_LIB})
target_compile_options(test-validate PRIVATE ${COMPILER_OPTIONS}) target_compile_options(test-validate PRIVATE ${COMPILER_OPTIONS})
add_test(test-validate test-validate) add_test(test-validate test-validate)
target_link_libraries(test-context general ${WASMER_LIB})
target_compile_options(test-context PRIVATE ${COMPILER_OPTIONS})
add_test(test-context test-context)

Binary file not shown.

View File

@ -0,0 +1,7 @@
(module
(func $inc (import "env" "inc"))
(func $get (import "env" "get") (result i32))
(func (export "inc_and_get") (result i32)
call $inc
call $get))

View File

@ -4,19 +4,17 @@ use std::process::Command;
fn test_c_api() { fn test_c_api() {
let project_tests_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/tests"); let project_tests_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/tests");
run_command("cmake", project_tests_dir, Some(".")); run_command("cmake", project_tests_dir, vec!["."]);
run_command("make", project_tests_dir, Some("-Wdev -Werror=dev")); run_command("make", project_tests_dir, vec!["-Wdev", "-Werror=dev"]);
run_command("make", project_tests_dir, Some("test")); run_command("make", project_tests_dir, vec!["test", "ARGS=\"-V\""]);
} }
fn run_command(command_str: &str, dir: &str, arg: Option<&str>) { fn run_command(command_str: &str, dir: &str, args: Vec<&str>) {
println!("Running command: `{}` arg: {:?}", command_str, arg); println!("Running command: `{}` args: {:?}", command_str, args);
let mut command = Command::new(command_str); let mut command = Command::new(command_str);
if let Some(a) = arg { command.args(&args);
command.arg(a);
}
command.current_dir(dir); command.current_dir(dir);

View File

@ -0,0 +1,126 @@
#include <stdio.h>
#include "../wasmer.h"
#include <assert.h>
#include <stdint.h>
#include <string.h>
typedef struct {
int32_t amount;
int32_t value;
} counter_data;
typedef struct {
uint8_t* bytes;
long bytes_len;
} wasm_file_t;
wasm_file_t read_wasm_file(const char* file_name) {
wasm_file_t wasm_file;
FILE *file = fopen(file_name, "r");
fseek(file, 0, SEEK_END);
wasm_file.bytes_len = ftell(file);
wasm_file.bytes = malloc(wasm_file.bytes_len);
fseek(file, 0, SEEK_SET);
fread(wasm_file.bytes, 1, wasm_file.bytes_len, file);
fclose(file);
return wasm_file;
}
void inc_counter(wasmer_instance_context_t *ctx) {
counter_data* data = (counter_data*)wasmer_instance_context_data_get(ctx);
data->value = data->value + data->amount;
}
int32_t get_counter(wasmer_instance_context_t *ctx) {
counter_data* data = (counter_data*)wasmer_instance_context_data_get(ctx);
return data->value;
}
counter_data *init_counter(int32_t value, int32_t amount) {
counter_data* counter = malloc(sizeof(counter_data));
counter->value = value;
counter->amount = amount;
return counter;
}
void assert_counter(wasmer_instance_t *instance, int32_t expected) {
wasmer_value_t result_one;
wasmer_value_t params[] = {};
wasmer_value_t results[] = {result_one};
wasmer_result_t call1_result = wasmer_instance_call(instance, "inc_and_get", params, 0, results, 1);
printf("Call result: %d\n", call1_result);
printf("Result: %d\n", results[0].value.I32);
assert(results[0].value.I32 == expected);
assert(call1_result == WASMER_OK);
const wasmer_instance_context_t *ctx = wasmer_instance_context_get(instance);
counter_data *cd = (counter_data*)wasmer_instance_context_data_get(ctx);
assert(cd->value == expected);
}
wasmer_import_t create_import(char* module_name, char* import_name, wasmer_import_func_t *func) {
wasmer_import_t import;
wasmer_byte_array module_name_bytes;
wasmer_byte_array import_name_bytes;
module_name_bytes.bytes = (const uint8_t *) module_name;
module_name_bytes.bytes_len = strlen(module_name);
import_name_bytes.bytes = (const uint8_t *) import_name;
import_name_bytes.bytes_len = strlen(import_name);
import.module_name = module_name_bytes;
import.import_name = import_name_bytes;
import.tag = WASM_FUNCTION;
import.value.func = func;
return import;
}
int main()
{
// Prepare Imports
wasmer_value_tag inc_params_sig[] = {};
wasmer_value_tag inc_returns_sig[] = {};
wasmer_import_func_t *inc_func = wasmer_import_func_new((void (*)(void *)) inc_counter, inc_params_sig, 0, inc_returns_sig, 0);
wasmer_import_t inc_import = create_import("env", "inc", inc_func);
wasmer_value_tag get_params_sig[] = {};
wasmer_value_tag get_returns_sig[] = {WASM_I32};
wasmer_import_func_t *get_func = wasmer_import_func_new((void (*)(void *)) get_counter, get_params_sig, 0, get_returns_sig, 1);
wasmer_import_t get_import = create_import("env", "get", get_func);
wasmer_import_t imports[] = {inc_import, get_import};
// Read the wasm file
wasm_file_t wasm_file = read_wasm_file("assets/inc.wasm");
// Instantiate instance
printf("Instantiating\n");
wasmer_instance_t *instance = NULL;
wasmer_result_t compile_result = wasmer_instantiate(&instance, wasm_file.bytes, wasm_file.bytes_len, imports, 2);
printf("Compile result: %d\n", compile_result);
// Init counter
counter_data *counter = init_counter(2, 5);
wasmer_instance_context_data_set(instance, counter);
// Run `instance.inc_and_get` and assert
assert_counter(instance, 7);
assert_counter(instance, 12);
assert_counter(instance, 17);
// Clear resources
wasmer_import_func_destroy(inc_func);
wasmer_import_func_destroy(get_func);
wasmer_instance_destroy(instance);
free(counter);
free(wasm_file.bytes);
return 0;
}

View File

@ -42,8 +42,9 @@ int main()
assert(export_length == 5); assert(export_length == 5);
// Get the `memory` export. // Get the `memory` export.
wasmer_export_t *export = wasmer_exports_get(exports, 1); wasmer_export_t *export = wasmer_exports_get(exports, 0);
wasmer_import_export_kind kind = wasmer_export_kind(export); wasmer_import_export_kind kind = wasmer_export_kind(export);
printf("Wasmer import export kind: %d (Memory is %d)\n", kind, WASM_MEMORY);
assert(kind == WASM_MEMORY); assert(kind == WASM_MEMORY);
wasmer_byte_array export_name = wasmer_export_name(export); wasmer_byte_array export_name = wasmer_export_name(export);

View File

@ -417,6 +417,11 @@ void *wasmer_instance_context_data_get(const wasmer_instance_context_t *ctx);
*/ */
void wasmer_instance_context_data_set(wasmer_instance_t *instance, void *data_ptr); void wasmer_instance_context_data_set(wasmer_instance_t *instance, void *data_ptr);
/**
* Extracts the instance's context and returns it.
*/
const wasmer_instance_context_t *wasmer_instance_context_get(wasmer_instance_t *instance);
/** /**
* Gets the memory within the context at the index `memory_idx`. * Gets the memory within the context at the index `memory_idx`.
* The index is always 0 until multiple memories are supported. * The index is always 0 until multiple memories are supported.

View File

@ -337,6 +337,9 @@ void *wasmer_instance_context_data_get(const wasmer_instance_context_t *ctx);
/// passed to all imported function for instance. /// passed to all imported function for instance.
void wasmer_instance_context_data_set(wasmer_instance_t *instance, void *data_ptr); void wasmer_instance_context_data_set(wasmer_instance_t *instance, void *data_ptr);
/// Extracts the instance's context and returns it.
const wasmer_instance_context_t *wasmer_instance_context_get(wasmer_instance_t *instance);
/// Gets the memory within the context at the index `memory_idx`. /// Gets the memory within the context at the index `memory_idx`.
/// The index is always 0 until multiple memories are supported. /// The index is always 0 until multiple memories are supported.
const wasmer_memory_t *wasmer_instance_context_memory(const wasmer_instance_context_t *ctx, const wasmer_memory_t *wasmer_instance_context_memory(const wasmer_instance_context_t *ctx,

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-runtime-core" name = "wasmer-runtime-core"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime core library" description = "Wasmer runtime core library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,46 +8,46 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
nix = "0.14.0" nix = "0.14.1"
page_size = "0.4.1" page_size = "0.4.1"
wasmparser = "0.34.0" wasmparser = "0.35.1"
parking_lot = "0.7.1" parking_lot = "0.9.0"
lazy_static = "1.2.0" lazy_static = "1.3.0"
indexmap = "1.0.2"
errno = "0.2.4" errno = "0.2.4"
libc = "0.2.49" libc = "0.2.60"
hex = "0.3.2" hex = "0.3.2"
smallvec = "0.6.9" smallvec = "0.6.10"
bincode = "1.1" bincode = "1.1"
colored = "1.8" colored = "1.8"
[dependencies.indexmap]
version = "1.0.2"
features = ["serde-1"]
# Dependencies for caching. # Dependencies for caching.
[dependencies.serde] [dependencies.serde]
version = "1.0" version = "1.0.98"
# This feature is required for serde to support serializing/deserializing reference counted pointers (e.g. Rc and Arc). # This feature is required for serde to support serializing/deserializing reference counted pointers (e.g. Rc and Arc).
features = ["rc"] features = ["rc"]
[dependencies.serde_derive] [dependencies.serde_derive]
version = "1.0" version = "1.0.98"
[dependencies.serde_bytes] [dependencies.serde_bytes]
version = "0.10" version = "0.11.1"
[dependencies.serde-bench] [dependencies.serde-bench]
version = "0.0.7" version = "0.0.7"
[dependencies.blake2b_simd] [dependencies.blake2b_simd]
version = "0.4.1" version = "0.5.5"
[dependencies.digest] [dependencies.digest]
version = "0.8.0" version = "0.8.1"
[dependencies.hashbrown]
version = "0.1"
features = ["serde"]
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["memoryapi"] } winapi = { version = "0.3.7", features = ["memoryapi"] }
[dev-dependencies] [dev-dependencies]
field-offset = "0.1.1" field-offset = "0.1.1"
[build-dependencies] [build-dependencies]
blake2b_simd = "0.4.1" blake2b_simd = "0.5.5"
rustc_version = "0.2.3" rustc_version = "0.2.3"
cc = "1.0" cc = "1.0"

View File

@ -15,7 +15,7 @@ use crate::{
}; };
use std::{any::Any, ptr::NonNull}; use std::{any::Any, ptr::NonNull};
use hashbrown::HashMap; use std::collections::HashMap;
pub mod sys { pub mod sys {
pub use crate::sys::*; pub use crate::sys::*;

View File

@ -2,7 +2,7 @@ use crate::{
global::Global, instance::InstanceInner, memory::Memory, module::ExportIndex, global::Global, instance::InstanceInner, memory::Memory, module::ExportIndex,
module::ModuleInner, table::Table, types::FuncSig, vm, module::ModuleInner, table::Table, types::FuncSig, vm,
}; };
use hashbrown::hash_map; use indexmap::map::Iter as IndexMapIter;
use std::sync::Arc; use std::sync::Arc;
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
@ -41,7 +41,7 @@ impl FuncPointer {
pub struct ExportIter<'a> { pub struct ExportIter<'a> {
inner: &'a InstanceInner, inner: &'a InstanceInner,
iter: hash_map::Iter<'a, String, ExportIndex>, iter: IndexMapIter<'a, String, ExportIndex>,
module: &'a ModuleInner, module: &'a ModuleInner,
} }

View File

@ -1,6 +1,6 @@
use crate::export::Export; use crate::export::Export;
use hashbrown::{hash_map::Entry, HashMap};
use std::collections::VecDeque; use std::collections::VecDeque;
use std::collections::{hash_map::Entry, HashMap};
use std::{ use std::{
cell::{Ref, RefCell}, cell::{Ref, RefCell},
ffi::c_void, ffi::c_void,

View File

@ -14,8 +14,8 @@ use crate::{
}; };
use crate::backend::CacheGen; use crate::backend::CacheGen;
use hashbrown::HashMap;
use indexmap::IndexMap; use indexmap::IndexMap;
use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
/// This is used to instantiate a new WebAssembly module. /// This is used to instantiate a new WebAssembly module.
@ -40,7 +40,7 @@ pub struct ModuleInfo {
pub imported_tables: Map<ImportedTableIndex, (ImportName, TableDescriptor)>, pub imported_tables: Map<ImportedTableIndex, (ImportName, TableDescriptor)>,
pub imported_globals: Map<ImportedGlobalIndex, (ImportName, GlobalDescriptor)>, pub imported_globals: Map<ImportedGlobalIndex, (ImportName, GlobalDescriptor)>,
pub exports: HashMap<String, ExportIndex>, pub exports: IndexMap<String, ExportIndex>,
pub data_initializers: Vec<DataInitializer>, pub data_initializers: Vec<DataInitializer>,
pub elem_initializers: Vec<TableInitializer>, pub elem_initializers: Vec<TableInitializer>,

View File

@ -14,7 +14,7 @@ use crate::{
}, },
units::Pages, units::Pages,
}; };
use hashbrown::HashMap; use std::collections::HashMap;
use std::fmt::Debug; use std::fmt::Debug;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use wasmparser::{ use wasmparser::{

View File

@ -2,9 +2,9 @@ use crate::{
structures::Map, structures::Map,
types::{FuncSig, SigIndex}, types::{FuncSig, SigIndex},
}; };
use hashbrown::HashMap;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use parking_lot::RwLock; use parking_lot::RwLock;
use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;
lazy_static! { lazy_static! {

View File

@ -16,7 +16,7 @@ use serde::{
Deserialize, Deserializer, Serialize, Serializer, Deserialize, Deserializer, Serialize, Serializer,
}; };
use serde_bytes::Bytes; use serde_bytes::{ByteBuf, Bytes};
use std::fmt; use std::fmt;
@ -56,7 +56,7 @@ impl<'de> Deserialize<'de> for Memory {
.next_element()? .next_element()?
.ok_or_else(|| de::Error::invalid_length(0, &self))?; .ok_or_else(|| de::Error::invalid_length(0, &self))?;
let bytes: Bytes = seq let bytes: ByteBuf = seq
.next_element()? .next_element()?
.ok_or_else(|| de::Error::invalid_length(1, &self))?; .ok_or_else(|| de::Error::invalid_length(1, &self))?;

View File

@ -14,7 +14,7 @@ use std::{
sync::Once, sync::Once,
}; };
use hashbrown::HashMap; use std::collections::HashMap;
/// The context of the currently running WebAssembly instance. /// The context of the currently running WebAssembly instance.
/// ///
@ -850,8 +850,9 @@ mod vm_ctx_tests {
use crate::cache::Error as CacheError; use crate::cache::Error as CacheError;
use crate::typed_func::Wasm; use crate::typed_func::Wasm;
use crate::types::{LocalFuncIndex, SigIndex}; use crate::types::{LocalFuncIndex, SigIndex};
use hashbrown::HashMap; use indexmap::IndexMap;
use std::any::Any; use std::any::Any;
use std::collections::HashMap;
use std::ptr::NonNull; use std::ptr::NonNull;
struct Placeholder; struct Placeholder;
impl RunnableModule for Placeholder { impl RunnableModule for Placeholder {
@ -890,7 +891,7 @@ mod vm_ctx_tests {
imported_tables: Map::new(), imported_tables: Map::new(),
imported_globals: Map::new(), imported_globals: Map::new(),
exports: HashMap::new(), exports: IndexMap::new(),
data_initializers: Vec::new(), data_initializers: Vec::new(),
elem_initializers: Vec::new(), elem_initializers: Vec::new(),

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-runtime" name = "wasmer-runtime"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime library" description = "Wasmer runtime library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -9,21 +9,21 @@ edition = "2018"
readme = "README.md" readme = "README.md"
[dependencies] [dependencies]
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.7", optional = true } wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.6.0", optional = true }
lazy_static = "1.2.0" lazy_static = "1.3.0"
memmap = "0.7.0" memmap = "0.7.0"
[dependencies.wasmer-runtime-core] [dependencies.wasmer-runtime-core]
path = "../runtime-core" path = "../runtime-core"
version = "0.5.7" version = "0.6.0"
[dependencies.wasmer-clif-backend] [dependencies.wasmer-clif-backend]
path = "../clif-backend" path = "../clif-backend"
version = "0.5.7" version = "0.6.0"
optional = true optional = true
[dev-dependencies] [dev-dependencies]
tempfile = "3.0.7" tempfile = "3.1.0"
criterion = "0.2" criterion = "0.2"
wabt = "0.9.0" wabt = "0.9.0"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-singlepass-backend" name = "wasmer-singlepass-backend"
version = "0.5.7" version = "0.6.0"
repository = "https://github.com/wasmerio/wasmer" repository = "https://github.com/wasmerio/wasmer"
description = "Wasmer runtime single pass compiler backend" description = "Wasmer runtime single pass compiler backend"
license = "MIT" license = "MIT"
@ -9,14 +9,13 @@ edition = "2018"
readme = "README.md" readme = "README.md"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
wasmparser = "0.34.0" wasmparser = "0.35.1"
dynasm = "0.3.2" dynasm = "0.3.2"
dynasmrt = "0.3.1" dynasmrt = "0.3.1"
lazy_static = "1.2.0" lazy_static = "1.3.0"
byteorder = "1" byteorder = "1.3.2"
nix = "0.14.0" nix = "0.14.1"
libc = "0.2.49" libc = "0.2.60"
smallvec = "0.6.9" smallvec = "0.6.10"
hashbrown = "0.1"
colored = "1.8" colored = "1.8"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-spectests" name = "wasmer-spectests"
version = "0.5.7" version = "0.6.0"
description = "Wasmer spectests library" description = "Wasmer spectests library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -9,10 +9,10 @@ edition = "2018"
build = "build/mod.rs" build = "build/mod.rs"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.7" } wasmer-clif-backend = { path = "../clif-backend", version = "0.6.0" }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.7", optional = true } wasmer-llvm-backend = { path = "../llvm-backend", version = "0.6.0", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.7", optional = true } wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.6.0", optional = true }
[build-dependencies] [build-dependencies]
wabt = "0.9.0" wabt = "0.9.0"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-wasi-tests" name = "wasmer-wasi-tests"
version = "0.5.7" version = "0.6.0"
description = "Tests for our WASI implementation" description = "Tests for our WASI implementation"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -9,19 +9,19 @@ publish = false
build = "build/mod.rs" build = "build/mod.rs"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
wasmer-wasi = { path = "../wasi", version = "0.5.7" } wasmer-wasi = { path = "../wasi", version = "0.6.0" }
# hack to get tests to work # hack to get tests to work
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.5.7", optional = true } wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.6.0", optional = true }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.5.7", optional = true } wasmer-llvm-backend = { path = "../llvm-backend", version = "0.6.0", optional = true }
[build-dependencies] [build-dependencies]
glob = "0.2.11" glob = "0.3.0"
[dev-dependencies] [dev-dependencies]
wasmer-clif-backend = { path = "../clif-backend", version = "0.5.7" } wasmer-clif-backend = { path = "../clif-backend", version = "0.6.0" }
wasmer-dev-utils = { path = "../dev-utils", version = "0.5.7"} wasmer-dev-utils = { path = "../dev-utils", version = "0.6.0"}
[features] [features]
clif = [] clif = []

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-wasi" name = "wasmer-wasi"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime WASI implementation library" description = "Wasmer runtime WASI implementation library"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,14 +8,13 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
libc = "0.2.50" libc = "0.2.60"
rand = "0.6.5" rand = "0.7.0"
# wasmer-runtime-abi = { path = "../runtime-abi" } # wasmer-runtime-abi = { path = "../runtime-abi" }
hashbrown = "0.1.8"
generational-arena = "0.2.2" generational-arena = "0.2.2"
log = "0.4.6" log = "0.4.8"
byteorder = "1.3.1" byteorder = "1.3.2"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = "0.3" winapi = "0.3.7"

View File

@ -8,7 +8,7 @@
use crate::syscalls::types::*; use crate::syscalls::types::*;
use generational_arena::Arena; use generational_arena::Arena;
pub use generational_arena::Index as Inode; pub use generational_arena::Index as Inode;
use hashbrown::hash_map::HashMap; use std::collections::HashMap;
use std::{ use std::{
borrow::Borrow, borrow::Borrow,
cell::Cell, cell::Cell,

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wasmer-win-exception-handler" name = "wasmer-win-exception-handler"
version = "0.5.7" version = "0.6.0"
description = "Wasmer runtime exception handling for Windows" description = "Wasmer runtime exception handling for Windows"
license = "MIT" license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"] authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,11 +8,11 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018" edition = "2018"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.7" } wasmer-runtime-core = { path = "../runtime-core", version = "0.6.0" }
winapi = { version = "0.3", features = ["winbase", "errhandlingapi", "minwindef", "minwinbase", "winnt"] } winapi = { version = "0.3.7", features = ["winbase", "errhandlingapi", "minwindef", "minwinbase", "winnt"] }
libc = "0.2.49" libc = "0.2.60"
[build-dependencies] [build-dependencies]
cmake = "0.1.35" cmake = "0.1.40"
bindgen = "0.46.0" bindgen = "0.51.0"
regex = "1.0.6" regex = "1.2.0"

View File

@ -1,10 +1,13 @@
PREVIOUS_VERSION='0.5.6' PREVIOUS_VERSION='0.5.7'
NEXT_VERSION='0.5.7' NEXT_VERSION='0.6.0'
# quick hack # quick hack
fd Cargo.toml --exec sed -i '' "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/" fd Cargo.toml --exec sed -i '' "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/"
echo "manually check changes to Cargo.toml" echo "manually check changes to Cargo.toml"
fd wasmer.iss --exec sed -i '' "s/AppVersion=$PREVIOUS_VERSION/AppVersion=$NEXT_VERSION/"
echo "manually check changes to wasmer.iss"
# Order to upload packages in # Order to upload packages in
## runtime-core ## runtime-core
## win-exception-handler ## win-exception-handler

View File

@ -10,7 +10,7 @@ use std::path::PathBuf;
use std::process::exit; use std::process::exit;
use std::str::FromStr; use std::str::FromStr;
use hashbrown::HashMap; use std::collections::HashMap;
use structopt::StructOpt; use structopt::StructOpt;
use wasmer::*; use wasmer::*;

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 958 KiB

After

Width:  |  Height:  |  Size: 958 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -1,6 +1,6 @@
[Setup] [Setup]
AppName=Wasmer AppName=Wasmer
AppVersion=0.4.0 AppVersion=0.6.0
DefaultDirName={pf}\Wasmer DefaultDirName={pf}\Wasmer
DefaultGroupName=Wasmer DefaultGroupName=Wasmer
Compression=lzma2 Compression=lzma2
@ -9,9 +9,9 @@ OutputDir=.\
DisableProgramGroupPage=yes DisableProgramGroupPage=yes
ChangesEnvironment=yes ChangesEnvironment=yes
OutputBaseFilename=WasmerInstaller OutputBaseFilename=WasmerInstaller
WizardImageFile=..\..\media\wizard_logo_2.bmp WizardImageFile=media\wizard_logo_2.bmp
WizardSmallImageFile=..\..\media\wizard_logo_small.bmp WizardSmallImageFile=media\wizard_logo_small.bmp
SetupIconFile=..\..\media\wizard_logo.ico SetupIconFile=media\wizard_logo.ico
DisableWelcomePage=no DisableWelcomePage=no
[Files] [Files]

@ -1 +1 @@
Subproject commit 62ec59a53ca3df84019092a750aeb56e08b9d556 Subproject commit b157153568fc45f0d01ba8443c54fc3c2ce0cb23