5297 Commits

Author SHA1 Message Date
Ivan Enderlin
1a17cbb17e test(interface-types) Deserialize WIT record to Rust struct. 2020-03-31 14:44:04 +02:00
Ivan Enderlin
02b7e21345 feat(interface-types) Implement the record.lift instruction. 2020-03-31 12:34:32 +02:00
Ivan Enderlin
0af1076eee feat(interface-types) Encodes/decodes the record.lift instruction. 2020-03-31 08:17:52 +02:00
Ivan Enderlin
3655ef8bb7 chore(interface-types) Reorganize the serde module. 2020-03-31 08:02:46 +02:00
Ivan Enderlin
ee57b47770 feat(interface-types) Improve the Deserializer API. 2020-03-31 07:47:54 +02:00
Ivan Enderlin
c87c2ef33b feat(interface-values) Improve the TypeMismatch error. 2020-03-31 07:47:15 +02:00
Ivan Enderlin
154dcba42c feat(interface-types) Implement Serde deserializing for WIT records to Rust values.
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.
2020-03-30 15:42:35 +02:00
Ivan Enderlin
a99ae6bdb2 feat(interface-types) Add the Record WIT value. 2020-03-30 08:32:31 +02:00
Ivan Enderlin
bd9226eb68 feat(interface-types) Introduce RecordType for InterfaceType and Type.
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.
2020-03-26 13:35:24 +01:00
Ivan Enderlin
3c02c501ed chore(interface-types) Move the instruction.rs module in instructions/mod.rs. 2020-03-26 11:24:10 +01:00
Ivan Enderlin
734795c1f4 test(interface-types) Test Type::Record. 2020-03-26 11:18:24 +01:00
Ivan Enderlin
bbb4f1fc0f feat(interface-types) Introduce the record type.
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.
2020-03-26 10:54:58 +01:00
Syrus Akbary
531ec45f34
Merge pull request #1329 from Hywan/feat-interface-types-new-types-and-instructions
feat(interface-types) New numbers and strings instructions
2020-03-26 00:02:31 -07:00
Ivan Enderlin
4a86cd16f9
Merge branch 'master' into feat-interface-types-new-types-and-instructions 2020-03-26 07:26:37 +01:00
bors[bot]
4e53f9e9c6
Merge #1332
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>
2020-03-25 01:26:27 +00:00
Mark McCaskey
697da669a1 Minor code update, move conditional block inwards 2020-03-24 16:00:32 -07:00
Mark McCaskey
ce1b1f67cf Update opt name in CompilerConfig, enable IR verification in spectests 2020-03-24 15:46:58 -07:00
Mark McCaskey
403e14bc1e Add CompilerConifg opt to disable IR verification in debug mode 2020-03-24 14:52:02 -07:00
Ivan Enderlin
b251d6d7b4 doc(changelog) Add #1329. 2020-03-24 15:42:40 +01:00
Ivan Enderlin
ffe7f765a2 doc(interface-types) Add strign.size in the list of supported instructions. 2020-03-24 15:35:01 +01:00
Ivan Enderlin
38f62392ff feat(interface-types) Implement the string.size instruction. 2020-03-24 15:33:42 +01:00
Ivan Enderlin
daef7b0bfd feat(interface-types) Add the Stackable::peek1 method.
This method allows to peek the last item on the stack (if any) by
reference.
2020-03-24 15:32:54 +01:00
Ivan Enderlin
7f2273b32b doc(interface-types) Add string.* instructions. 2020-03-24 13:29:38 +01:00
Ivan Enderlin
ec7aebe7e1 feat(interface-types) Implement the string.(lift|lower)_memory instructions.
The `string.lift_memory` instruction replaces `memory-to-string`, and
`string.lower_memory` replaces `string-to-memory`.
2020-03-24 13:25:06 +01:00
Ivan Enderlin
afbeb5d230 feat(interface-types) Rename lowering_lifting module to numbers. 2020-03-24 13:10:21 +01:00
Ivan Enderlin
6fcd45bce3 doc(interface-types) Add links to WIT instructions. 2020-03-24 12:48:33 +01:00
Ivan Enderlin
cd58af2633 doc(interface-types) Update supported instructions. 2020-03-24 12:47:39 +01:00
Ivan Enderlin
50201a5e0b feat(interface-types) Implement [siu](NN|MM).from_* instructions.
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.
2020-03-24 12:43:57 +01:00
bors[bot]
56aec04d1d
Merge #1327
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>
2020-03-24 09:49:42 +00:00
bors[bot]
4703e78250
Merge #1292
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>
2020-03-23 21:16:53 +00:00
Mark McCaskey
9cdb49d22c
Merge branch 'master' into android 2020-03-23 13:29:18 -07:00
bors[bot]
e695ecbfd8
Merge #1288
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>
2020-03-23 18:58:51 +00:00
Ivan Enderlin
a1f0a556e5 fix(interface-types) Use same stack order than Wasm invocation rule. 2020-03-23 14:34:57 +01:00
Ivan Enderlin
693b210638 fix(interface-types) Stack pops items in the same order than Wasm invocation rule. 2020-03-23 14:32:26 +01:00
YAMAMOTO Yuji
18be0f2bae
Fix build on CI for Android 2020-03-23 11:55:33 +09:00
YAMAMOTO Yuji
a114b77fe9
Add https://github.com/wasmerio/wasmer/pull/1292 to changelog 2020-03-23 11:55:33 +09:00
YAMAMOTO Yuji
056e9cf88c
Add the android test script to the CI pipeline 2020-03-23 11:55:33 +09:00
YAMAMOTO Yuji
93f6a9b91b
enable testing on Android x86_64
Currently, at the time of 2020/03/11, testing on AArch64 is not supported in the upstream repository
2020-03-23 11:55:32 +09:00
YAMAMOTO Yuji
96a0f851c2
Update libc
The new version of libc contains changes necessary to build
wasmer-runtime-core for Android.

