Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64

This commit is contained in:
losfair 2019-11-20 01:54:34 +08:00
commit d56fd96395
33 changed files with 457 additions and 371 deletions

View File

@ -2,7 +2,10 @@
## **[Unreleased]**
## 0.10.2 - 2019-11-18
- [#968](https://github.com/wasmerio/wasmer/pull/968) Added `--invoke` option to the command
- [#964](https://github.com/wasmerio/wasmer/pull/964) Enable cross-compilation for specific target
- [#971](https://github.com/wasmerio/wasmer/pull/971) In LLVM backend, use unaligned loads and stores for non-atomic accesses to wasmer memory.
- [#960](https://github.com/wasmerio/wasmer/pull/960) Fix `runtime-c-api` header files when compiled by clang.
- [#925](https://github.com/wasmerio/wasmer/pull/925) Host functions can be closures with a captured environment.

146
Cargo.lock generated
View File

@ -717,8 +717,8 @@ version = "0.1.0"
dependencies = [
"rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime 0.10.2",
"wasmer-runtime-core 0.10.2",
]
[[package]]
@ -1328,7 +1328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "wasmer"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1338,24 +1338,24 @@ dependencies = [
"structopt 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"typetag 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-dev-utils 0.10.1",
"wasmer-emscripten 0.10.1",
"wasmer-emscripten-tests 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-dev-utils 0.10.2",
"wasmer-emscripten 0.10.2",
"wasmer-emscripten-tests 0.10.2",
"wasmer-kernel-loader 0.1.0",
"wasmer-llvm-backend 0.10.1",
"wasmer-middleware-common 0.10.1",
"wasmer-middleware-common-tests 0.10.1",
"wasmer-runtime 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-wasi 0.10.1",
"wasmer-wasi-tests 0.10.1",
"wasmer-llvm-backend 0.10.2",
"wasmer-middleware-common 0.10.2",
"wasmer-middleware-common-tests 0.10.2",
"wasmer-runtime 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
"wasmer-wasi 0.10.2",
"wasmer-wasi-tests 0.10.2",
]
[[package]]
name = "wasmer-clif-backend"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cranelift-codegen 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1371,8 +1371,8 @@ dependencies = [
"target-lexicon 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-fork-frontend 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-fork-wasm 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-win-exception-handler 0.10.1",
"wasmer-runtime-core 0.10.2",
"wasmer-win-exception-handler 0.10.2",
"wasmparser 0.39.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1404,35 +1404,35 @@ dependencies = [
[[package]]
name = "wasmer-dev-utils"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasmer-emscripten"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
]
[[package]]
name = "wasmer-emscripten-tests"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-dev-utils 0.10.1",
"wasmer-emscripten 0.10.1",
"wasmer-llvm-backend 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-dev-utils 0.10.2",
"wasmer-emscripten 0.10.2",
"wasmer-llvm-backend 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
]
[[package]]
@ -1440,12 +1440,12 @@ name = "wasmer-kernel-loader"
version = "0.1.0"
dependencies = [
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
]
[[package]]
name = "wasmer-llvm-backend"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1459,60 +1459,60 @@ dependencies = [
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
"wasmparser 0.39.2 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasmer-middleware-common"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
]
[[package]]
name = "wasmer-middleware-common-tests"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-llvm-backend 0.10.1",
"wasmer-middleware-common 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-llvm-backend 0.10.2",
"wasmer-middleware-common 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
]
[[package]]
name = "wasmer-runtime"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-llvm-backend 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-llvm-backend 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
]
[[package]]
name = "wasmer-runtime-c-api"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"cbindgen 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-wasi 0.10.1",
"wasmer-runtime 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-wasi 0.10.2",
]
[[package]]
name = "wasmer-runtime-core"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1538,18 +1538,18 @@ dependencies = [
[[package]]
name = "wasmer-runtime-core-tests"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-llvm-backend 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-llvm-backend 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
]
[[package]]
name = "wasmer-singlepass-backend"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"dynasm 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1558,24 +1558,24 @@ dependencies = [
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
]
[[package]]
name = "wasmer-spectests"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-llvm-backend 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-llvm-backend 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
]
[[package]]
name = "wasmer-wasi"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"bincode 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1586,31 +1586,31 @@ dependencies = [
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"typetag 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "wasmer-wasi-tests"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-clif-backend 0.10.1",
"wasmer-dev-utils 0.10.1",
"wasmer-llvm-backend 0.10.1",
"wasmer-runtime 0.10.1",
"wasmer-runtime-core 0.10.1",
"wasmer-singlepass-backend 0.10.1",
"wasmer-wasi 0.10.1",
"wasmer-clif-backend 0.10.2",
"wasmer-dev-utils 0.10.2",
"wasmer-llvm-backend 0.10.2",
"wasmer-runtime 0.10.2",
"wasmer-runtime-core 0.10.2",
"wasmer-singlepass-backend 0.10.2",
"wasmer-wasi 0.10.2",
]
[[package]]
name = "wasmer-win-exception-handler"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
"wasmer-runtime-core 0.10.1",
"wasmer-runtime-core 0.10.2",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer"
version = "0.10.1"
version = "0.10.2"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
repository = "https://github.com/wasmerio/wasmer"

View File

