mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-16 16:20:49 +00:00
Merge remote-tracking branch 'origin/master' into feature/unified-exceptions
This commit is contained in:
commit
74eb11352a
12
.github/CODEOWNERS
vendored
12
.github/CODEOWNERS
vendored
@ -3,15 +3,15 @@ src/ @syrusakbary @MarkMcCaskey
|
||||
|
||||
# Backends
|
||||
lib/singlepass-backend @losfair @nlewycky
|
||||
lib/clif-backend @nlewycky @bjfish
|
||||
lib/clif-backend @nlewycky
|
||||
lib/llvm-backend @nlewycky @losfair
|
||||
|
||||
# Runtime
|
||||
lib/runtime-core @Hywan @bjfish
|
||||
lib/runtime @MarkMcCaskey @Hywan @bjfish
|
||||
lib/runtime-c-api @bjfish @Hywan
|
||||
lib/win-exception-handler @bjfish @losfair
|
||||
lib/middleware-common @bjfish @losfair
|
||||
lib/runtime-core @Hywan
|
||||
lib/runtime @MarkMcCaskey @Hywan
|
||||
lib/runtime-c-api @Hywan
|
||||
lib/win-exception-handler @losfair
|
||||
lib/middleware-common @losfair
|
||||
|
||||
# Frontend integrations
|
||||
|
||||
|
@ -2,6 +2,14 @@
|
||||
|
||||
## **[Unreleased]**
|
||||
|
||||
## 0.13.1 - 2020-01-16
|
||||
- Fix bug in wapm related to the `package.wasmer_extra_flags` entry in the manifest
|
||||
|
||||
## 0.13.0 - 2020-01-15
|
||||
|
||||
Special thanks to [@repi](https://github.com/repi) and [@srenatus](https://github.com/srenatus) for their contributions!
|
||||
|
||||
- [#1153](https://github.com/wasmerio/wasmer/pull/1153) Added Wasmex, an Elixir language integration, to the README
|
||||
- [#1133](https://github.com/wasmerio/wasmer/pull/1133) New `wasmer_trap` function in the C API, to properly error from within a host function
|
||||
- [#1147](https://github.com/wasmerio/wasmer/pull/1147) Remove `log` and `trace` macros from `wasmer-runtime-core`, remove `debug` and `trace` features from `wasmer-*` crates, use the `log` crate for logging and use `fern` in the Wasmer CLI binary to output log messages. Colorized output will be enabled automatically if printing to a terminal, to force colorization on or off, set the `WASMER_COLOR` environment variable to `true` or `false`.
|
||||
- [#1128](https://github.com/wasmerio/wasmer/pull/1128) Fix a crash when a host function is missing and the `allow_missing_functions` flag is enabled
|
||||
|
151
Cargo.lock
generated
151
Cargo.lock
generated
@ -46,6 +46,12 @@ version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
|
||||
|
||||
[[package]]
|
||||
name = "bincode"
|
||||
version = "1.2.1"
|
||||
@ -202,7 +208,8 @@ checksum = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120"
|
||||
[[package]]
|
||||
name = "cranelift-bforest"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56aa72ef104c5d634f2f9e84ef2c47e116c1d185fae13f196b97ca84b0a514f1"
|
||||
dependencies = [
|
||||
"cranelift-entity",
|
||||
]
|
||||
@ -210,7 +217,8 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "460b9d20793543599308d22f5a1172c196e63a780c4e9aacb0b3f4f63d63ffe1"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"cranelift-bforest",
|
||||
@ -226,7 +234,8 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen-meta"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cc70e4e8ccebd53a4f925147def857c9e9f7fe0fdbef4bb645a420473e012f50"
|
||||
dependencies = [
|
||||
"cranelift-codegen-shared",
|
||||
"cranelift-entity",
|
||||
@ -235,47 +244,26 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen-shared"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3992000be4d18df0fe332b7c42c120de896e8ec54cd7b6cfa050910a8c9f6e2f"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-entity"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-frontend"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
dependencies = [
|
||||
"cranelift-codegen",
|
||||
"log",
|
||||
"smallvec 1.1.0",
|
||||
"target-lexicon",
|
||||
]
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "722957e05064d97a3157bf0976deed0f3e8ee4f8a4ce167a7c724ca63a4e8bd9"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-native"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21398a0bc6ba389ea86964ac4a495426dd61080f2ddd306184777a8560fe9976"
|
||||
dependencies = [
|
||||
"cranelift-codegen",
|
||||
"raw-cpuid",
|
||||
"target-lexicon",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-wasm"
|
||||
version = "0.52.0"
|
||||
source = "git+https://github.com/wasmerio/cranelift?branch=wasmer#a81035ecbe81228097a5163f2b97f60145ca9396"
|
||||
dependencies = [
|
||||
"cranelift-codegen",
|
||||
"cranelift-entity",
|
||||
"cranelift-frontend",
|
||||
"log",
|
||||
"thiserror",
|
||||
"wasmparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "criterion"
|
||||
version = "0.2.11"
|
||||
@ -330,7 +318,7 @@ version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"lazy_static",
|
||||
@ -353,7 +341,7 @@ version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"cfg-if",
|
||||
"lazy_static",
|
||||
]
|
||||
@ -573,11 +561,11 @@ checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.3.0"
|
||||
version = "1.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2"
|
||||
checksum = "0b54058f0a6ff80b6803da8faf8997cde53872b38f4023728f6830b06cd3c0dc"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 1.0.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@ -773,7 +761,7 @@ version = "0.1.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
@ -783,7 +771,7 @@ version = "0.1.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "76bd5272412d173d6bf9afdf98db8612bbabc9a7a830b7bfc9c188911716132e"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
@ -794,7 +782,7 @@ version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1000,7 +988,7 @@ version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"libc",
|
||||
"rand_chacha 0.1.1",
|
||||
"rand_core 0.4.2",
|
||||
@ -1032,7 +1020,7 @@ version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"rand_core 0.3.1",
|
||||
]
|
||||
|
||||
@ -1128,7 +1116,7 @@ version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"autocfg 0.1.7",
|
||||
"rand_core 0.4.2",
|
||||
]
|
||||
|
||||
@ -1423,19 +1411,20 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
||||
|
||||
[[package]]
|
||||
name = "structopt"
|
||||
version = "0.3.7"
|
||||
version = "0.3.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "884ae79d6aad1e738f4a70dff314203fd498490a63ebc4d03ea83323c40b7b72"
|
||||
checksum = "df136b42d76b1fbea72e2ab3057343977b04b4a2e00836c3c7c0673829572713"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"lazy_static",
|
||||
"structopt-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "structopt-derive"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a97f829a34a0a9d5b353a881025a23b8c9fd09d46be6045df6b22920dbd7a93"
|
||||
checksum = "fd50a87d2f7b8958055f3e73a963d78feaccca3836767a9069844e34b5b03c0a"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error",
|
||||
@ -1673,7 +1662,7 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
|
||||
|
||||
[[package]]
|
||||
name = "wasmer"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"byteorder",
|
||||
@ -1704,14 +1693,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-clif-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"cranelift-codegen",
|
||||
"cranelift-entity",
|
||||
"cranelift-frontend",
|
||||
"cranelift-native",
|
||||
"cranelift-wasm",
|
||||
"libc",
|
||||
"nix",
|
||||
"rayon",
|
||||
@ -1720,22 +1707,50 @@ dependencies = [
|
||||
"serde_bytes",
|
||||
"serde_derive",
|
||||
"target-lexicon",
|
||||
"wasmer-clif-fork-frontend",
|
||||
"wasmer-clif-fork-wasm",
|
||||
"wasmer-runtime-core",
|
||||
"wasmer-win-exception-handler",
|
||||
"wasmparser",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-clif-fork-frontend"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6d2e13201ef9ef527ad30a6bf1b08e3e024a40cf2731f393d80375dc88506207"
|
||||
dependencies = [
|
||||
"cranelift-codegen",
|
||||
"log",
|
||||
"smallvec 1.1.0",
|
||||
"target-lexicon",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-clif-fork-wasm"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8b09302cc4fdc4efc03823cb3e1880b0fde578ba43f27ddd212811cb28c1530"
|
||||
dependencies = [
|
||||
"cranelift-codegen",
|
||||
"cranelift-entity",
|
||||
"log",
|
||||
"thiserror",
|
||||
"wasmer-clif-fork-frontend",
|
||||
"wasmparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-dev-utils"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-emscripten"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"getrandom",
|
||||
@ -1748,7 +1763,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-emscripten-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"glob 0.3.0",
|
||||
"wabt",
|
||||
@ -1770,7 +1785,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-llvm-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"cc",
|
||||
@ -1782,7 +1797,7 @@ dependencies = [
|
||||
"regex",
|
||||
"rustc_version",
|
||||
"semver",
|
||||
"smallvec 0.6.13",
|
||||
"smallvec 1.1.0",
|
||||
"wabt",
|
||||
"wasmer-runtime-core",
|
||||
"wasmparser",
|
||||
@ -1801,14 +1816,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-middleware-common"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"wasmer-runtime-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-middleware-common-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
"wabt",
|
||||
@ -1821,7 +1836,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
"lazy_static",
|
||||
@ -1838,7 +1853,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime-c-api"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"cbindgen",
|
||||
"libc",
|
||||
@ -1850,7 +1865,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime-core"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"blake2b_simd",
|
||||
@ -1869,14 +1884,14 @@ dependencies = [
|
||||
"serde-bench",
|
||||
"serde_bytes",
|
||||
"serde_derive",
|
||||
"smallvec 0.6.13",
|
||||
"smallvec 1.1.0",
|
||||
"wasmparser",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-runtime-core-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"wabt",
|
||||
"wasmer-clif-backend",
|
||||
@ -1887,7 +1902,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-singlepass-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder",
|
||||
@ -1898,13 +1913,13 @@ dependencies = [
|
||||
"nix",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"smallvec 0.6.13",
|
||||
"smallvec 1.1.0",
|
||||
"wasmer-runtime-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-spectests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"glob 0.3.0",
|
||||
"wabt",
|
||||
@ -1916,7 +1931,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-wasi"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder",
|
||||
@ -1933,7 +1948,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-wasi-experimental-io-devices"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"log",
|
||||
"minifb",
|
||||
@ -1946,7 +1961,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-wasi-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"glob 0.3.0",
|
||||
"wasmer-clif-backend",
|
||||
@ -1959,7 +1974,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasmer-win-exception-handler"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
dependencies = [
|
||||
"cmake",
|
||||
"libc",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
edition = "2018"
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
|
27
README.md
27
README.md
@ -38,19 +38,20 @@ curl https://get.wasmer.io -sSfL | sh
|
||||
|
||||
Wasmer runtime can be used as a library embedded in different languages, so you can use WebAssembly anywhere:
|
||||
|
||||
| | Language | Author(s) | Maintenance | Release | Stars |
|
||||
|-|-|-|-|-|-|
|
||||
|  | [**Rust**](https://github.com/wasmerio/wasmer-rust-example) | Wasmer | actively developed | <a href="https://crates.io/crates/wasmer-runtime/" target="_blank"></a> |  |
|
||||
|  | [**C/C++**](https://github.com/wasmerio/wasmer-c-api) | Wasmer | actively developed | <a href="https://github.com/wasmerio/wasmer-c-api/" target="_blank"></a> |  |
|
||||
|  | [**Python**](https://github.com/wasmerio/python-ext-wasm) | Wasmer | actively developed | <a href="https://pypi.org/project/wasmer/" target="_blank"></a> |  |
|
||||
|  | [**Go**](https://github.com/wasmerio/go-ext-wasm) | Wasmer | actively developed | <a href="https://github.com/wasmerio/go-ext-wasm" target="_blank"></a> |  |
|
||||
|  | [**PHP**](https://github.com/wasmerio/php-ext-wasm) | Wasmer | actively developed | <a href="https://pecl.php.net/package/wasm" target="_blank"></a> |  |
|
||||
|  | [**Ruby**](https://github.com/wasmerio/ruby-ext-wasm) | Wasmer | actively developed | <a href="https://rubygems.org/gems/wasmer" target="_blank"></a> |  |
|
||||
|  | [**Postgres**](https://github.com/wasmerio/postgres-ext-wasm) | Wasmer | actively developed | <a href="https://github.com/wasmerio/postgres-ext-wasm" target="_blank"></a> |  |
|
||||
|  | [**JavaScript**](https://github.com/wasmerio/wasmer-js) | Wasmer | actively developed | <a href="https://www.npmjs.com/package/@wasmer/wasi" target="_blank"></a> |  |
|
||||
|  | [**C#/.Net**](https://github.com/migueldeicaza/WasmerSharp) | [Miguel de Icaza](https://github.com/migueldeicaza) | actively developed | <a href="https://www.nuget.org/packages/WasmerSharp/" target="_blank"></a> |  |
|
||||
|  | [**R**](https://github.com/dirkschumacher/wasmr) | [Dirk Schumacher](https://github.com/dirkschumacher) | actively developed | |  |
|
||||
| ❓ | [your language is missing?](https://github.com/wasmerio/wasmer/issues/new?assignees=&labels=%F0%9F%8E%89+enhancement&template=---feature-request.md&title=) | | | |
|
||||
| | Language | Docs | Author(s) | Maintenance | Release | Stars |
|
||||
|-|-|-|-|-|-|-|
|
||||
|  | [**Rust**](https://github.com/wasmerio/wasmer-rust-example) | [Docs](https://wasmerio.github.io/wasmer/crates/wasmer_runtime/) | Wasmer | actively developed | <a href="https://crates.io/crates/wasmer-runtime/" target="_blank"></a> |  |
|
||||
|  | [**C/C++**](https://github.com/wasmerio/wasmer-c-api) | [Docs](https://wasmerio.github.io/wasmer/c/runtime-c-api/) | Wasmer | actively developed | <a href="https://github.com/wasmerio/wasmer-c-api/" target="_blank"></a> |  |
|
||||
|  | [**Python**](https://github.com/wasmerio/python-ext-wasm) | [Docs](https://github.com/wasmerio/python-ext-wasm#api-of-the-wasmer-extensionmodule) | Wasmer | actively developed | <a href="https://pypi.org/project/wasmer/" target="_blank"></a> |  |
|
||||
|  | [**Go**](https://github.com/wasmerio/go-ext-wasm) | [Docs](https://github.com/wasmerio/go-ext-wasm#basic-example-exported-function) | Wasmer | actively developed | <a href="https://github.com/wasmerio/go-ext-wasm" target="_blank"></a> |  |
|
||||
|  | [**PHP**](https://github.com/wasmerio/php-ext-wasm) | [Docs](https://wasmerio.github.io/php-ext-wasm/wasm/) | Wasmer | actively developed | <a href="https://pecl.php.net/package/wasm" target="_blank"></a> |  |
|
||||
|  | [**Ruby**](https://github.com/wasmerio/ruby-ext-wasm) | [Docs](https://www.rubydoc.info/gems/wasmer/) | Wasmer | actively developed | <a href="https://rubygems.org/gems/wasmer" target="_blank"></a> |  |
|
||||
|  | [**Postgres**](https://github.com/wasmerio/postgres-ext-wasm) | | Wasmer | actively developed | <a href="https://github.com/wasmerio/postgres-ext-wasm" target="_blank"></a> |  |
|
||||
|  | [**JavaScript**](https://github.com/wasmerio/wasmer-js) | [Docs](https://docs.wasmer.io/wasmer-js/wasmer-js) | Wasmer | actively developed | <a href="https://www.npmjs.com/package/@wasmer/wasi" target="_blank"></a> |  |
|
||||
|  | [**C#/.Net**](https://github.com/migueldeicaza/WasmerSharp) | [Docs](https://migueldeicaza.github.io/WasmerSharp/) |[Miguel de Icaza](https://github.com/migueldeicaza) | actively developed | <a href="https://www.nuget.org/packages/WasmerSharp/" target="_blank"></a> |  |
|
||||
|  | [**R**](https://github.com/dirkschumacher/wasmr) | [Docs](https://github.com/dirkschumacher/wasmr#example) | [Dirk Schumacher](https://github.com/dirkschumacher) | actively developed | |  |
|
||||
|  | [**Elixir**](https://github.com/tessi/wasmex) | [Docs](https://hexdocs.pm/wasmex/api-reference.html) | [Philipp Tessenow](https://github.com/tessi) | actively developed | <a href="https://hex.pm/packages/wasmex" target="_blank"></a> |  |
|
||||
| ❓ | [your language is missing?](https://github.com/wasmerio/wasmer/issues/new?assignees=&labels=%F0%9F%8E%89+enhancement&template=---feature-request.md&title=) | | | | |
|
||||
|
||||
### Usage
|
||||
|
||||
|
@ -17,18 +17,36 @@ jobs:
|
||||
- template: .azure/install-rust.yml
|
||||
- script: |
|
||||
rustup component add rustfmt
|
||||
rustup component add clippy || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
|
||||
displayName: Lint dependencies
|
||||
- script: cargo fmt --all -- --check
|
||||
displayName: Lint
|
||||
variables:
|
||||
rust_toolchain: '1.39.0'
|
||||
|
||||
- job: clippy_lint
|
||||
pool:
|
||||
vmImage: "ubuntu-18.04"
|
||||
steps:
|
||||
- checkout: self
|
||||
submodules: true
|
||||
- template: .azure/install-rust.yml
|
||||
- template: .azure/install-llvm.yml
|
||||
- template: .azure/install-sccache.yml
|
||||
- template: .azure/install-cmake.yml
|
||||
- script: |
|
||||
rustup component add rustfmt
|
||||
rustup component add clippy || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
|
||||
displayName: Lint dependencies with clippy
|
||||
- script: cargo clippy --workspace
|
||||
displayName: Clippy Lint
|
||||
variables:
|
||||
rust_toolchain: nightly-2019-12-19
|
||||
|
||||
- job: Test
|
||||
strategy:
|
||||
matrix:
|
||||
linux:
|
||||
imageName: "ubuntu-16.04"
|
||||
imageName: "ubuntu-18.04"
|
||||
rust_toolchain: nightly-2019-12-19
|
||||
mac:
|
||||
imageName: "macos-10.14"
|
||||
@ -73,7 +91,7 @@ jobs:
|
||||
|
||||
- job: Check
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
vmImage: "ubuntu-18.04"
|
||||
variables:
|
||||
rust_toolchain: nightly-2019-12-19
|
||||
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
|
||||
@ -92,7 +110,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
linux:
|
||||
imageName: "ubuntu-16.04"
|
||||
imageName: "ubuntu-18.04"
|
||||
rust_toolchain: nightly-2019-12-19
|
||||
mac:
|
||||
imageName: "macos-10.14"
|
||||
@ -159,7 +177,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
linux:
|
||||
imageName: "ubuntu-16.04"
|
||||
imageName: "ubuntu-18.04"
|
||||
rust_toolchain: nightly-2019-12-19
|
||||
mac:
|
||||
imageName: "macos-10.14"
|
||||
@ -212,7 +230,7 @@ jobs:
|
||||
|
||||
- job: Build_Docs
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
vmImage: "ubuntu-18.04"
|
||||
variables:
|
||||
rust_toolchain: nightly-2019-08-15
|
||||
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
|
||||
@ -287,7 +305,7 @@ jobs:
|
||||
- Build_Docs
|
||||
displayName: Deploy API Documentation to GitHub
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
vmImage: "ubuntu-18.04"
|
||||
condition: in(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||
steps:
|
||||
- checkout: self
|
||||
|
BIN
docs/assets/languages/elixir.png
Normal file
BIN
docs/assets/languages/elixir.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-clif-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Wasmer runtime Cranelift compiler backend"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -11,12 +11,12 @@ edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.12.0" }
|
||||
cranelift-native = { git = "https://github.com/wasmerio/cranelift", branch = "wasmer" }
|
||||
cranelift-codegen = { git = "https://github.com/wasmerio/cranelift", branch = "wasmer" }
|
||||
cranelift-entity = { git = "https://github.com/wasmerio/cranelift", branch = "wasmer" }
|
||||
cranelift-frontend = { git = "https://github.com/wasmerio/cranelift", branch = "wasmer" }
|
||||
cranelift-wasm = { git = "https://github.com/wasmerio/cranelift", branch = "wasmer" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
cranelift-native = "0.52.0"
|
||||
cranelift-codegen = "0.52.0"
|
||||
cranelift-entity = "0.52.0"
|
||||
cranelift-frontend = { package = "wasmer-clif-fork-frontend", version = "0.52.0" }
|
||||
cranelift-wasm = { package = "wasmer-clif-fork-wasm", version = "0.52.0" }
|
||||
target-lexicon = "0.9"
|
||||
wasmparser = "0.45.0"
|
||||
byteorder = "1.3.2"
|
||||
@ -37,4 +37,4 @@ 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.12.0" }
|
||||
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.13.1" }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-dev-utils"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Wasmer runtime core library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-emscripten-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-runtime = { path = "../runtime", version = "0.12.0", default-features = false }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.12.0", optional = true}
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.12.0", optional = true, features = ["test"] }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.12.0", optional = true }
|
||||
wasmer-emscripten = { path = "../emscripten", version = "0.13.1" }
|
||||
wasmer-runtime = { path = "../runtime", version = "0.13.1", default-features = false }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.13.1", optional = true}
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.13.1", optional = true, features = ["test"] }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.13.1", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
wabt = "0.9.1"
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.12.0"}
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.13.1"}
|
||||
|
||||
[build-dependencies]
|
||||
glob = "0.3"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-emscripten"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Wasmer runtime emscripten implementation library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -15,7 +15,7 @@ lazy_static = "1.4"
|
||||
libc = "0.2.60"
|
||||
log = "0.4"
|
||||
time = "0.1"
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.12.0" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
getrandom = "0.1"
|
||||
|
@ -9,8 +9,8 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wabt = "0.9.1"
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.12.0" }
|
||||
wasmer-runtime = { path = "../runtime", version = "0.12.0" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.12.0", features = ["test"] }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
wasmer-runtime = { path = "../runtime", version = "0.13.1" }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.13.1", features = ["test"] }
|
||||
|
||||
[features]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-llvm-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
wasmparser = "0.45.0"
|
||||
smallvec = "0.6"
|
||||
goblin = "0.0.24"
|
||||
|
@ -1171,9 +1171,10 @@ pub fn tbaa_label<'ctx>(
|
||||
|
||||
// TODO: ContextRef can't return us the lifetime from module through Deref.
|
||||
// This could be fixed once generic_associated_types is stable.
|
||||
let context2 = &*context;
|
||||
let context = unsafe { std::mem::transmute::<&Context, &'ctx Context>(context2) };
|
||||
std::mem::forget(context2);
|
||||
let context = {
|
||||
let context2 = &*context;
|
||||
unsafe { std::mem::transmute::<&Context, &'ctx Context>(context2) }
|
||||
};
|
||||
|
||||
// `!wasmer_tbaa_root = {}`, the TBAA root node for wasmer.
|
||||
let tbaa_root = module
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-middleware-common-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-middleware-common = { path = "../middleware-common", version = "0.12.0" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.12.0", optional = true }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.12.0", features = ["test"], optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.12.0", optional = true }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
wasmer-middleware-common = { path = "../middleware-common", version = "0.13.1" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.13.1", optional = true }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.13.1", features = ["test"], optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.13.1", optional = true }
|
||||
|
||||
[features]
|
||||
clif = ["wasmer-clif-backend"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-middleware-common"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime-c-api"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Wasmer C API library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -19,22 +19,22 @@ libc = "0.2.60"
|
||||
[dependencies.wasmer-runtime]
|
||||
default-features = false
|
||||
path = "../runtime"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
|
||||
[dependencies.wasmer-runtime-core]
|
||||
default-features = false
|
||||
path = "../runtime-core"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
|
||||
[dependencies.wasmer-wasi]
|
||||
default-features = false
|
||||
path = "../wasi"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
optional = true
|
||||
|
||||
[dependencies.wasmer-emscripten]
|
||||
path = "../emscripten"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
|
8
lib/runtime-c-api/doc/theme/css/wasmer.css
vendored
8
lib/runtime-c-api/doc/theme/css/wasmer.css
vendored
@ -184,3 +184,11 @@ table.fieldtable,
|
||||
table.fieldtable td {
|
||||
border-color: var(--secondary-color) !important;
|
||||
}
|
||||
|
||||
div.fragment {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
div.fragment div.line {
|
||||
line-height: 1.15rem;
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ pub unsafe extern "C" fn wasmer_export_func_call(
|
||||
}
|
||||
|
||||
let params: Vec<Value> = {
|
||||
if params_len <= 0 {
|
||||
if params_len == 0 {
|
||||
vec![]
|
||||
} else {
|
||||
slice::from_raw_parts::<wasmer_value_t>(params, params_len as usize)
|
||||
|
@ -17,18 +17,76 @@ use wasmer_runtime_core::{
|
||||
import::{ImportObject, Namespace},
|
||||
};
|
||||
|
||||
/// Opaque pointer to a `wasmer_runtime::Instance` value in Rust.
|
||||
///
|
||||
/// A `wasmer_runtime::Instance` represents a WebAssembly instance. It
|
||||
/// is generally generated by the `wasmer_instantiate()` function, or by
|
||||
/// the `wasmer_module_instantiate()` function for the most common paths.
|
||||
#[repr(C)]
|
||||
pub struct wasmer_instance_t;
|
||||
|
||||
/// Opaque pointer to a `wasmer_runtime::Ctx` value in Rust.
|
||||
///
|
||||
/// An instance context is passed to any host function (aka imported
|
||||
/// function) as the first argument. It is necessary to read the
|
||||
/// instance data or the memory, respectively with the
|
||||
/// `wasmer_instance_context_data_get()` function, and the
|
||||
/// `wasmer_instance_context_memory()` function.
|
||||
///
|
||||
/// It is also possible to get the instance context outside a host
|
||||
/// function by using the `wasmer_instance_context_get()` function.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// ```c
|
||||
/// // A host function that prints data from the WebAssembly memory to
|
||||
/// // the standard output.
|
||||
/// void print(wasmer_instance_context_t *context, int32_t pointer, int32_t length) {
|
||||
/// // Use `wasmer_instance_context` to get back the first instance memory.
|
||||
/// const wasmer_memory_t *memory = wasmer_instance_context_memory(context, 0);
|
||||
///
|
||||
/// // Continue…
|
||||
/// }
|
||||
/// ```
|
||||
#[repr(C)]
|
||||
pub struct wasmer_instance_context_t;
|
||||
|
||||
/// Creates a new Instance from the given wasm bytes and imports.
|
||||
/// Creates a new WebAssembly instance from the given bytes and imports.
|
||||
///
|
||||
/// Returns `wasmer_result_t::WASMER_OK` upon success.
|
||||
/// The result is stored in the first argument `instance` if
|
||||
/// successful, i.e. when the function returns
|
||||
/// `wasmer_result_t::WASMER_OK`. Otherwise
|
||||
/// `wasmer_result_t::WASMER_ERROR` is returned, and
|
||||
/// `wasmer_last_error_length()` with `wasmer_last_error_message()` must
|
||||
/// be used to read the error message.
|
||||
///
|
||||
/// Returns `wasmer_result_t::WASMER_ERROR` upon failure. Use `wasmer_last_error_length`
|
||||
/// and `wasmer_last_error_message` to get an error message.
|
||||
/// Example:
|
||||
///
|
||||
/// ```c
|
||||
/// // 1. Read a WebAssembly module from a file.
|
||||
/// FILE *file = fopen("sum.wasm", "r");
|
||||
/// fseek(file, 0, SEEK_END);
|
||||
/// long bytes_length = ftell(file);
|
||||
/// uint8_t *bytes = malloc(bytes_length);
|
||||
/// fseek(file, 0, SEEK_SET);
|
||||
/// fread(bytes, 1, bytes_length, file);
|
||||
/// fclose(file);
|
||||
///
|
||||
/// // 2. Declare the imports (here, none).
|
||||
/// wasmer_import_t imports[] = {};
|
||||
///
|
||||
/// // 3. Instantiate the WebAssembly module.
|
||||
/// wasmer_instance_t *instance = NULL;
|
||||
/// wasmer_result_t result = wasmer_instantiate(&instance, bytes, bytes_length, imports, 0);
|
||||
///
|
||||
/// // 4. Check for errors.
|
||||
/// if (result != WASMER_OK) {
|
||||
/// int error_length = wasmer_last_error_length();
|
||||
/// char *error = malloc(error_length);
|
||||
/// wasmer_last_error_message(error, error_length);
|
||||
/// // Do something with `error`…
|
||||
/// }
|
||||
/// ```
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasmer_instantiate(
|
||||
|
@ -44,13 +44,26 @@ pub unsafe extern "C" fn wasmer_compile(
|
||||
wasmer_result_t::WASMER_OK
|
||||
}
|
||||
|
||||
/// Returns true for valid wasm bytes and false for invalid bytes
|
||||
/// Validates a sequence of bytes hoping it represents a valid WebAssembly module.
|
||||
///
|
||||
/// The function returns true if the bytes are valid, false otherwise.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// ```c
|
||||
/// bool result = wasmer_validate(bytes, bytes_length);
|
||||
///
|
||||
/// if (false == result) {
|
||||
/// // Do something…
|
||||
/// }
|
||||
/// ```
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasmer_validate(wasm_bytes: *const u8, wasm_bytes_len: u32) -> bool {
|
||||
if wasm_bytes.is_null() {
|
||||
return false;
|
||||
}
|
||||
|
||||
let bytes: &[u8] = slice::from_raw_parts(wasm_bytes, wasm_bytes_len as usize);
|
||||
|
||||
wasmer_runtime_core::validate(bytes)
|
||||
|
@ -90,6 +90,13 @@ typedef struct {
|
||||
|
||||
} wasmer_module_t;
|
||||
|
||||
/**
|
||||
* Opaque pointer to a `wasmer_runtime::Instance` value in Rust.
|
||||
*
|
||||
* A `wasmer_runtime::Instance` represents a WebAssembly instance. It
|
||||
* is generally generated by the `wasmer_instantiate()` function, or by
|
||||
* the `wasmer_module_instantiate()` function for the most common paths.
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
} wasmer_instance_t;
|
||||
@ -209,6 +216,31 @@ typedef struct {
|
||||
|
||||
} wasmer_import_object_iter_t;
|
||||
|
||||
/**
|
||||
* Opaque pointer to a `wasmer_runtime::Ctx` value in Rust.
|
||||
*
|
||||
* An instance context is passed to any host function (aka imported
|
||||
* function) as the first argument. It is necessary to read the
|
||||
* instance data or the memory, respectively with the
|
||||
* `wasmer_instance_context_data_get()` function, and the
|
||||
* `wasmer_instance_context_memory()` function.
|
||||
*
|
||||
* It is also possible to get the instance context outside a host
|
||||
* function by using the `wasmer_instance_context_get()` function.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```c
|
||||
* // A host function that prints data from the WebAssembly memory to
|
||||
* // the standard output.
|
||||
* void print(wasmer_instance_context_t *context, int32_t pointer, int32_t length) {
|
||||
* // Use `wasmer_instance_context` to get back the first instance memory.
|
||||
* const wasmer_memory_t *memory = wasmer_instance_context_memory(context, 0);
|
||||
*
|
||||
* // Continue…
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
} wasmer_instance_context_t;
|
||||
@ -727,12 +759,42 @@ void wasmer_instance_destroy(wasmer_instance_t *instance);
|
||||
void wasmer_instance_exports(wasmer_instance_t *instance, wasmer_exports_t **exports);
|
||||
|
||||
/**
|
||||
* Creates a new Instance from the given wasm bytes and imports.
|
||||
* Creates a new WebAssembly instance from the given bytes and imports.
|
||||
*
|
||||
* Returns `wasmer_result_t::WASMER_OK` upon success.
|
||||
* The result is stored in the first argument `instance` if
|
||||
* successful, i.e. when the function returns
|
||||
* `wasmer_result_t::WASMER_OK`. Otherwise
|
||||
* `wasmer_result_t::WASMER_ERROR` is returned, and
|
||||
* `wasmer_last_error_length()` with `wasmer_last_error_message()` must
|
||||
* be used to read the error message.
|
||||
*
|
||||
* Returns `wasmer_result_t::WASMER_ERROR` upon failure. Use `wasmer_last_error_length`
|
||||
* and `wasmer_last_error_message` to get an error message.
|
||||
* Example:
|
||||
*
|
||||
* ```c
|
||||
* // 1. Read a WebAssembly module from a file.
|
||||
* FILE *file = fopen("sum.wasm", "r");
|
||||
* fseek(file, 0, SEEK_END);
|
||||
* long bytes_length = ftell(file);
|
||||
* uint8_t *bytes = malloc(bytes_length);
|
||||
* fseek(file, 0, SEEK_SET);
|
||||
* fread(bytes, 1, bytes_length, file);
|
||||
* fclose(file);
|
||||
*
|
||||
* // 2. Declare the imports (here, none).
|
||||
* wasmer_import_t imports[] = {};
|
||||
*
|
||||
* // 3. Instantiate the WebAssembly module.
|
||||
* wasmer_instance_t *instance = NULL;
|
||||
* wasmer_result_t result = wasmer_instantiate(&instance, bytes, bytes_length, imports, 0);
|
||||
*
|
||||
* // 4. Check for errors.
|
||||
* if (result != WASMER_OK) {
|
||||
* int error_length = wasmer_last_error_length();
|
||||
* char *error = malloc(error_length);
|
||||
* wasmer_last_error_message(error, error_length);
|
||||
* // Do something with `error`…
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
wasmer_result_t wasmer_instantiate(wasmer_instance_t **instance,
|
||||
uint8_t *wasm_bytes,
|
||||
@ -999,7 +1061,19 @@ void *wasmer_trampoline_get_context(void);
|
||||
wasmer_result_t wasmer_trap(const wasmer_instance_context_t *ctx, const char *error_message);
|
||||
|
||||
/**
|
||||
* Returns true for valid wasm bytes and false for invalid bytes
|
||||
* Validates a sequence of bytes hoping it represents a valid WebAssembly module.
|
||||
*
|
||||
* The function returns true if the bytes are valid, false otherwise.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```c
|
||||
* bool result = wasmer_validate(bytes, bytes_length);
|
||||
*
|
||||
* if (false == result) {
|
||||
* // Do something…
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
bool wasmer_validate(const uint8_t *wasm_bytes, uint32_t wasm_bytes_len);
|
||||
|
||||
|
@ -77,6 +77,11 @@ struct wasmer_module_t {
|
||||
|
||||
};
|
||||
|
||||
/// Opaque pointer to a `wasmer_runtime::Instance` value in Rust.
|
||||
///
|
||||
/// A `wasmer_runtime::Instance` represents a WebAssembly instance. It
|
||||
/// is generally generated by the `wasmer_instantiate()` function, or by
|
||||
/// the `wasmer_module_instantiate()` function for the most common paths.
|
||||
struct wasmer_instance_t {
|
||||
|
||||
};
|
||||
@ -182,6 +187,29 @@ struct wasmer_import_object_iter_t {
|
||||
|
||||
};
|
||||
|
||||
/// Opaque pointer to a `wasmer_runtime::Ctx` value in Rust.
|
||||
///
|
||||
/// An instance context is passed to any host function (aka imported
|
||||
/// function) as the first argument. It is necessary to read the
|
||||
/// instance data or the memory, respectively with the
|
||||
/// `wasmer_instance_context_data_get()` function, and the
|
||||
/// `wasmer_instance_context_memory()` function.
|
||||
///
|
||||
/// It is also possible to get the instance context outside a host
|
||||
/// function by using the `wasmer_instance_context_get()` function.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// ```c
|
||||
/// // A host function that prints data from the WebAssembly memory to
|
||||
/// // the standard output.
|
||||
/// void print(wasmer_instance_context_t *context, int32_t pointer, int32_t length) {
|
||||
/// // Use `wasmer_instance_context` to get back the first instance memory.
|
||||
/// const wasmer_memory_t *memory = wasmer_instance_context_memory(context, 0);
|
||||
///
|
||||
/// // Continue…
|
||||
/// }
|
||||
/// ```
|
||||
struct wasmer_instance_context_t {
|
||||
|
||||
};
|
||||
@ -579,12 +607,42 @@ void wasmer_instance_destroy(wasmer_instance_t *instance);
|
||||
/// The caller owns the object and should call `wasmer_exports_destroy` to free it.
|
||||
void wasmer_instance_exports(wasmer_instance_t *instance, wasmer_exports_t **exports);
|
||||
|
||||
/// Creates a new Instance from the given wasm bytes and imports.
|
||||
/// Creates a new WebAssembly instance from the given bytes and imports.
|
||||
///
|
||||
/// Returns `wasmer_result_t::WASMER_OK` upon success.
|
||||
/// The result is stored in the first argument `instance` if
|
||||
/// successful, i.e. when the function returns
|
||||
/// `wasmer_result_t::WASMER_OK`. Otherwise
|
||||
/// `wasmer_result_t::WASMER_ERROR` is returned, and
|
||||
/// `wasmer_last_error_length()` with `wasmer_last_error_message()` must
|
||||
/// be used to read the error message.
|
||||
///
|
||||
/// Returns `wasmer_result_t::WASMER_ERROR` upon failure. Use `wasmer_last_error_length`
|
||||
/// and `wasmer_last_error_message` to get an error message.
|
||||
/// Example:
|
||||
///
|
||||
/// ```c
|
||||
/// // 1. Read a WebAssembly module from a file.
|
||||
/// FILE *file = fopen("sum.wasm", "r");
|
||||
/// fseek(file, 0, SEEK_END);
|
||||
/// long bytes_length = ftell(file);
|
||||
/// uint8_t *bytes = malloc(bytes_length);
|
||||
/// fseek(file, 0, SEEK_SET);
|
||||
/// fread(bytes, 1, bytes_length, file);
|
||||
/// fclose(file);
|
||||
///
|
||||
/// // 2. Declare the imports (here, none).
|
||||
/// wasmer_import_t imports[] = {};
|
||||
///
|
||||
/// // 3. Instantiate the WebAssembly module.
|
||||
/// wasmer_instance_t *instance = NULL;
|
||||
/// wasmer_result_t result = wasmer_instantiate(&instance, bytes, bytes_length, imports, 0);
|
||||
///
|
||||
/// // 4. Check for errors.
|
||||
/// if (result != WASMER_OK) {
|
||||
/// int error_length = wasmer_last_error_length();
|
||||
/// char *error = malloc(error_length);
|
||||
/// wasmer_last_error_message(error, error_length);
|
||||
/// // Do something with `error`…
|
||||
/// }
|
||||
/// ```
|
||||
wasmer_result_t wasmer_instantiate(wasmer_instance_t **instance,
|
||||
uint8_t *wasm_bytes,
|
||||
uint32_t wasm_bytes_len,
|
||||
@ -793,7 +851,19 @@ void *wasmer_trampoline_get_context();
|
||||
/// This function never returns otherwise.
|
||||
wasmer_result_t wasmer_trap(const wasmer_instance_context_t *ctx, const char *error_message);
|
||||
|
||||
/// Returns true for valid wasm bytes and false for invalid bytes
|
||||
/// Validates a sequence of bytes hoping it represents a valid WebAssembly module.
|
||||
///
|
||||
/// The function returns true if the bytes are valid, false otherwise.
|
||||
///
|
||||
/// Example:
|
||||
///
|
||||
/// ```c
|
||||
/// bool result = wasmer_validate(bytes, bytes_length);
|
||||
///
|
||||
/// if (false == result) {
|
||||
/// // Do something…
|
||||
/// }
|
||||
/// ```
|
||||
bool wasmer_validate(const uint8_t *wasm_bytes, uint32_t wasm_bytes_len);
|
||||
|
||||
#if defined(WASMER_WASI_ENABLED)
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime-core-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.12.0", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.12.0", optional = true }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.12.0", features = ["test"], optional = true }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.13.1", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.13.1", optional = true }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.13.1", features = ["test"], optional = true }
|
||||
|
||||
[features]
|
||||
default = ["backend-cranelift"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime-core"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Wasmer runtime core library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
|
@ -76,9 +76,18 @@ impl Default for MemoryBoundCheckMode {
|
||||
}
|
||||
|
||||
/// Controls which experimental features will be enabled.
|
||||
/// Features usually have a corresponding [WebAssembly proposal][wasm-props].
|
||||
///
|
||||
/// [wasm-props]: https://github.com/WebAssembly/proposals
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Features {
|
||||
/// Whether support for the [SIMD proposal][simd-prop] is enabled.
|
||||
///
|
||||
/// [simd-prop]: https://github.com/webassembly/simd
|
||||
pub simd: bool,
|
||||
/// Whether support for the [threads proposal][threads-prop] is enabled.
|
||||
///
|
||||
/// [threads-prop]: https://github.com/webassembly/threads
|
||||
pub threads: bool,
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ pub fn validate_and_report_errors_with_features(
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new module from the given cache `Artifact` for the specified compiler backend
|
||||
/// Creates a new module from the given cache [`Artifact`] for the specified compiler backend
|
||||
pub unsafe fn load_cache_with(
|
||||
cache: Artifact,
|
||||
compiler: &dyn backend::Compiler,
|
||||
|
@ -627,9 +627,11 @@ pub mod x64 {
|
||||
use crate::vm::Ctx;
|
||||
use std::any::Any;
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
unsafe fn compute_vmctx_deref(vmctx: *const Ctx, seq: &[usize]) -> u64 {
|
||||
let mut ptr = &vmctx as *const *const Ctx as *const u8;
|
||||
for x in seq {
|
||||
debug_assert!(ptr.align_offset(std::mem::align_of::<*const u8>()) == 0);
|
||||
ptr = (*(ptr as *const *const u8)).offset(*x as isize);
|
||||
}
|
||||
ptr as usize as u64
|
||||
|
@ -1,85 +0,0 @@
|
||||
#[derive(Debug, Clone)]
|
||||
enum MonoVecInner<T> {
|
||||
None,
|
||||
Inline(T),
|
||||
Heap(Vec<T>),
|
||||
}
|
||||
|
||||
/// A type that can hold zero items,
|
||||
/// one item, or many items.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MonoVec<T> {
|
||||
inner: MonoVecInner<T>,
|
||||
}
|
||||
|
||||
impl<T> MonoVec<T> {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
inner: MonoVecInner::None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_inline(item: T) -> Self {
|
||||
Self {
|
||||
inner: MonoVecInner::Inline(item),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_capacity(capacity: usize) -> Self {
|
||||
match capacity {
|
||||
0 | 1 => Self::new(),
|
||||
_ => Self {
|
||||
inner: MonoVecInner::Heap(Vec::with_capacity(capacity)),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn push(&mut self, item: T) {
|
||||
let uninit = MonoVecInner::None;
|
||||
let prev = mem::replace(&mut self.inner, uninit);
|
||||
let next = match prev {
|
||||
MonoVecInner::None => MonoVecInner::Inline(item),
|
||||
MonoVecInner::Inline(previous_item) => MonoVecInner::Heap(vec![previous_item, item]),
|
||||
MonoVecInner::Heap(mut v) => {
|
||||
v.push(item);
|
||||
MonoVecInner::Heap(v)
|
||||
}
|
||||
};
|
||||
let uninit = mem::replace(&mut self.inner, next);
|
||||
mem::forget(uninit);
|
||||
}
|
||||
|
||||
pub fn pop(&mut self) -> Option<T> {
|
||||
match self.inner {
|
||||
MonoVecInner::None => None,
|
||||
MonoVecInner::Inline(ref mut item) => {
|
||||
let uninit = unsafe { mem::zeroed() };
|
||||
let item = mem::replace(item, uninit);
|
||||
let uninit = mem::replace(&mut self.inner, MonoVecInner::None);
|
||||
mem::forget(uninit);
|
||||
Some(item)
|
||||
}
|
||||
MonoVecInner::Heap(ref mut v) => v.pop(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_slice(&self) -> &[T] {
|
||||
match self.inner {
|
||||
MonoVecInner::None => unsafe {
|
||||
slice::from_raw_parts(mem::align_of::<T>() as *const T, 0)
|
||||
},
|
||||
MonoVecInner::Inline(ref item) => slice::from_ref(item),
|
||||
MonoVecInner::Heap(ref v) => &v[..],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_slice_mut(&mut self) -> &mut [T] {
|
||||
match self.inner {
|
||||
MonoVecInner::None => unsafe {
|
||||
slice::from_raw_parts_mut(mem::align_of::<T>() as *mut T, 0)
|
||||
},
|
||||
MonoVecInner::Inline(ref mut item) => slice::from_mut(item),
|
||||
MonoVecInner::Heap(ref mut v) => &mut v[..],
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
//! The units module provides common WebAssembly units like `Pages` and conversion functions into
|
||||
//! The units module provides common WebAssembly units like [`Pages`] and conversion functions into
|
||||
//! other units.
|
||||
use crate::error::PageError;
|
||||
use std::{
|
||||
@ -8,7 +8,7 @@ use std::{
|
||||
|
||||
/// The page size in bytes of a wasm page.
|
||||
pub const WASM_PAGE_SIZE: usize = 65_536;
|
||||
/// Tbe max number of wasm pages allowed.
|
||||
/// The max number of wasm pages allowed.
|
||||
pub const WASM_MAX_PAGES: usize = 65_536;
|
||||
// From emscripten resize_heap implementation
|
||||
/// The minimum number of wasm pages allowed.
|
||||
|
@ -54,11 +54,14 @@ pub struct Ctx {
|
||||
/// This is intended to be user-supplied, per-instance
|
||||
/// contextual data. There are currently some issue with it,
|
||||
/// notably that it cannot be set before running the `start`
|
||||
/// function in a WebAssembly module.
|
||||
/// function in a WebAssembly module. Additionally, the `data`
|
||||
/// field may be taken by another ABI implementation that the user
|
||||
/// wishes to use in addition to their own, such as WASI. This issue is
|
||||
/// being discussed at [#1111](https://github.com/wasmerio/wasmer/pull/1111).
|
||||
///
|
||||
/// [#219](https://github.com/wasmerio/wasmer/pull/219) fixes that
|
||||
/// issue, as well as allowing the user to have *per-function*
|
||||
/// context, instead of just per-instance.
|
||||
/// Alternatively, per-function data can be used if the function in the
|
||||
/// [`ImportObject`] is a closure. This cannot duplicate data though,
|
||||
/// so if data may be shared if the [`ImportObject`] is reused.
|
||||
pub data: *mut c_void,
|
||||
|
||||
/// If there's a function set in this field, it gets called
|
||||
@ -567,6 +570,7 @@ pub struct FuncCtx {
|
||||
|
||||
impl FuncCtx {
|
||||
/// Offset to the `vmctx` field.
|
||||
#[allow(clippy::erasing_op)]
|
||||
pub const fn offset_vmctx() -> u8 {
|
||||
0 * (mem::size_of::<usize>() as u8)
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
//! Functions called from the generated code.
|
||||
|
||||
#![allow(clippy::cast_ptr_alignment)]
|
||||
|
||||
use crate::{
|
||||
@ -12,6 +14,16 @@ use crate::{
|
||||
// | LOCAL MEMORIES |
|
||||
// +*****************************+
|
||||
|
||||
/// Increase the size of the static local memory with offset `memory_index` by
|
||||
/// `delta` [`Pages`].
|
||||
///
|
||||
/// This function returns the number of pages before growing if successful, or
|
||||
/// `-1` if the grow failed.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`StaticMemory`].
|
||||
pub unsafe extern "C" fn local_static_memory_grow(
|
||||
ctx: &mut vm::Ctx,
|
||||
memory_index: LocalMemoryIndex,
|
||||
@ -31,16 +43,32 @@ pub unsafe extern "C" fn local_static_memory_grow(
|
||||
ret
|
||||
}
|
||||
|
||||
/// Get the size of a local [`StaticMemory`] in [`Pages`].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`StaticMemory`].
|
||||
pub unsafe extern "C" fn local_static_memory_size(
|
||||
ctx: &vm::Ctx,
|
||||
memory_index: LocalMemoryIndex,
|
||||
) -> Pages {
|
||||
let local_memory = *ctx.internal.memories.add(memory_index.index());
|
||||
let memory = (*local_memory).memory as *mut StaticMemory;
|
||||
let memory = (*local_memory).memory as *const StaticMemory;
|
||||
|
||||
(*memory).size()
|
||||
}
|
||||
|
||||
/// Increase the size of the dynamic local memory with offset `memory_index` by
|
||||
/// `delta` [`Pages`].
|
||||
///
|
||||
/// This function returns the number of pages before growing if successful, or
|
||||
/// `-1` if the grow failed.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`DynamicMemory`].
|
||||
pub unsafe extern "C" fn local_dynamic_memory_grow(
|
||||
ctx: &mut vm::Ctx,
|
||||
memory_index: LocalMemoryIndex,
|
||||
@ -60,12 +88,18 @@ pub unsafe extern "C" fn local_dynamic_memory_grow(
|
||||
ret
|
||||
}
|
||||
|
||||
/// Get the size of a local [`DynamicMemory`] in [`Pages`].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`DynamicMemory`].
|
||||
pub unsafe extern "C" fn local_dynamic_memory_size(
|
||||
ctx: &vm::Ctx,
|
||||
memory_index: LocalMemoryIndex,
|
||||
) -> Pages {
|
||||
let local_memory = *ctx.internal.memories.add(memory_index.index());
|
||||
let memory = (*local_memory).memory as *mut DynamicMemory;
|
||||
let memory = (*local_memory).memory as *const DynamicMemory;
|
||||
|
||||
(*memory).size()
|
||||
}
|
||||
@ -74,6 +108,16 @@ pub unsafe extern "C" fn local_dynamic_memory_size(
|
||||
// | IMPORTED MEMORIES |
|
||||
// +*****************************+
|
||||
|
||||
/// Increase the size of the static imported memory with offset `import_memory_index` by
|
||||
/// `delta` [`Pages`].
|
||||
///
|
||||
/// This function returns the number of pages before growing if successful, or
|
||||
/// `-1` if the grow failed.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `import_memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`StaticMemory`].
|
||||
pub unsafe extern "C" fn imported_static_memory_grow(
|
||||
ctx: &mut vm::Ctx,
|
||||
import_memory_index: ImportedMemoryIndex,
|
||||
@ -96,6 +140,12 @@ pub unsafe extern "C" fn imported_static_memory_grow(
|
||||
ret
|
||||
}
|
||||
|
||||
/// Get the size of an imported [`StaticMemory`] in [`Pages`].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `import_memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`StaticMemory`].
|
||||
pub unsafe extern "C" fn imported_static_memory_size(
|
||||
ctx: &vm::Ctx,
|
||||
import_memory_index: ImportedMemoryIndex,
|
||||
@ -104,11 +154,21 @@ pub unsafe extern "C" fn imported_static_memory_size(
|
||||
.internal
|
||||
.imported_memories
|
||||
.add(import_memory_index.index());
|
||||
let memory = (*local_memory).memory as *mut StaticMemory;
|
||||
let memory = (*local_memory).memory as *const StaticMemory;
|
||||
|
||||
(*memory).size()
|
||||
}
|
||||
|
||||
/// Increase the size of the dynamic imported memory with offset `memory_index` by
|
||||
/// `delta` [`Pages`].
|
||||
///
|
||||
/// This function returns the number of pages before growing if successful, or
|
||||
/// `-1` if the grow failed.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`DynamicMemory`].
|
||||
pub unsafe extern "C" fn imported_dynamic_memory_grow(
|
||||
ctx: &mut vm::Ctx,
|
||||
memory_index: ImportedMemoryIndex,
|
||||
@ -128,12 +188,18 @@ pub unsafe extern "C" fn imported_dynamic_memory_grow(
|
||||
ret
|
||||
}
|
||||
|
||||
/// Get the size of an imported [`DynamicMemory`] in [`Pages`].
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The offset given by `memory_index` is not bounds-checked or typed-checked.
|
||||
/// Thus, the offset should be in-bounds and point to a [`DynamicMemory`].
|
||||
pub unsafe extern "C" fn imported_dynamic_memory_size(
|
||||
ctx: &vm::Ctx,
|
||||
memory_index: ImportedMemoryIndex,
|
||||
) -> Pages {
|
||||
let local_memory = *ctx.internal.imported_memories.add(memory_index.index());
|
||||
let memory = (*local_memory).memory as *mut DynamicMemory;
|
||||
let memory = (*local_memory).memory as *const DynamicMemory;
|
||||
|
||||
(*memory).size()
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-runtime"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Wasmer runtime library"
|
||||
documentation = "https://wasmerio.github.io/wasmer/c/runtime-c-api/"
|
||||
license = "MIT"
|
||||
@ -12,17 +12,17 @@ edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.12.0", optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.13.1", optional = true }
|
||||
lazy_static = "1.4"
|
||||
memmap = "0.7"
|
||||
|
||||
[dependencies.wasmer-runtime-core]
|
||||
path = "../runtime-core"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
|
||||
[dependencies.wasmer-clif-backend]
|
||||
path = "../clif-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
optional = true
|
||||
|
||||
# Dependencies for caching.
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-singlepass-backend"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
dynasm = "0.5"
|
||||
dynasmrt = "0.5"
|
||||
lazy_static = "1.4"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-spectests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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 = { path = "../runtime", version = "0.12.0", default-features = false}
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.12.0", optional = true}
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.12.0", features = ["test"], optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.12.0", optional = true }
|
||||
wasmer-runtime = { path = "../runtime", version = "0.13.1", default-features = false}
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.13.1", optional = true}
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.13.1", features = ["test"], optional = true }
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.13.1", optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
wabt = "0.9.1"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-wasi-experimental-io-devices"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
edition = "2018"
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
@ -14,8 +14,8 @@ maintenance = { status = "experimental" }
|
||||
[dependencies]
|
||||
log = "0.4"
|
||||
minifb = "0.13"
|
||||
wasmer-wasi = { version = "0.12.0", path = "../wasi" }
|
||||
wasmer-runtime-core = { version = "0.12.0", path = "../runtime-core" }
|
||||
wasmer-wasi = { version = "0.13.1", path = "../wasi" }
|
||||
wasmer-runtime-core = { version = "0.13.1", path = "../runtime-core" }
|
||||
ref_thread_local = "0.0"
|
||||
serde = "1"
|
||||
typetag = "0.1"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-wasi-tests"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
description = "Tests for our WASI implementation"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
@ -10,18 +10,18 @@ build = "build/mod.rs"
|
||||
|
||||
[dependencies]
|
||||
# We set default features to false to be able to use the singlepass backend properly
|
||||
wasmer-runtime = { path = "../runtime", version = "0.12.0", default-features = false }
|
||||
wasmer-wasi = { path = "../wasi", version = "0.12.0" }
|
||||
wasmer-runtime = { path = "../runtime", version = "0.13.1", default-features = false }
|
||||
wasmer-wasi = { path = "../wasi", version = "0.13.1" }
|
||||
# hack to get tests to work
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.12.0", optional = true}
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.12.0", optional = true }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.12.0", features = ["test"], optional = true }
|
||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.13.1", optional = true}
|
||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.13.1", optional = true }
|
||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.13.1", features = ["test"], optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
glob = "0.3"
|
||||
|
||||
[dev-dependencies]
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.12.0"}
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.13.1"}
|
||||
|
||||
[features]
|
||||
clif = ["wasmer-clif-backend", "wasmer-runtime/default-backend-cranelift"]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-wasi"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = "0.3"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#![allow(unused)]
|
||||
#![allow(unused, clippy::too_many_arguments)]
|
||||
pub mod types;
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
pub mod unix;
|
||||
@ -331,7 +331,7 @@ pub fn fd_allocate(
|
||||
) -> __wasi_errno_t {
|
||||
debug!("wasi::fd_allocate");
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd));
|
||||
let inode = fd_entry.inode;
|
||||
|
||||
if !has_rights(fd_entry.rights, __WASI_RIGHT_FD_ALLOCATE) {
|
||||
@ -374,7 +374,7 @@ pub fn fd_close(ctx: &mut Ctx, fd: __wasi_fd_t) -> __wasi_errno_t {
|
||||
debug!("=> fd={}", fd);
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd));
|
||||
|
||||
wasi_try!(state.fs.close_fd(fd));
|
||||
|
||||
@ -389,7 +389,7 @@ pub fn fd_close(ctx: &mut Ctx, fd: __wasi_fd_t) -> __wasi_errno_t {
|
||||
pub fn fd_datasync(ctx: &mut Ctx, fd: __wasi_fd_t) -> __wasi_errno_t {
|
||||
debug!("wasi::fd_datasync");
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd));
|
||||
if !has_rights(fd_entry.rights, __WASI_RIGHT_FD_DATASYNC) {
|
||||
return __WASI_EACCES;
|
||||
}
|
||||
@ -420,7 +420,7 @@ pub fn fd_fdstat_get(
|
||||
buf_ptr.offset()
|
||||
);
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd));
|
||||
|
||||
let stat = wasi_try!(state.fs.fdstat(fd));
|
||||
let buf = wasi_try!(buf_ptr.deref(memory));
|
||||
@ -528,7 +528,7 @@ pub fn fd_filestat_set_size(
|
||||
) -> __wasi_errno_t {
|
||||
debug!("wasi::fd_filestat_set_size");
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd));
|
||||
let inode = fd_entry.inode;
|
||||
|
||||
if !has_rights(fd_entry.rights, __WASI_RIGHT_FD_FILESTAT_SET_SIZE) {
|
||||
@ -1309,7 +1309,7 @@ pub fn path_create_directory(
|
||||
debug!("wasi::path_create_directory");
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
|
||||
let working_dir = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let working_dir = wasi_try!(state.fs.get_fd(fd));
|
||||
if let Kind::Root { .. } = &state.fs.inodes[working_dir.inode].kind {
|
||||
return __WASI_EACCES;
|
||||
}
|
||||
@ -1468,7 +1468,7 @@ pub fn path_filestat_set_times(
|
||||
) -> __wasi_errno_t {
|
||||
debug!("wasi::path_filestat_set_times");
|
||||
let (memory, state) = get_memory_and_wasi_state(ctx, 0);
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd)).clone();
|
||||
let fd_entry = wasi_try!(state.fs.get_fd(fd));
|
||||
let fd_inode = fd_entry.inode;
|
||||
if !has_rights(fd_entry.rights, __WASI_RIGHT_PATH_FILESTAT_SET_TIMES) {
|
||||
return __WASI_EACCES;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wasmer-win-exception-handler"
|
||||
version = "0.12.0"
|
||||
version = "0.13.1"
|
||||
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.12.0" }
|
||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.13.1" }
|
||||
winapi = { version = "0.3.8", features = ["winbase", "errhandlingapi", "minwindef", "minwinbase", "winnt"] }
|
||||
libc = "0.2.60"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
PREVIOUS_VERSION='0.11.0'
|
||||
NEXT_VERSION='0.12.0'
|
||||
PREVIOUS_VERSION='0.13.0'
|
||||
NEXT_VERSION='0.13.1'
|
||||
|
||||
# quick hack
|
||||
fd Cargo.toml --exec sed -i '' "s/version = \"$PREVIOUS_VERSION\"/version = \"$NEXT_VERSION\"/"
|
||||
|
@ -250,7 +250,7 @@ struct Run {
|
||||
|
||||
/// Enable non-standard experimental IO devices
|
||||
#[cfg(feature = "experimental-io-devices")]
|
||||
#[structopt(long = "enable-experimental-io-devices", hidden = true)]
|
||||
#[structopt(long = "enable-experimental-io-devices")]
|
||||
enable_experimental_io_devices: bool,
|
||||
|
||||
/// Enable debug output
|
||||
|
@ -1,6 +1,6 @@
|
||||
[Setup]
|
||||
AppName=Wasmer
|
||||
AppVersion=0.12.0
|
||||
AppVersion=0.13.1
|
||||
DefaultDirName={pf}\Wasmer
|
||||
DefaultGroupName=Wasmer
|
||||
Compression=lzma2
|
||||
|
2
wapm-cli
2
wapm-cli
@ -1 +1 @@
|
||||
Subproject commit e2d3eb18f304e165b5840aebba1917f9d14c77b4
|
||||
Subproject commit 7996b1cb0e8418af5a312f5b033f4fb1b284464a
|
Loading…
x
Reference in New Issue
Block a user