See https://github.com/rust-lang/libc/pull/1622 for details.
2020-03-23 11:55:32 +09:00
Yuji Yamamoto
b23436d1bb
🐛 Correct error message when trying to build on non-supported targets 2020-03-23 11:55:31 +09:00
Yuji Yamamoto
0df0a1cccb
Support Android
I'll send a PR after https://github.com/rust-lang/libc/pull/1622 is merged and released
2020-03-23 11:55:31 +09:00
bors[bot]
704c34283f
Merge #1320
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>
2020-03-21 00:15:24 +00:00
Mark McCaskey
df1afa2cdc Add custom section update to changelog 2020-03-20 17:14:30 -07:00
bors[bot]
c6dc793924
Merge #1322
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>
2020-03-20 19:29:23 +00:00
nlewycky
30afd145e0
Merge branch 'master' into feature/llvm-mcg-no-builder 2020-03-20 12:27:48 -07:00
Nick Lewycky
f7d4f855a3 inkwell::Builder is a per-function notion, remove it from LLVMModuleCodeGenerator.
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.
2020-03-20 12:26:15 -07:00
Mark McCaskey
248e06146a Support multiple custom sections with the same name 2020-03-20 11:27:23 -07:00
bors[bot]
04754aa223
Merge #1303
1303: NaN canonicalization for singlepass backend. r=losfair a=losfair

- [x] Implementation
- [x] Test

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2020-03-19 04:06:27 +00:00
Heyang Zhou
d1e8674f8d
Merge branch 'master' into feature/singlepass-nan-cncl 2020-03-19 12:05:57 +08:00
Syrus Akbary
3a911a20a0
Merge pull request #1317 from wasmerio/fix/osx-static-lib-packaging
Fix OSX static library packaging
2020-03-18 14:47:45 -07:00