WIT values are native Rust values. But records are represented as a
vector of WIT values. In order to provide a super neat API to the
user, Serde is used to deserialize this vector of WIT values to a
large variety of Rust values.
The `Type::Record` variant now is defined by `RecordType`. In
addition, `InterfaceType` has a new variant: `Record`, that is also
defined by `RecordType`. Encoders and decoders are updated to consider
`RecordType`, which removes code duplication and simplify code.
This patch updates the `Type` type to be an enum with 2 variants:
`Function` and `Record`, resp. to represent:
1. `(@interface type (func (param i32 i32) (result string)))`
2. `(@interface type (record string i32))`
This patch updates the binary encoder and decoder, along with the WAT
encoder and decoder.
1332: Add `CompilerConfig` opt to disable IR verification in debug mode r=MarkMcCaskey a=MarkMcCaskey
Resolves#1330
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Basically the `x-to-y` instructions have been renamed `y.from_x`. This
patch updates the instruction. The binary representation isn't
specified yet, so it's just arbitrary values.
1327: fix(interface-types) Stack pops items in the same order than Wasm invocation rule r=Hywan a=Hywan
This PR fixes the items order when popped from the stack. It matches [the Wasm invocation rule](https://webassembly.github.io/spec/core/exec/instructions.html#invocation-of-function-address).
Not that it is more performant in our case, since we use the `drain` API rather than `drain` + `rev`.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
1292: Experimental Support for Android (x86_64 and AArch64) r=syrusakbary a=igrep
# Description
Related: https://github.com/wasmerio/wasmer/issues/1113
# Current Status
- ~~This pull request is a draft until the next version of libc crate (which should contain https://github.com/rust-lang/libc/pull/1622)~~
- Now released! 🎉
- I confirmed the tests of wasmer-runtime-core pass on Android x86\_64.
- The other tests including ones on AArch64 seems too hard so far... 😓
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
# Note
I'm happy given any hint to test of Android specific code (esp. in libc I added in https://github.com/rust-lang/libc/pull/1622).
Co-authored-by: Yuji Yamamoto <yuji-yamamoto@iij.ad.jp>
Co-authored-by: YAMAMOTO Yuji <yuji-yamamoto@iij.ad.jp>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
1288: Update some dependencies manually, removing duplicate deps r=MarkMcCaskey a=MarkMcCaskey
Removes all duplicate deps (as seen by `cargo +stable tree -d`). Primarily by updating `wasm-debug` but also by through updating some other dependencies.
Co-authored-by: Mark McCaskey <mark@wasmer.io>
1320: Support multiple custom sections with the same name r=MarkMcCaskey a=MarkMcCaskey
The spec doesn't disallow duplicates and the [JS API spec](https://webassembly.github.io/spec/js-api/index.html#dom-module-customsections) supports them.
# Review
- [ ] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Mark McCaskey <mark@wasmer.io>
1322: inkwell::Builder is a per-function notion, remove it from LLVMModuleCodeGenerator. r=nlewycky a=nlewycky
This also removes it from the API to generate trampolines, which makes sense because those produce new functions, so it can produce a new builder for the new function.
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
This also removes it from the API to generate trampolines, which makes sense because those produce new functions, so it can produce a new builder for the new function.
1315: Fix windows cross compilation r=MarkMcCaskey a=Jake-Shadle
# Description
When compiling to windows from any host other than windows, the `win-exception-handler` crate would not actually compile the C code since the compilation was guarded by `#[cfg(target_os = "windows")]`, which is evaluated when the build script itself is compiled which would mean it would != windows, which would eventually cause a link error due to the missing library.
This change gets the target os via the `CARGO_CFG_TARGET_OS` environment variable, which is set by cargo when invoking the build script, and will evaluate to `windows` when actually targetting windows, no matter the host platform.
It also changed from using cmake to use the cc crate to compile the code, as cmake seemed like massive overkill for a single C file, as well as complicating cross compilation again, though I can change it back to cmake if you don't want that change.
I also fixed a warning produced by clang by adding `#include <intrin.h>`, though there was another warning due to the trampoline function pointer taking a non-const `wasmer_instance_context_t*`, but wasmer actually sending in a const *.
# Review
- [ ] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Jake Shadle <jake.shadle@embark-studios.com>