@ -1,4 +1,4 @@
FROM circleci/rust:1.39.0-stretch as wasmer-build-env
FROM circleci/rust:1.38.0-stretch as wasmer-build-env
RUN sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
cmake \

View File

@ -181,7 +181,7 @@ nginx and Lua do not work on Windows - you can track the progress on [this issue
## Building
[![Rustc Version 1.39+](https://img.shields.io/badge/rustc-1.39+-red.svg?style=flat-square)](https://blog.rust-lang.org/2019/09/26/Rust-1.39.0.html)
[![Rustc Version 1.38+](https://img.shields.io/badge/rustc-1.37+-red.svg?style=flat-square)](https://blog.rust-lang.org/2019/09/26/Rust-1.38.0.html)
Wasmer is built with [Cargo](https://crates.io/), the Rust package manager.

View File

@ -22,7 +22,7 @@ jobs:
- script: cargo fmt --all -- --check
displayName: Lint
variables:
rust_toolchain: '1.39.0'
rust_toolchain: '1.38.0'
- job: Test
strategy:
@ -39,7 +39,7 @@ jobs:
CARGO_HTTP_CHECK_REVOKE: false
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.39.0'
rust_toolchain: '1.38.0'
pool:
vmImage: $(imageName)
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
@ -100,7 +100,7 @@ jobs:
MACOSX_DEPLOYMENT_TARGET: 10.10
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.39.0'
rust_toolchain: '1.38.0'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
vmImage: $(imageName)
@ -163,7 +163,7 @@ jobs:
MACOSX_DEPLOYMENT_TARGET: 10.10
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.39.0'
rust_toolchain: '1.38.0'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
vmImage: $(imageName)
@ -205,7 +205,7 @@ jobs:
dependsOn:
- Build_CLI
- Build_Library
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
steps:
# - download: current
- task: DownloadPipelineArtifact@1
@ -259,3 +259,4 @@ trigger:
- master
- staging
- trying
- refs/tags/*

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-clif-backend"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime Cranelift compiler backend"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -11,7 +11,7 @@ edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
cranelift-native = "0.44.0"
cranelift-codegen = "0.44.0"
cranelift-entity = "0.44.0"
@ -37,7 +37,7 @@ version = "0.0.7"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["errhandlingapi", "minwindef", "minwinbase", "winnt"] }
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.10.1" }
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.10.2" }
[features]
debug = ["wasmer-runtime-core/debug"]

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-dev-utils"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime core library"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]

View File

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

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-emscripten"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime emscripten implementation library"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -14,7 +14,7 @@ byteorder = "1.3"
lazy_static = "1.4"
libc = "0.2.60"
time = "0.1"
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
[target.'cfg(windows)'.dependencies]
getrandom = "0.1"

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-llvm-backend"
version = "0.10.1"
version = "0.10.2"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer"
@ -10,7 +10,7 @@ edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
wasmparser = "0.39.1"
smallvec = "0.6"
goblin = "0.0.24"

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-middleware-common-tests"
version = "0.10.1"
version = "0.10.2"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
repository = "https://github.com/wasmerio/wasmer"
@ -8,11 +8,11 @@ license = "MIT"
publish = false
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-middleware-common = { path = "../middleware-common", version = "0.10.1" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.10.1" }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.10.1", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.10.1", optional = true }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
wasmer-middleware-common = { path = "../middleware-common", version = "0.10.2" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.10.2" }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.10.2", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.10.2", optional = true }
[features]
clif = []

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-middleware-common"
version = "0.10.1"
version = "0.10.2"
repository = "https://github.com/wasmerio/wasmer"
description = "Wasmer runtime common middlewares"
license = "MIT"
@ -10,4 +10,4 @@ categories = ["wasm"]
edition = "2018"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-runtime-c-api"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer C API library"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -19,17 +19,17 @@ libc = "0.2.60"
[dependencies.wasmer-runtime]
default-features = false
path = "../runtime"
version = "0.10.1"
version = "0.10.2"
[dependencies.wasmer-runtime-core]
default-features = false
path = "../runtime-core"
version = "0.10.1"
version = "0.10.2"
[dependencies.wasmer-wasi]
default-features = false
path = "../wasi"
version = "0.10.1"
version = "0.10.2"
optional = true
[features]

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-runtime-core-tests"
version = "0.10.1"
version = "0.10.2"
description = "Tests for the Wasmer runtime core crate"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -9,10 +9,10 @@ publish = false
[dependencies]
wabt = "0.9.1"
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.10.1", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.10.1", optional = true }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.10.1", optional = true }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
wasmer-clif-backend = { path = "../clif-backend", version = "0.10.2", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.10.2", optional = true }
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.10.2", optional = true }
[features]
default = ["backend-cranelift"]

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-runtime-core"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime core library"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]

View File

@ -343,87 +343,6 @@ impl WasmTypeList for Infallible {
}
}
impl<A> WasmTypeList for (A,)
where
A: WasmExternType,
{
type CStruct = S1<A>;
type RetArray = [u64; 1];
fn from_ret_array(array: Self::RetArray) -> Self {
(WasmExternType::from_native(NativeWasmType::from_binary(
array[0],
)),)
}
fn empty_ret_array() -> Self::RetArray {
[0u64]
}
fn from_c_struct(c_struct: Self::CStruct) -> Self {
let S1(a) = c_struct;
(WasmExternType::from_native(a),)
}
fn into_c_struct(self) -> Self::CStruct {
#[allow(unused_parens, non_snake_case)]
let (a,) = self;
S1(WasmExternType::to_native(a))
}
fn types() -> &'static [Type] {
&[A::Native::TYPE]
}
#[allow(non_snake_case)]
unsafe fn call<Rets>(
self,
f: NonNull<vm::Func>,
wasm: Wasm,
ctx: *mut vm::Ctx,
) -> Result<Rets, RuntimeError>
where
Rets: WasmTypeList,
{
let (a,) = self;
let args = [a.to_native().to_binary()];
let mut rets = Rets::empty_ret_array();
let mut trap = WasmTrapInfo::Unknown;
let mut user_error = None;
if (wasm.invoke)(
wasm.trampoline,
ctx,
f,
args.as_ptr(),
rets.as_mut().as_mut_ptr(),
&mut trap,
&mut user_error,
wasm.invoke_env,
) {
Ok(Rets::from_ret_array(rets))
} else {
if let Some(data) = user_error {
Err(RuntimeError::Error { data })
} else {
Err(RuntimeError::Trap {
msg: trap.to_string().into(),
})
}
}
}
}
impl<'a, A: WasmExternType, Rets> Func<'a, (A,), Rets, Wasm>
where
Rets: WasmTypeList,
{
/// Call wasm function and return results.
pub fn call(&self, a: A) -> Result<Rets, RuntimeError> {
unsafe { <A as WasmTypeList>::call(a, self.func, self.inner, self.vmctx) }
}
}
macro_rules! impl_traits {
( [$repr:ident] $struct_name:ident, $( $x:ident ),* ) => {
/// Struct for typed funcs.
@ -458,8 +377,8 @@ macro_rules! impl_traits {
( $( WasmExternType::from_native($x) ),* )
}
#[allow(unused_parens, non_snake_case)]
fn into_c_struct(self) -> Self::CStruct {
#[allow(unused_parens, non_snake_case)]
let ( $( $x ),* ) = self;
$struct_name ( $( WasmExternType::to_native($x) ),* )
@ -469,7 +388,7 @@ macro_rules! impl_traits {
&[$( $x::Native::TYPE ),*]
}
#[allow(non_snake_case)]
#[allow(unused_parens, non_snake_case)]
unsafe fn call<Rets>(
self,
f: NonNull<vm::Func>,
@ -479,7 +398,6 @@ macro_rules! impl_traits {
where
Rets: WasmTypeList
{
#[allow(unused_parens)]
let ( $( $x ),* ) = self;
let args = [ $( $x.to_native().to_binary()),* ];
let mut rets = Rets::empty_ret_array();
@ -819,8 +737,14 @@ mod tests {
vec![$($x),*].iter().sum()
}
let _func = Func::new(with_vmctx);
let _func = Func::new(without_vmctx);
let _ = Func::new(with_vmctx);
let _ = Func::new(without_vmctx);
let _ = Func::new(|_: &mut vm::Ctx, $($x: i32),*| -> i32 {
vec![$($x),*].iter().sum()
});
let _ = Func::new(|$($x: i32),*| -> i32 {
vec![$($x),*].iter().sum()
});
}
}
}
@ -837,6 +761,8 @@ mod tests {
let _ = Func::new(foo);
let _ = Func::new(bar);
let _ = Func::new(|_: &mut vm::Ctx| -> i32 { 0 });
let _ = Func::new(|| -> i32 { 0 });
}
test_func_arity_n!(test_func_arity_1, a);

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-runtime"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime library"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -11,17 +11,17 @@ edition = "2018"
readme = "README.md"
[dependencies]
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.10.1", optional = true }
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.10.2", optional = true }
lazy_static = "1.4"
memmap = "0.7"
[dependencies.wasmer-runtime-core]
path = "../runtime-core"
version = "0.10.1"
version = "0.10.2"
[dependencies.wasmer-clif-backend]
path = "../clif-backend"
version = "0.10.1"
version = "0.10.2"
optional = true
[dev-dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-singlepass-backend"
version = "0.10.1"
version = "0.10.2"
repository = "https://github.com/wasmerio/wasmer"
description = "Wasmer runtime single pass compiler backend"
license = "MIT"
@ -11,7 +11,7 @@ edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
dynasm = "0.5"
dynasmrt = "0.5"
lazy_static = "1.4"

View File

@ -857,32 +857,34 @@ impl X64FunctionCode {
sz_dst: Size,
dst: Location,
) {
let tmp_src = m.acquire_temp_gpr().unwrap();
let tmp_dst = m.acquire_temp_gpr().unwrap();
match src {
Location::Imm32(_) | Location::Imm64(_) => {
a.emit_mov(Size::S64, src, Location::GPR(tmp_src));
src = Location::GPR(tmp_src);
}
Location::Memory(_, _) | Location::GPR(_) => {}
_ => unreachable!(),
}
match dst {
let inner = |m: &mut Machine, a: &mut Assembler, src: Location| match dst {
Location::Imm32(_) | Location::Imm64(_) => unreachable!(),
Location::Memory(_, _) => {
let tmp_dst = m.acquire_temp_gpr().unwrap();
op(a, sz_src, src, sz_dst, Location::GPR(tmp_dst));
a.emit_mov(Size::S64, Location::GPR(tmp_dst), dst);
m.release_temp_gpr(tmp_dst);
}
Location::GPR(_) => {
op(a, sz_src, src, sz_dst, dst);
}
_ => unreachable!(),
}
};
m.release_temp_gpr(tmp_dst);
m.release_temp_gpr(tmp_src);
match src {
Location::Imm32(_) | Location::Imm64(_) => {
let tmp_src = m.acquire_temp_gpr().unwrap();
a.emit_mov(Size::S64, src, Location::GPR(tmp_src));
src = Location::GPR(tmp_src);
inner(m, a, src);
m.release_temp_gpr(tmp_src);
}
Location::GPR(_) | Location::Memory(_, _) => inner(m, a, src),
_ => unreachable!(),
}
}
/// Moves `src` and `dst` to valid locations for generic instructions.
@ -3173,6 +3175,106 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
ret,
);
}
Operator::I32Extend8S => {
let loc =
get_location_released(a, &mut self.machine, self.value_stack.pop().unwrap());
let ret = self.machine.acquire_locations(
a,
&[(WpType::I32, MachineValue::WasmStack(self.value_stack.len()))],
false,
)[0];
self.value_stack.push(ret);
Self::emit_relaxed_zx_sx(
a,
&mut self.machine,
Assembler::emit_movsx,
Size::S8,
loc,
Size::S32,
ret,
);
}
Operator::I32Extend16S => {
let loc =
get_location_released(a, &mut self.machine, self.value_stack.pop().unwrap());
let ret = self.machine.acquire_locations(
a,
&[(WpType::I32, MachineValue::WasmStack(self.value_stack.len()))],
false,
)[0];
self.value_stack.push(ret);
Self::emit_relaxed_zx_sx(
a,
&mut self.machine,
Assembler::emit_movsx,
Size::S16,
loc,
Size::S32,
ret,
);
}
Operator::I64Extend8S => {
let loc =
get_location_released(a, &mut self.machine, self.value_stack.pop().unwrap());
let ret = self.machine.acquire_locations(
a,
&[(WpType::I64, MachineValue::WasmStack(self.value_stack.len()))],
false,
)[0];
self.value_stack.push(ret);
Self::emit_relaxed_zx_sx(
a,
&mut self.machine,
Assembler::emit_movsx,
Size::S8,
loc,
Size::S64,
ret,
);
}
Operator::I64Extend16S => {
let loc =
get_location_released(a, &mut self.machine, self.value_stack.pop().unwrap());
let ret = self.machine.acquire_locations(
a,
&[(WpType::I64, MachineValue::WasmStack(self.value_stack.len()))],
false,
)[0];
self.value_stack.push(ret);
Self::emit_relaxed_zx_sx(
a,
&mut self.machine,
Assembler::emit_movsx,
Size::S16,
loc,
Size::S64,
ret,
);
}
Operator::I64Extend32S => {
let loc =
get_location_released(a, &mut self.machine, self.value_stack.pop().unwrap());
let ret = self.machine.acquire_locations(
a,
&[(WpType::I64, MachineValue::WasmStack(self.value_stack.len()))],
false,
)[0];
self.value_stack.push(ret);
Self::emit_relaxed_zx_sx(
a,
&mut self.machine,
Assembler::emit_movsx,
Size::S32,
loc,
Size::S64,
ret,
);
}
Operator::I32WrapI64 => {
let loc =
get_location_released(a, &mut self.machine, self.value_stack.pop().unwrap());

View File

@ -809,18 +809,14 @@ impl Emitter for Assembler {
match (sz, src) {
(Size::S64, Location::Imm32(src)) => dynasm!(self ; push src as i32),
(Size::S64, Location::GPR(src)) => dynasm!(self ; push Rq(src as u8)),
(Size::S64, Location::Memory(src, disp)) => {
dynasm!(self ; push QWORD [Rq(src as u8) + disp])
}
(Size::S64, Location::Memory(src, disp)) => dynasm!(self ; push QWORD [Rq(src as u8) + disp]),
_ => panic!("singlepass can't emit PUSH {:?} {:?}", sz, src),
}
}
fn emit_pop(&mut self, sz: Size, dst: Location) {
match (sz, dst) {
(Size::S64, Location::GPR(dst)) => dynasm!(self ; pop Rq(dst as u8)),
(Size::S64, Location::Memory(dst, disp)) => {
dynasm!(self ; pop QWORD [Rq(dst as u8) + disp])
}
(Size::S64, Location::Memory(dst, disp)) => dynasm!(self ; pop QWORD [Rq(dst as u8) + disp]),
_ => panic!("singlepass can't emit POP {:?} {:?}", sz, dst),
}
}
@ -842,21 +838,13 @@ impl Emitter for Assembler {
fn emit_neg(&mut self, sz: Size, value: Location) {
match (sz, value) {
(Size::S8, Location::GPR(value)) => dynasm!(self ; neg Rb(value as u8)),
(Size::S8, Location::Memory(value, disp)) => {
dynasm!(self ; neg [Rq(value as u8) + disp])
}
(Size::S8, Location::Memory(value, disp)) => dynasm!(self ; neg [Rq(value as u8) + disp]),
(Size::S16, Location::GPR(value)) => dynasm!(self ; neg Rw(value as u8)),
(Size::S16, Location::Memory(value, disp)) => {
dynasm!(self ; neg [Rq(value as u8) + disp])
}
(Size::S16, Location::Memory(value, disp)) => dynasm!(self ; neg [Rq(value as u8) + disp]),
(Size::S32, Location::GPR(value)) => dynasm!(self ; neg Rd(value as u8)),
(Size::S32, Location::Memory(value, disp)) => {
dynasm!(self ; neg [Rq(value as u8) + disp])
}
(Size::S32, Location::Memory(value, disp)) => dynasm!(self ; neg [Rq(value as u8) + disp]),
(Size::S64, Location::GPR(value)) => dynasm!(self ; neg Rq(value as u8)),
(Size::S64, Location::Memory(value, disp)) => {
dynasm!(self ; neg [Rq(value as u8) + disp])
}
(Size::S64, Location::Memory(value, disp)) => dynasm!(self ; neg [Rq(value as u8) + disp]),
_ => panic!("singlepass can't emit NEG {:?} {:?}", sz, value),
}
}
@ -1109,30 +1097,18 @@ impl Emitter for Assembler {
fn emit_vmovaps(&mut self, src: XMMOrMemory, dst: XMMOrMemory) {
match (src, dst) {
(XMMOrMemory::XMM(src), XMMOrMemory::XMM(dst)) => {
dynasm!(self ; movaps Rx(dst as u8), Rx(src as u8))
}
(XMMOrMemory::Memory(base, disp), XMMOrMemory::XMM(dst)) => {
dynasm!(self ; movaps Rx(dst as u8), [Rq(base as u8) + disp])
}
(XMMOrMemory::XMM(src), XMMOrMemory::Memory(base, disp)) => {
dynasm!(self ; movaps [Rq(base as u8) + disp], Rx(src as u8))
}
(XMMOrMemory::XMM(src), XMMOrMemory::XMM(dst)) => dynasm!(self ; movaps Rx(dst as u8), Rx(src as u8)),
(XMMOrMemory::Memory(base, disp), XMMOrMemory::XMM(dst)) => dynasm!(self ; movaps Rx(dst as u8), [Rq(base as u8) + disp]),
(XMMOrMemory::XMM(src), XMMOrMemory::Memory(base, disp)) => dynasm!(self ; movaps [Rq(base as u8) + disp], Rx(src as u8)),
_ => panic!("singlepass can't emit VMOVAPS {:?} {:?}", src, dst),
};
}
fn emit_vmovapd(&mut self, src: XMMOrMemory, dst: XMMOrMemory) {
match (src, dst) {
(XMMOrMemory::XMM(src), XMMOrMemory::XMM(dst)) => {
dynasm!(self ; movapd Rx(dst as u8), Rx(src as u8))
}
(XMMOrMemory::Memory(base, disp), XMMOrMemory::XMM(dst)) => {
dynasm!(self ; movapd Rx(dst as u8), [Rq(base as u8) + disp])
}
(XMMOrMemory::XMM(src), XMMOrMemory::Memory(base, disp)) => {
dynasm!(self ; movapd [Rq(base as u8) + disp], Rx(src as u8))
}
(XMMOrMemory::XMM(src), XMMOrMemory::XMM(dst)) => dynasm!(self ; movapd Rx(dst as u8), Rx(src as u8)),
(XMMOrMemory::Memory(base, disp), XMMOrMemory::XMM(dst)) => dynasm!(self ; movapd Rx(dst as u8), [Rq(base as u8) + disp]),
(XMMOrMemory::XMM(src), XMMOrMemory::Memory(base, disp)) => dynasm!(self ; movapd [Rq(base as u8) + disp], Rx(src as u8)),
_ => panic!("singlepass can't emit VMOVAPD {:?} {:?}", src, dst),
};
}
@ -1204,77 +1180,57 @@ impl Emitter for Assembler {
fn emit_vblendvps(&mut self, src1: XMM, src2: XMMOrMemory, mask: XMM, dst: XMM) {
match src2 {
XMMOrMemory::XMM(src2) => {
dynasm!(self ; vblendvps Rx(dst as u8), Rx(mask as u8), Rx(src2 as u8), Rx(src1 as u8))
}
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; vblendvps Rx(dst as u8), Rx(mask as u8), [Rq(base as u8) + disp], Rx(src1 as u8))
}
XMMOrMemory::XMM(src2) => dynasm!(self ; vblendvps Rx(dst as u8), Rx(mask as u8), Rx(src2 as u8), Rx(src1 as u8)),
XMMOrMemory::Memory(base, disp) => dynasm!(self ; vblendvps Rx(dst as u8), Rx(mask as u8), [Rq(base as u8) + disp], Rx(src1 as u8)),
}
}
fn emit_vblendvpd(&mut self, src1: XMM, src2: XMMOrMemory, mask: XMM, dst: XMM) {
match src2 {
XMMOrMemory::XMM(src2) => {
dynasm!(self ; vblendvpd Rx(dst as u8), Rx(mask as u8), Rx(src2 as u8), Rx(src1 as u8))
}
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; vblendvpd Rx(dst as u8), Rx(mask as u8), [Rq(base as u8) + disp], Rx(src1 as u8))
}
XMMOrMemory::XMM(src2) => dynasm!(self ; vblendvpd Rx(dst as u8), Rx(mask as u8), Rx(src2 as u8), Rx(src1 as u8)),
XMMOrMemory::Memory(base, disp) => dynasm!(self ; vblendvpd Rx(dst as u8), Rx(mask as u8), [Rq(base as u8) + disp], Rx(src1 as u8)),
}
}
fn emit_ucomiss(&mut self, src: XMMOrMemory, dst: XMM) {
match src {
XMMOrMemory::XMM(x) => dynasm!(self ; ucomiss Rx(dst as u8), Rx(x as u8)),
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; ucomiss Rx(dst as u8), [Rq(base as u8) + disp])
}
XMMOrMemory::Memory(base, disp) => dynasm!(self ; ucomiss Rx(dst as u8), [Rq(base as u8) + disp]),
}
}
fn emit_ucomisd(&mut self, src: XMMOrMemory, dst: XMM) {
match src {
XMMOrMemory::XMM(x) => dynasm!(self ; ucomisd Rx(dst as u8), Rx(x as u8)),
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; ucomisd Rx(dst as u8), [Rq(base as u8) + disp])
}
XMMOrMemory::Memory(base, disp) => dynasm!(self ; ucomisd Rx(dst as u8), [Rq(base as u8) + disp]),
}
}
fn emit_cvttss2si_32(&mut self, src: XMMOrMemory, dst: GPR) {
match src {
XMMOrMemory::XMM(x) => dynasm!(self ; cvttss2si Rd(dst as u8), Rx(x as u8)),
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; cvttss2si Rd(dst as u8), [Rq(base as u8) + disp])
}
XMMOrMemory::Memory(base, disp) => dynasm!(self ; cvttss2si Rd(dst as u8), [Rq(base as u8) + disp]),
}
}
fn emit_cvttss2si_64(&mut self, src: XMMOrMemory, dst: GPR) {
match src {
XMMOrMemory::XMM(x) => dynasm!(self ; cvttss2si Rq(dst as u8), Rx(x as u8)),
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; cvttss2si Rq(dst as u8), [Rq(base as u8) + disp])
}
XMMOrMemory::Memory(base, disp) => dynasm!(self ; cvttss2si Rq(dst as u8), [Rq(base as u8) + disp]),
}
}
fn emit_cvttsd2si_32(&mut self, src: XMMOrMemory, dst: GPR) {
match src {
XMMOrMemory::XMM(x) => dynasm!(self ; cvttsd2si Rd(dst as u8), Rx(x as u8)),
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; cvttsd2si Rd(dst as u8), [Rq(base as u8) + disp])
}
XMMOrMemory::Memory(base, disp) => dynasm!(self ; cvttsd2si Rd(dst as u8), [Rq(base as u8) + disp]),
}
}
fn emit_cvttsd2si_64(&mut self, src: XMMOrMemory, dst: GPR) {
match src {
XMMOrMemory::XMM(x) => dynasm!(self ; cvttsd2si Rq(dst as u8), Rx(x as u8)),
XMMOrMemory::Memory(base, disp) => {
dynasm!(self ; cvttsd2si Rq(dst as u8), [Rq(base as u8) + disp])
}
XMMOrMemory::Memory(base, disp) => dynasm!(self ; cvttsd2si Rq(dst as u8), [Rq(base as u8) + disp]),
}
}

View File

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

View File

@ -1,6 +1,11 @@
(module
(func (export "i64.extend_i32_s") (param $x i32) (result i64) (i64.extend_i32_s (local.get $x)))
(func (export "i64.extend_i32_u") (param $x i32) (result i64) (i64.extend_i32_u (local.get $x)))
(func (export "i64.extend32_s") (param $x i64) (result i64) (i64.extend32_s (local.get $x)))
(func (export "i64.extend16_s") (param $x i64) (result i64) (i64.extend16_s (local.get $x)))
(func (export "i64.extend8_s") (param $x i64) (result i64) (i64.extend8_s (local.get $x)))
(func (export "i32.extend16_s") (param $x i32) (result i32) (i32.extend16_s (local.get $x)))
(func (export "i32.extend8_s") (param $x i32) (result i32) (i32.extend8_s (local.get $x)))
(func (export "i32.wrap_i64") (param $x i64) (result i32) (i32.wrap_i64 (local.get $x)))
(func (export "i32.trunc_f32_s") (param $x f32) (result i32) (i32.trunc_f32_s (local.get $x)))
(func (export "i32.trunc_f32_u") (param $x f32) (result i32) (i32.trunc_f32_u (local.get $x)))
@ -497,3 +502,46 @@
(assert_invalid (module (func (result f64) (f64.convert_i64_u (i32.const 0)))) "type mismatch")
(assert_invalid (module (func (result f64) (f64.promote_f32 (i32.const 0)))) "type mismatch")
(assert_invalid (module (func (result f64) (f64.reinterpret_i64 (i32.const 0)))) "type mismatch")
(assert_return (invoke "i32.extend8_s" (i32.const 0)) (i32.const 0))
(assert_return (invoke "i32.extend8_s" (i32.const 0x7f)) (i32.const 127))
(assert_return (invoke "i32.extend8_s" (i32.const 0x80)) (i32.const -128))
(assert_return (invoke "i32.extend8_s" (i32.const 0xff)) (i32.const -1))
(assert_return (invoke "i32.extend8_s" (i32.const 0x012345_00)) (i32.const 0))
(assert_return (invoke "i32.extend8_s" (i32.const 0xfedcba_80)) (i32.const -0x80))
(assert_return (invoke "i32.extend8_s" (i32.const -1)) (i32.const -1))
(assert_return (invoke "i32.extend16_s" (i32.const 0)) (i32.const 0))
(assert_return (invoke "i32.extend16_s" (i32.const 0x7fff)) (i32.const 32767))
(assert_return (invoke "i32.extend16_s" (i32.const 0x8000)) (i32.const -32768))
(assert_return (invoke "i32.extend16_s" (i32.const 0xffff)) (i32.const -1))
(assert_return (invoke "i32.extend16_s" (i32.const 0x0123_0000)) (i32.const 0))
(assert_return (invoke "i32.extend16_s" (i32.const 0xfedc_8000)) (i32.const -0x8000))
(assert_return (invoke "i32.extend16_s" (i32.const -1)) (i32.const -1))
(assert_return (invoke "i64.extend8_s" (i64.const 0)) (i64.const 0))
(assert_return (invoke "i64.extend8_s" (i64.const 0x7f)) (i64.const 127))
(assert_return (invoke "i64.extend8_s" (i64.const 0x80)) (i64.const -128))
(assert_return (invoke "i64.extend8_s" (i64.const 0xff)) (i64.const -1))
(assert_return (invoke "i64.extend8_s" (i64.const 0x01234567_89abcd_00)) (i64.const 0))
(assert_return (invoke "i64.extend8_s" (i64.const 0xfedcba98_765432_80)) (i64.const -0x80))
(assert_return (invoke "i64.extend8_s" (i64.const -1)) (i64.const -1))
(assert_return (invoke "i64.extend16_s" (i64.const 0)) (i64.const 0))
(assert_return (invoke "i64.extend16_s" (i64.const 0x7fff)) (i64.const 32767))
(assert_return (invoke "i64.extend16_s" (i64.const 0x8000)) (i64.const -32768))
(assert_return (invoke "i64.extend16_s" (i64.const 0xffff)) (i64.const -1))
(assert_return (invoke "i64.extend16_s" (i64.const 0x12345678_9abc_0000)) (i64.const 0))
(assert_return (invoke "i64.extend16_s" (i64.const 0xfedcba98_7654_8000)) (i64.const -0x8000))
(assert_return (invoke "i64.extend16_s" (i64.const -1)) (i64.const -1))
(assert_return (invoke "i64.extend32_s" (i64.const 0)) (i64.const 0))
(assert_return (invoke "i64.extend32_s" (i64.const 0x7fff)) (i64.const 32767))
(assert_return (invoke "i64.extend32_s" (i64.const 0x8000)) (i64.const 32768))
(assert_return (invoke "i64.extend32_s" (i64.const 0xffff)) (i64.const 65535))
(assert_return (invoke "i64.extend32_s" (i64.const 0x7fffffff)) (i64.const 0x7fffffff))
(assert_return (invoke "i64.extend32_s" (i64.const 0x80000000)) (i64.const -0x80000000))
(assert_return (invoke "i64.extend32_s" (i64.const 0xffffffff)) (i64.const -1))
(assert_return (invoke "i64.extend32_s" (i64.const 0x01234567_00000000)) (i64.const 0))
(assert_return (invoke "i64.extend32_s" (i64.const 0xfedcba98_80000000)) (i64.const -0x80000000))
(assert_return (invoke "i64.extend32_s" (i64.const -1)) (i64.const -1))

View File

@ -396,73 +396,73 @@ singlepass:fail:call_indirect.wast:493 # AssertTrap - expected trap, got Runtime
singlepass:fail:call_indirect.wast:494 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:call_indirect.wast:500 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:call_indirect.wast:501 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:70 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:71 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:72 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:73 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:74 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:75 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:76 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:77 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:92 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:93 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:94 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:95 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:96 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:78 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:79 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:80 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:81 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:82 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:97 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:98 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:99 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:115 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:116 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:117 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:118 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:119 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:100 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:101 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:102 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:103 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:104 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:120 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:121 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:122 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:138 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:139 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:140 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:141 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:142 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:123 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:124 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:125 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:126 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:127 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:143 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:144 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:145 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:146 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:147 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:148 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:166 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:167 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:168 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:169 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:170 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:149 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:150 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:151 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:152 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:153 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:171 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:172 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:173 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:186 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:187 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:188 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:189 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:190 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:174 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:175 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:176 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:177 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:178 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:191 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:192 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:193 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:211 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:212 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:213 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:214 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:215 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:194 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:195 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:196 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:197 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:198 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:216 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:217 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:218 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:235 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:236 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:237 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:238 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:239 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:219 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:220 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:221 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:222 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:223 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:240 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:241 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:242 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:243 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:244 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:245 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:246 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:conversions.wast:247 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:elem.wast:353 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:func_ptrs.wast:78 # AssertTrap - expected trap, got Runtime:Error unknown error
singlepass:fail:func_ptrs.wast:79 # AssertTrap - expected trap, got Runtime:Error unknown error

View File

@ -186,6 +186,7 @@ mod tests {
let mut features = wabt::Features::new();
features.enable_simd();
features.enable_threads();
features.enable_sign_extension();
let mut parser: ScriptParser =
ScriptParser::from_source_and_name_with_features(&source, filename, features)
.expect(&format!("Failed to parse script {}", &filename));

View File

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

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-wasi"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime WASI implementation library"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -19,7 +19,7 @@ getrandom = "0.1"
time = "0.1"
typetag = "0.1"
serde = { version = "1", features = ["derive"] }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
[target.'cfg(windows)'.dependencies]
winapi = "0.3"

View File

@ -1,6 +1,6 @@
[package]
name = "wasmer-win-exception-handler"
version = "0.10.1"
version = "0.10.2"
description = "Wasmer runtime exception handling for Windows"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
@ -8,7 +8,7 @@ repository = "https://github.com/wasmerio/wasmer"
edition = "2018"
[target.'cfg(windows)'.dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.1" }
wasmer-runtime-core = { path = "../runtime-core", version = "0.10.2" }
winapi = { version = "0.3.8", features = ["winbase", "errhandlingapi", "minwindef", "minwinbase", "winnt"] }
libc = "0.2.60"

5
popcnt.wat Normal file
View File

@ -0,0 +1,5 @@
(module
(func $main (export "main") (result i32)
(i32.popcnt (i32.const -1))
)
)

View File

@ -1,5 +1,5 @@
PREVIOUS_VERSION='0.10.0'
NEXT_VERSION='0.10.1'
PREVIOUS_VERSION='0.10.1'
NEXT_VERSION='0.10.2'
# quick hack
fd Cargo.toml --exec sed -i '' "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/"

View File

@ -94,6 +94,29 @@ struct PrestandardFeatures {
all: bool,
}
impl PrestandardFeatures {
/// Generate [`wabt::Features`] struct from CLI options
pub fn into_wabt_features(&self) -> wabt::Features {
let mut features = wabt::Features::new();
if self.simd || self.all {
features.enable_simd();
}
if self.threads || self.all {
features.enable_threads();
}
features.enable_sign_extension();
features
}
/// Generate [`Features`] struct from CLI options
pub fn into_backend_features(&self) -> Features {
Features {
simd: self.simd || self.all,
threads: self.threads || self.all,
}
}
}
#[cfg(feature = "backend-llvm")]
#[derive(Debug, StructOpt, Clone)]
/// LLVM backend flags.
@ -399,13 +422,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
}
if !utils::is_wasm_binary(&wasm_binary) {
let mut features = wabt::Features::new();
if options.features.simd || options.features.all {
features.enable_simd();
}
if options.features.threads || options.features.all {
features.enable_threads();
}
let features = options.features.into_wabt_features();
wasm_binary = wabt::wat2wasm_with_features(wasm_binary, features)
.map_err(|e| format!("Can't convert from wast to wasm: {:?}", e))?;
}
@ -449,10 +466,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
memory_bound_check_mode: MemoryBoundCheckMode::Disable,
enforce_stack_check: true,
track_state,
features: Features {
simd: options.features.simd || options.features.all,
threads: options.features.threads || options.features.all,
},
features: options.features.into_backend_features(),
..Default::default()
},
&*compiler,
@ -464,10 +478,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
CompilerConfig {
symbol_map: em_symbol_map.clone(),
track_state,
features: Features {
simd: options.features.simd || options.features.all,
threads: options.features.threads || options.features.all,
},
features: options.features.into_backend_features(),
..Default::default()
},
&*compiler,
@ -512,10 +523,7 @@ fn execute_wasm(options: &Run) -> Result<(), String> {
CompilerConfig {
symbol_map: em_symbol_map.clone(),
track_state,
features: Features {
simd: options.features.simd || options.features.all,
threads: options.features.threads || options.features.all,
},
features: options.features.into_backend_features(),
..Default::default()
},
&*compiler,
@ -839,10 +847,7 @@ fn validate_wasm(validate: Validate) -> Result<(), String> {
wasmer_runtime_core::validate_and_report_errors_with_features(
&wasm_binary,
Features {
simd: validate.features.simd || validate.features.all,
threads: validate.features.threads || validate.features.all,
},
validate.features.into_backend_features(),
)
.map_err(|err| format!("Validation failed: {}", err))?;

View File

@ -1,6 +1,6 @@
[Setup]
AppName=Wasmer
AppVersion=0.10.1
AppVersion=0.10.2
DefaultDirName={pf}\Wasmer
DefaultGroupName=Wasmer
Compression=lzma2

39
xxx.wat Normal file
View File

@ -0,0 +1,39 @@
(module
(func $dot_product_example
(param $x0 f64) (param $x1 f64) (param $x2 f64) (param $x3 f64)
(param $y0 f64) (param $y1 f64) (param $y2 f64) (param $y3 f64)
(result f64)
(f64.add (f64.add (f64.add
(f64.mul (local.get $x0) (local.get $y0))
(f64.mul (local.get $x1) (local.get $y1)))
(f64.mul (local.get $x2) (local.get $y2)))
(f64.mul (local.get $x3) (local.get $y3)))
)
(func $main (export "main")
(param i32) (param i32) (param i32) (param i32)
(param i32) (param i32) (param i32) (param i32)
(result i32)
(i32.add
(get_local 0)
(i32.add
(get_local 1)
(i32.add
(get_local 2)
(i32.add
(get_local 3)
(i32.add
(get_local 4)
(i32.add
(get_local 5)
(i32.add
(get_local 6)
(get_local 7)
)
)
)
)
)
)
)
)
)