Compare commits

...

2969 Commits

Author SHA1 Message Date
Syrus Akbary
0575a7ed3f
Merge pull request #1439 from Hywan/feat-interface-types-new-repo-rm
feat(interface-types) Move to its own repository
2020-05-12 20:44:17 -07:00
Ivan Enderlin
0b19e2f90e feat(interface-types) Move to its own repository.
New repository is https://github.com/wasmerio/interface-types.
2020-05-12 17:31:26 +02:00
bors[bot]
d562119c64
Merge #1438
1438: Post release fixup r=MarkMcCaskey a=MarkMcCaskey

Had to do `--allow-dirty` to ship these changes in 0.17.0





Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-05-11 21:54:54 +00:00
Mark McCaskey
11afbb050c
Merge branch 'master' into fix/issues-found-while-releasing-0.17.0 2020-05-11 14:54:29 -07:00
bors[bot]
80d9935aab
Merge #1437
1437: Prepare for 0.17.0 release r=MarkMcCaskey a=MarkMcCaskey


# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-05-11 21:34:35 +00:00
Mark McCaskey
3c15336a8e Post release fixup
These were things missing from the release that I had to add to ship 0.17.0
2020-05-11 14:09:00 -07:00
Mark McCaskey
20af25e69b Create 0.17.0 section in CHANGELOG.md 2020-05-11 13:50:01 -07:00
Mark McCaskey
6d01b7f891 Prepare for 0.17.0 release 2020-05-11 13:48:41 -07:00
bors[bot]
1e720815cd
Merge #1436
1436: fix(singlepass-backend): I64ExtendI32U: Garbage in upper 32 bits shouldn't propagate to the result. r=syrusakbary a=losfair

Fixes https://github.com/wasmerio/wasmer/issues/1429 .

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
Co-authored-by: Syrus <me@syrusakbary.com>
2020-05-11 20:10:20 +00:00
Syrus
254f9bbddd Fixed ignores 2020-05-11 13:06:55 -07:00
Syrus
685af7b9fe Added custom tests to the infrastructure 2020-05-11 12:35:38 -07:00
Heyang Zhou
fd63ee91f0
Apply review suggestion
Co-authored-by: nlewycky <nick@wasmer.io>
2020-05-12 03:23:50 +08:00
losfair
eeb608ced7 Add int-extend-garbage test 2020-05-12 03:04:26 +08:00
losfair
6790702901 Add comment to explain the change to I64ExtendI32U. 2020-05-12 03:03:39 +08:00
losfair
51e085a7ba Garbage in upper 32 bits shouldn't propagate to I64ExtendI32U's result. 2020-05-12 02:11:43 +08:00
Syrus Akbary
77de93ec0e
Update README.md 2020-05-08 00:00:34 -07:00
bors[bot]
4a37bac7e1
Merge #1427
1427: Make func clonable r=MarkMcCaskey a=michaelvoronov

Resolves https://github.com/wasmerio/wasmer/issues/1420.

Co-authored-by: vms <michail.vms@gmail.com>
2020-05-05 21:16:02 +00:00
vms
c3e9e36782 make func clonable 2020-05-02 12:28:00 +03:00
bors[bot]
03df15a3eb
Merge #1414
1414: Update doc comment for `RuntimeError` r=Hywan a=MarkMcCaskey


# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-04-30 07:55:12 +00:00
Ivan Enderlin
3feaa7fd3f
Merge branch 'master' into fix/doc-comment-runtimeerror 2020-04-30 09:47:56 +02:00
bors[bot]
f48a4d924c
Merge #1413
1413: some minor improvements r=MarkMcCaskey a=michaelvoronov

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Some minor improvements.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: vms <michail.vms@gmail.com>
2020-04-29 21:00:59 +00:00
Mark McCaskey
579d4564eb Update doc comment for RuntimeError 2020-04-29 13:46:57 -07:00
vms
c4fd02aec7 fix clippy warning 2020-04-29 23:46:34 +03:00
vms
abed2c238a some minor improvements 2020-04-29 23:15:38 +03:00
bors[bot]
0cba64b538
Merge #1412
1412: fix(singlepass-backend) Fix argument overwriting in a corner case when calling functions. r=nlewycky a=losfair

Fixes #1409.

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2020-04-29 16:34:06 +00:00
Heyang Zhou
7bfa7723a6
Fix typo in comment.
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-04-30 00:26:30 +08:00
losfair
e234096e6a Add test for issue #1409. 2020-04-30 00:05:45 +08:00
losfair
b2ecf8a06c Use RCX instead of R10 as temp register in sysv call location. 2020-04-30 00:04:44 +08:00
bors[bot]
d23a3f3d1c
Merge #1401
1401: Make runtime and trap errors well defined r=syrusakbary a=MarkMcCaskey

Resolves #1328 

This PR goes through and gives explicit types for all the errors instead of using `Box<dyn Any + Send>` where possible.  This gives users better insight into what the specific errors are and should help with debugging in the case of mistakes in our code.

The remaining uses of `Box<dyn Any>` are due to the structure of our dependency graph -- this is probably solvable but it seems fine as is as all error types are now explicit and the remaining `Box<dyn Any>`s are either fully user controlled or not for end-user consumption.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-04-28 22:21:13 +00:00
bors[bot]
86a66e25d8
Merge #1410
1410: feat(runtime-core) Implement `ImportObjectIterator::size_hint`. r=MarkMcCaskey a=Hywan

Because it is helpful in some circumstances.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-04-28 18:39:50 +00:00
Mark McCaskey
9c5fdd6f69 Address feedback, cleanup, fix memory leak in LLVM-backend 2020-04-28 11:36:01 -07:00
Ivan Enderlin
5c2db568ed feat(runtime-core) Implement ImportObjectIterator::size_hint. 2020-04-28 16:32:20 +02:00
Mark McCaskey
50dda38dba Add changelog entry for RuntimeError update 2020-04-27 15:30:05 -07:00
Mark McCaskey
74ddc8e0c8 Add docs; fix misc bugs 2020-04-27 14:59:43 -07:00
Mark McCaskey
cffdb387f7 Fix new RuntimeError integration with the LLVM-backend 2020-04-27 12:55:58 -07:00
Syrus Akbary
a4ab71ed0b
Merge pull request #1407 from wasmerio/dependabot/cargo/time-0.1.43
chore(deps): bump time from 0.1.42 to 0.1.43
2020-04-27 12:19:33 -07:00
Syrus Akbary
94ccbd1ad0
Merge pull request #1406 from wasmerio/dependabot/cargo/smallvec-1.4.0
chore(deps): bump smallvec from 1.3.0 to 1.4.0
2020-04-27 12:19:10 -07:00
Syrus Akbary
0ba255303f
Merge pull request #1405 from wasmerio/dependabot/cargo/cc-1.0.52
chore(deps): bump cc from 1.0.50 to 1.0.52
2020-04-27 12:18:55 -07:00
Syrus Akbary
61091cc9cf
Merge pull request #1404 from wasmerio/dependabot/cargo/criterion-0.3.2
chore(deps): bump criterion from 0.3.1 to 0.3.2
2020-04-27 12:18:44 -07:00
Syrus Akbary
31121eb2a6
Merge pull request #1403 from wasmerio/dependabot/cargo/structopt-0.3.14
chore(deps): bump structopt from 0.3.13 to 0.3.14
2020-04-27 12:18:34 -07:00
dependabot-preview[bot]
d32ce63110
chore(deps): bump time from 0.1.42 to 0.1.43
Bumps [time](https://github.com/time-rs/time) from 0.1.42 to 0.1.43.
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/master/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/commits/v0.1.43)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 09:27:34 +00:00
dependabot-preview[bot]
9f5ce400ed
chore(deps): bump smallvec from 1.3.0 to 1.4.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.3.0...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 09:26:48 +00:00
dependabot-preview[bot]
b788e39d7b
chore(deps): bump cc from 1.0.50 to 1.0.52
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.50 to 1.0.52.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.50...1.0.52)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 09:26:00 +00:00
dependabot-preview[bot]
7cd2cf20eb
chore(deps): bump criterion from 0.3.1 to 0.3.2
Bumps [criterion](https://github.com/bheisler/criterion.rs) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/bheisler/criterion.rs/releases)
- [Changelog](https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bheisler/criterion.rs/compare/0.3.1...0.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 09:25:23 +00:00
dependabot-preview[bot]
ab9b882069
chore(deps): bump structopt from 0.3.13 to 0.3.14
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.13 to 0.3.14.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.13...v0.3.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 09:24:46 +00:00
Mark McCaskey
2bbe3406cf Debugging LLVM trap code WIP 2020-04-26 12:52:58 -07:00
Mark McCaskey
89af5dc107 Fix new RuntimeError implementation for the Singlepass backend 2020-04-26 12:05:12 -07:00
Mark McCaskey
9723270f96 Fix tests for the Cranelift backend 2020-04-24 14:55:30 -07:00
Mark McCaskey
b9ec8f9845 Define runtime error values explicitly in Singlepass 2020-04-24 13:21:45 -07:00
Mark McCaskey
bfb6814f23 Make runtime and trap errors well defined (WIP) 2020-04-23 12:40:35 -07:00
bors[bot]
ab106af422
Merge #1358
1358: Update C API to use new API r=MarkMcCaskey a=MarkMcCaskey



# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-04-21 20:12:46 +00:00
bors[bot]
d746135d8f
Merge #1375
1375: chore(deps): bump smallvec from 1.2.0 to 1.3.0 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.2.0 to 1.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/servo/rust-smallvec/releases">smallvec's releases</a>.</em></p>
<blockquote>
<h2>v1.3.0</h2>
<ul>
<li>Add a new unstable <code>const_generics</code> feature (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/204">#204</a>).</li>
<li>Improve inlining of constructor functions (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/206">#206</a>).</li>
<li>Add a <code>slice.to_smallvec()</code> convenience method (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/203">#203</a>).</li>
<li>Documentation and testing improvements.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="3957cd8b36"><code>3957cd8</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/207">#207</a> - mbrubeck:bump, r=mbrubeck</li>
<li><a href="851d222629"><code>851d222</code></a> Version 1.3.0</li>
<li><a href="6a14df03e5"><code>6a14df0</code></a> Document Cargo features</li>
<li><a href="c48902fb78"><code>c48902f</code></a> Make ToSmallVec trait public</li>
<li><a href="faca460f0c"><code>faca460</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/206">#206</a> - hiddenhare:inline-constructors, r=mbrubeck</li>
<li><a href="f5f6d89e7e"><code>f5f6d89</code></a> Add #[inline] attribute to all fns which return SmallVec</li>
<li><a href="9cdf8fb424"><code>9cdf8fb</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/204">#204</a> - c410-f3r:const__generics, r=mbrubeck</li>
<li><a href="02cdf2492e"><code>02cdf24</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/205">#205</a> - c410-f3r:fix-ci, r=mbrubeck</li>
<li><a href="9f2f610d52"><code>9f2f610</code></a> Fix CI</li>
<li><a href="70e967edaa"><code>70e967e</code></a> Add support for constant generics</li>
<li>Additional commits viewable in <a href="https://github.com/servo/rust-smallvec/compare/v1.2.0...v1.3.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=smallvec&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)](https://dependabot.com/compatibility-score/?dependency-name=smallvec&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-21 19:45:39 +00:00
Syrus Akbary
789d8f214e
Merge pull request #1398 from satrobit/master
Correct ctx data variable name in comment
2020-04-20 21:20:21 -07:00
Amir Keshavarz
4ce6280a13
Correct ctx data variable name in comment 2020-04-21 08:47:14 +04:30
dependabot-preview[bot]
2035082a4e
chore(deps): bump smallvec from 1.2.0 to 1.3.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-21 00:18:17 +00:00
bors[bot]
6d76902288
Merge #1394
1394: Bump libc from 0.2.68 to 0.2.69 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.68 to 0.2.69.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/rust-lang/libc/releases">libc's releases</a>.</em></p>
<blockquote>
<h2>0.2.69</h2>
<p>Bump patch version to 0.2.69</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="d833b6b2d6"><code>d833b6b</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/rust-lang/libc/issues/1732">#1732</a> from Minoru/feature/release-0.2.69</li>
<li><a href="9604f461dc"><code>9604f46</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/rust-lang/libc/issues/1697">#1697</a> from JohnTitor/emscripten</li>
<li><a href="542eef19b9"><code>542eef1</code></a> Fix <code>max_align_t</code> size and align</li>
<li><a href="c1a4d6271d"><code>c1a4d62</code></a> Use wasi values for <code>errno</code>s</li>
<li><a href="622e6f5d25"><code>622e6f5</code></a> Update node to v12.16.2</li>
<li><a href="991678ce0b"><code>991678c</code></a> Skip test for <code>SYS_gettid</code></li>
<li><a href="3d8197ec2b"><code>3d8197e</code></a> Update links</li>
<li><a href="80a2f9cbb2"><code>80a2f9c</code></a> Update emsdk to 1.39.12</li>
<li><a href="4eb6331c4f"><code>4eb6331</code></a> Remove <code>TCP_FASTOPEN_CONNECT</code> from emscripten</li>
<li><a href="be0347bbec"><code>be0347b</code></a> Remove <code>IPV6_FLOWINFO</code> from emscripten</li>
<li>Additional commits viewable in <a href="https://github.com/rust-lang/libc/compare/0.2.68...0.2.69">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.68&new-version=0.2.69)](https://dependabot.com/compatibility-score/?dependency-name=libc&package-manager=cargo&previous-version=0.2.68&new-version=0.2.69)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 23:52:29 +00:00
dependabot-preview[bot]
51c504cba4
Bump libc from 0.2.68 to 0.2.69
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.68 to 0.2.69.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.68...0.2.69)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 23:19:20 +00:00
bors[bot]
1d91af0d59
Merge #1374
1374: chore(deps): bump parking_lot from 0.10.0 to 0.10.2 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.10.0 to 0.10.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md">parking_lot's changelog</a>.</em></p>
<blockquote>
<h2>parking_lot 0.10.2 (2020-04-10)</h2>
<ul>
<li>Update minimum version of <code>lock_api</code>.</li>
</ul>
<h2>parking_lot 0.10.1, parking_lot_core 0.7.1, lock_api 0.3.4 (2020-04-10)</h2>
<ul>
<li>Add methods to construct <code>Mutex</code>, <code>RwLock</code>, etc in a <code>const</code> context. (<a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/217">#217</a>)</li>
<li>Add <code>FairMutex</code> which always uses fair unlocking. (<a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/204">#204</a>)</li>
<li>Fixed panic with deadlock detection on macOS. (<a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/203">#203</a>)</li>
<li>Fixed incorrect synchronization in <code>create_hashtable</code>. (<a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/210">#210</a>)</li>
<li>Use <code>llvm_asm!</code> instead of the deprecated <code>asm!</code>. (<a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/223">#223</a>)</li>
</ul>
<h2>lock_api 0.3.3 (2020-01-04)</h2>
<ul>
<li>Deprecate unsound <code>MappedRwLockWriteGuard::downgrade</code> (<a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/198">#198</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="4cb93a3268"><code>4cb93a3</code></a> Bump parking_lot to version 0.10.2</li>
<li><a href="d070a26900"><code>d070a26</code></a> Merge <a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/224">#224</a></li>
<li><a href="8030870c0f"><code>8030870</code></a> Update required parking_lot_core version</li>
<li><a href="413432c43e"><code>413432c</code></a> Fix required lock_api version</li>
<li><a href="699325c9a7"><code>699325c</code></a> Add test for <a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/203">#203</a></li>
<li><a href="761a4d567f"><code>761a4d5</code></a> Bump versions of all crates</li>
<li><a href="87a574488c"><code>87a5744</code></a> Merge <a href="https://github-redirect.dependabot.com/Amanieu/parking_lot/issues/223">#223</a></li>
<li><a href="806e5c1c1e"><code>806e5c1</code></a> Attempt to fix CI</li>
<li><a href="9bed8e3dd1"><code>9bed8e3</code></a> Fix documentation link</li>
<li><a href="dce000d302"><code>dce000d</code></a> Use llvm_asm! instead of asm!</li>
<li>Additional commits viewable in <a href="https://github.com/Amanieu/parking_lot/compare/0.10.0...0.10.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=parking_lot&package-manager=cargo&previous-version=0.10.0&new-version=0.10.2)](https://dependabot.com/compatibility-score/?dependency-name=parking_lot&package-manager=cargo&previous-version=0.10.0&new-version=0.10.2)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 22:55:50 +00:00
dependabot-preview[bot]
79b05773be
chore(deps): bump parking_lot from 0.10.0 to 0.10.2
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.10.0 to 0.10.2.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.10.0...0.10.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 22:44:21 +00:00
bors[bot]
5b2e9cf5c7
Merge #1376
1376: chore(deps): bump structopt from 0.3.12 to 0.3.13 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.12 to 0.3.13.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md">structopt's changelog</a>.</em></p>
<blockquote>
<h1>v0.3.13 (2020-04-9)</h1>
<ul>
<li>Bump <code>proc-macro-error</code> to <code>1.0</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/TeXitoi/structopt/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=structopt&package-manager=cargo&previous-version=0.3.12&new-version=0.3.13)](https://dependabot.com/compatibility-score/?dependency-name=structopt&package-manager=cargo&previous-version=0.3.12&new-version=0.3.13)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 22:22:15 +00:00
dependabot-preview[bot]
5ab96ab0e3
chore(deps): bump structopt from 0.3.12 to 0.3.13
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.12 to 0.3.13.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 21:06:03 +00:00
bors[bot]
57f0982275
Merge #1392
1392: Bump blake3 from 0.3.1 to 0.3.2 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [blake3](https://github.com/BLAKE3-team/BLAKE3) from 0.3.1 to 0.3.2.
<details>
<summary>Commits</summary>
<ul>
<li><a href="fcb4b83419"><code>fcb4b83</code></a> version 0.3.2</li>
<li><a href="d5e26538fc"><code>d5e2653</code></a> refactor build.rs</li>
<li><a href="7ef795d62e"><code>7ef795d</code></a> Do not require AVX512DQ</li>
<li><a href="370ba3644a"><code>370ba36</code></a> print the compiler version in CI, for help with debugging</li>
<li><a href="86c3174d5b"><code>86c3174</code></a> unbreak neon benchmarks</li>
<li><a href="e3069da68e"><code>e3069da</code></a> only run CI on branches and PRs, not tags</li>
<li>See full diff in <a href="https://github.com/BLAKE3-team/BLAKE3/compare/0.3.1...0.3.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=blake3&package-manager=cargo&previous-version=0.3.1&new-version=0.3.2)](https://dependabot.com/compatibility-score/?dependency-name=blake3&package-manager=cargo&previous-version=0.3.1&new-version=0.3.2)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 20:39:10 +00:00
dependabot-preview[bot]
f5930750ed
Bump blake3 from 0.3.1 to 0.3.2
Bumps [blake3](https://github.com/BLAKE3-team/BLAKE3) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/BLAKE3-team/BLAKE3/releases)
- [Commits](https://github.com/BLAKE3-team/BLAKE3/compare/0.3.1...0.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 20:03:39 +00:00
bors[bot]
f69c4d2b59
Merge #1390
1390: Bump serde_json from 1.0.48 to 1.0.51 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.48 to 1.0.51.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p>
<blockquote>
<h2>v1.0.51</h2>
<ul>
<li>Terminate StreamDeserializer after errors instead of repeatedly reparsing the same failed input (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/647">#647</a>)</li>
<li>Add FusedIterator impls for StreamDeserializer and for Map's various iterators</li>
</ul>
<h2>v1.0.50</h2>
<ul>
<li>Implement Eq for Value, Map, Number (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/640">#640</a>, thanks <a href="https://github.com/smarnach">@smarnach</a>)</li>
</ul>
<h2>v1.0.49</h2>
<ul>
<li>Improve error message when neither &quot;std&quot; nor &quot;alloc&quot; feature is enabled (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/643">#643</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f77c84dd3d"><code>f77c84d</code></a> Release 1.0.51</li>
<li><a href="8e76584c20"><code>8e76584</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/649">#649</a> from serde-rs/fused</li>
<li><a href="d133748122"><code>d133748</code></a> Implement FusedIterator for StreamDeserializer where possible</li>
<li><a href="858b01d852"><code>858b01d</code></a> Implement FusedIterator for Map iterators</li>
<li><a href="4c81923102"><code>4c81923</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/648">#648</a> from serde-rs/streamerror</li>
<li><a href="e99e9d3713"><code>e99e9d3</code></a> Return None after stream deserializer has failed</li>
<li><a href="a1b1199e72"><code>a1b1199</code></a> Test stream behavior after error</li>
<li><a href="fd6741f4b0"><code>fd6741f</code></a> Release 1.0.50</li>
<li><a href="4ac9f6c7bf"><code>4ac9f6c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/640">#640</a> from smarnach/smarnach/eq-impls</li>
<li><a href="99eb4eab76"><code>99eb4ea</code></a> Implement Eq for Map, Number and Value.</li>
<li>Additional commits viewable in <a href="https://github.com/serde-rs/json/compare/v1.0.48...v1.0.51">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.48&new-version=1.0.51)](https://dependabot.com/compatibility-score/?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.48&new-version=1.0.51)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 19:38:54 +00:00
dependabot-preview[bot]
861201e8a2
Bump serde_json from 1.0.48 to 1.0.51
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.48 to 1.0.51.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.48...v1.0.51)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 19:37:38 +00:00
bors[bot]
a966ec3df6
Merge #1395
1395: Bump regex from 1.3.6 to 1.3.7 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [regex](https://github.com/rust-lang/regex) from 1.3.6 to 1.3.7.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p>
<blockquote>
<h1>1.3.7 (2020-04-17)</h1>
<p>This release contains a small bug fix that fixes how <code>regex</code> forwards crate
features to <code>regex-syntax</code>. In particular, this will reduce recompilations in
some cases.</p>
<p>Bug fixes:</p>
<ul>
<li>[BUG <a href="https://github-redirect.dependabot.com/rust-lang/regex/issues/665">#665</a>](<a href="https://github-redirect.dependabot.com/rust-lang/regex/pull/665">rust-lang/regex#665</a>):
Fix feature forwarding to <code>regex-syntax</code>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="adb4aa3ce4"><code>adb4aa3</code></a> regex-1.3.7</li>
<li><a href="761284d2ee"><code>761284d</code></a> changelog: 1.3.7</li>
<li><a href="672d877019"><code>672d877</code></a> sparse: add better Debug impl</li>
<li><a href="b490e0b2e5"><code>b490e0b</code></a> cargo: tweak features for regex-syntax</li>
<li>See full diff in <a href="https://github.com/rust-lang/regex/compare/1.3.6...regex-1.3.7">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=regex&package-manager=cargo&previous-version=1.3.6&new-version=1.3.7)](https://dependabot.com/compatibility-score/?dependency-name=regex&package-manager=cargo&previous-version=1.3.6&new-version=1.3.7)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 18:58:24 +00:00
dependabot-preview[bot]
16bccea284
Bump regex from 1.3.6 to 1.3.7
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.6 to 1.3.7.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.3.6...regex-1.3.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 18:51:09 +00:00
bors[bot]
57b5ee1714
Merge #1391
1391: Bump anyhow from 1.0.26 to 1.0.28 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.26 to 1.0.28.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dtolnay/anyhow/releases">anyhow's releases</a>.</em></p>
<blockquote>
<h2>1.0.28</h2>
<ul>
<li>Documentation improvements (<a href="https://github-redirect.dependabot.com/dtolnay/anyhow/issues/73">#73</a>, <a href="https://github-redirect.dependabot.com/dtolnay/anyhow/issues/78">#78</a>)</li>
</ul>
<h2>1.0.27</h2>
<ul>
<li>
<p>Improve documentation of backtrace environment variable combinations (<a href="https://github-redirect.dependabot.com/dtolnay/anyhow/issues/69">#69</a>)</p>
<blockquote>
<ul>
<li>If you want panics and errors to both have backtraces, set <code>RUST_BACKTRACE=1</code>;</li>
<li>If you want only errors to have backtraces, set <code>RUST_LIB_BACKTRACE=1</code>;</li>
<li>If you want only panics to have backtraces, set <code>RUST_BACKTRACE=1</code> and <code>RUST_LIB_BACKTRACE=0</code>.</li>
</ul>
</blockquote>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="022f700a1c"><code>022f700</code></a> Release 1.0.28</li>
<li><a href="e2eb1f5263"><code>e2eb1f5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dtolnay/anyhow/issues/78">#78</a> from dtolnay/cfg</li>
<li><a href="d65ec5ed2f"><code>d65ec5e</code></a> Use doc_cfg to mark Error::new</li>
<li><a href="e46df9f4a5"><code>e46df9f</code></a> Rephrase nightly backtrace note</li>
<li><a href="946bff8a54"><code>946bff8</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dtolnay/anyhow/issues/73">#73</a> from lzybkr/nightly_in_docs</li>
<li><a href="a07b84b641"><code>a07b84b</code></a> Mention nightly in module docs</li>
<li><a href="ffc45d2d42"><code>ffc45d2</code></a> Select a single docs.rs build target</li>
<li><a href="e7702aa4fc"><code>e7702aa</code></a> Release 1.0.27</li>
<li><a href="19be9654a0"><code>19be965</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dtolnay/anyhow/issues/71">#71</a> from dtolnay/dev</li>
<li><a href="4426253333"><code>4426253</code></a> Disable dev dependency on futures executor</li>
<li>Additional commits viewable in <a href="https://github.com/dtolnay/anyhow/compare/1.0.26...1.0.28">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=anyhow&package-manager=cargo&previous-version=1.0.26&new-version=1.0.28)](https://dependabot.com/compatibility-score/?dependency-name=anyhow&package-manager=cargo&previous-version=1.0.26&new-version=1.0.28)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-04-20 18:26:04 +00:00
bors[bot]
4711a1dfcf
Merge #1396
1396: Correct the backend name in README r=nlewycky a=satrobit

The README mistakenly said LLVM when it was referring to the singlepass backend. It's just a simple doc fix.

Co-authored-by: Amir Keshavarz <satrobit@users.noreply.github.com>
2020-04-20 17:00:28 +00:00
Amir Keshavarz
29babb7be2
Correct the backend name 2020-04-20 21:16:53 +04:30
dependabot-preview[bot]
090eaa451d
Bump anyhow from 1.0.26 to 1.0.28
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.26 to 1.0.28.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.26...1.0.28)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 08:56:42 +00:00
bors[bot]
b32ac89810
Merge #1388
1388: Remove --test-threads=1 added to singlepass in 4d8eb7 now that the underlying bug is fixed. r=syrusakbary a=nlewycky



Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
2020-04-17 19:13:47 +00:00
Nick Lewycky
6aef5a6908 Remove --test-threads=1 added to singlepass in 4d8eb7d2419d64d7e75bbd8880e5bfbf4fad0386 now that the underlying bug is fixed. 2020-04-17 11:50:11 -07:00
bors[bot]
27970e3f2e
Merge #1385
1385: Fix underflow in subtraction on global.get with float-type global. r=nlewycky a=nlewycky

# Description
Fix spectests-singlepass failures that appear when in debug builds (checked subtraction). The global.get opcode pushes to the fp_stack first and the value_stack second, so it shouldn't be subtracting 1 from the size of the value_stack.


Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
Co-authored-by: nlewycky <nick@wasmer.io>
2020-04-17 18:17:33 +00:00
nlewycky
968888abba
Merge branch 'master' into nlewycky/singlepass-globalget-fp 2020-04-16 18:11:24 -07:00
Nick Lewycky
452dbb814b Fix underflow in subtraction on global.get with float-type global. 2020-04-16 17:50:16 -07:00
Syrus Akbary
0fd49664ca
Fixed Makefile llvm autodetect 2020-04-16 17:44:25 -07:00
Syrus Akbary
d57a526de7
Merge pull request #1384 from wasmerio/test-fixes
Various fixes for the latest testing changes
2020-04-16 17:27:46 -07:00
Syrus
4d8eb7d241 Various fixes for the latest testing changes 2020-04-16 17:24:07 -07:00
bors[bot]
e19dbbee1d
Merge #1382
1382: Test Refactor r=syrusakbary a=syrusakbary

# Description

This PR is the continuation of #1380.
It refactors our testing infrastructure based on various points:
* There is no longer a "default compiler" on tests
* Tests are automatically generated for: emscripten and wasi
* It accelerates testing into multiple threads when possible (with the exception of the llvm backend)
* It automatically detects the backends available in the host

Summary of changes:
* [x] Removed all extra logic for test creation in emscripten test generator
* [x] Removed all extra logic for test creation in the wasi test generator
* [x] Divided wasmer wast test in different files (under `tests/custom/`)
* [x] Refactored trap asserts using the wast format
* [x] Improved the build script by adding emscripten and wasi test generators (separated from build)
* [x] Improved WASI errors to be Rust error types (by deriving from `thiserror::Error`)
* [x] Fixed toolchain error creation
* [x] Removed leaking of testing logic from generators into build
* [x] Refactored import tests to be compatible with multiple backends
* [x] Improved wasmer binary to work even when no backends are set (useful for testing without any backend available).
* [x] Removed assumption that Cranelift will be the default in the `wasmer` binary
* [x] Migrated middleware

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-04-16 23:23:32 +00:00
Syrus
e714f55189 Fixed dereference error 2020-04-16 16:21:09 -07:00
Syrus
c79b736036 Addedd changes into Changelog 2020-04-16 15:49:23 -07:00
Syrus
565462d349 Re-enabled middleware 2020-04-16 15:47:01 -07:00
Syrus
ab4a51dcec Detect singlepass first 2020-04-16 15:33:48 -07:00
Syrus
11a0ab08d4 Fixed lint issue 2020-04-16 15:31:55 -07:00
Syrus
b159163927 Added README to custom wast tests dir 2020-04-16 15:30:53 -07:00
Syrus
9d63da5740 Make makefile standard for wasitests 2020-04-16 15:30:53 -07:00
Mark McCaskey
ce6211579f Conditionally compile default_compiler and related functions 2020-04-16 14:44:59 -07:00
Syrus
c9713e485c Fixed makefile 2020-04-16 14:16:23 -07:00
Syrus
695ac6d1d3 Fixed llvm tests running cranelift/singlepass 2020-04-16 13:52:24 -07:00
Syrus
a858401b11 Fixed forgot name/body improvement in processors 2020-04-16 13:47:03 -07:00
Syrus
a2d2710010 Fixed suggestions based on feedback 2020-04-16 13:46:22 -07:00
Syrus
fbdfa62d3c Fixed suggestions 2020-04-16 13:46:22 -07:00
Syrus Akbary
80ed212a9f
Update tests/test-generator/src/processors.rs
Co-Authored-By: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-04-16 13:46:12 -07:00
Syrus Akbary
6021d1735a
Update tests/test-generator/src/processors.rs
Co-Authored-By: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-04-16 13:45:23 -07:00
Syrus Akbary
8b177b5320
Update tests/test-generator/src/lib.rs
Co-Authored-By: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-04-16 13:40:22 -07:00
Syrus
081ab36237 Simplified azure testing 2020-04-16 13:26:24 -07:00
Syrus
7071e48c2b Trying to make wasitests setup work in windows 2020-04-16 13:12:06 -07:00
Syrus
f8aec14895 Trying to make the Makefile Windows compatible 2020-04-16 13:08:39 -07:00
Syrus
f222658dcb Added DynamicFunc::new method for non x86 architectures 2020-04-16 12:53:17 -07:00
Syrus
51ed488b49 Added comments on features 2020-04-16 12:45:34 -07:00
Syrus
6904961325 Ignore basic test as it doesn’t run in Aarch64 2020-04-16 12:42:21 -07:00
Syrus
4e489a1bde Moved tests from runtime to high_level_api 2020-04-16 12:34:54 -07:00
Syrus
595f5bb472 Moved cache testing to the general tests 2020-04-16 12:22:28 -07:00
Syrus
636b0291af Fixed Windows build. Make Azure windows simpler 2020-04-16 12:00:35 -07:00
Syrus
b301ac85be Improved tests to use available compilers 2020-04-16 11:52:29 -07:00
Syrus Akbary
5f5928dfbd
Update Cargo.toml
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-04-16 11:38:36 -07:00
Syrus
9dc587e611 Fixed singlepass tests on Windows 2020-04-15 19:47:58 -07:00
Syrus
444a68d1a4 Test only on the backends available 2020-04-15 19:39:10 -07:00
Syrus
6415579ed6 Fixed command names 2020-04-15 19:35:20 -07:00
Syrus
8a669cfda5 Fixed example testing 2020-04-15 19:34:25 -07:00
Syrus
21cef317b1 Fixed syntax 2020-04-15 18:48:54 -07:00
Syrus
2a897fd5d2 Ignore wasi tests on aarch64 2020-04-15 18:42:07 -07:00
Syrus
8369431b34 Removed unneeded parenthesis on ARM 2020-04-15 18:37:47 -07:00
Syrus
21f7baec99 Fixed lints 2020-04-15 18:29:53 -07:00
Syrus
28351402aa Formatted rust files 2020-04-15 18:29:53 -07:00
Syrus
bb3c1a6e19 Fixed suggestions 2020-04-15 18:29:53 -07:00
Syrus
23a18965b1 Improve llvm compat 2020-04-15 18:29:13 -07:00
Syrus
cce851f22f Improved tests semantics 2020-04-15 18:29:13 -07:00
Syrus
37afcd33df Removed unused code on wasitests 2020-04-15 18:29:13 -07:00
Syrus
7b41c2b843 Test forgotten function in imports 2020-04-15 18:29:13 -07:00
Syrus
dfb7432595 Moved processors out of build 2020-04-15 18:29:13 -07:00
Syrus Akbary
c5415216d7
Update build.rs (truthy env unwrap suggestion) 2020-04-15 17:52:54 -07:00
Syrus Akbary
b1a7dbe212
Update tests/generate-wasi-tests/src/set_up_toolchain.rs
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-04-15 17:49:01 -07:00
Syrus Akbary
6a840a753a
Update Cargo.toml
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-04-15 17:48:21 -07:00
Syrus Akbary
e14a74063b
Update build.rs
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-04-15 17:48:03 -07:00
Syrus Akbary
8c9d8b23cb
Update tests/custom/multiple-traps.wast
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-04-15 17:47:31 -07:00
Syrus
51a454659b Only run shell tput in *Unix 2020-04-15 16:35:02 -07:00
Syrus
52c969a71a Merge branch 'master' into test-refactor-2 2020-04-15 16:32:37 -07:00
Syrus
ce14c6c079 Second part of the refactor 2020-04-15 16:31:05 -07:00
bors[bot]
249d0b8e20
Merge #1380
1380: Test refactor r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

This PR refactors the way we do testing in our infrastructure, simplifying test generation specially for spectests for each of the backends.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
2020-04-14 20:26:16 +00:00
Syrus
2dc501822b Trying to make tests pass 2020-04-14 13:21:39 -07:00
Syrus
a85bc193f7 Ignore spec start on cranelift windows 2020-04-14 13:19:52 -07:00
Syrus
952374ccfa Fixed android tests 2020-04-14 13:19:40 -07:00
Syrus
6216891ded Fixed windows tests ignores 2020-04-14 12:46:20 -07:00
Syrus
a840b45ed7 Improved PR based on feedback. Fixed ignores 2020-04-14 12:42:45 -07:00
Syrus
cebd0ed7ab Improved attributions 2020-04-14 12:41:05 -07:00
Syrus
7f0c15b0e1 Refactored test ignores 2020-04-14 11:43:18 -07:00
Syrus
a7dba54b7f Improved test generation 2020-04-14 11:41:12 -07:00
Syrus
c2306bd39e Renamed dev_utils to utils 2020-04-10 20:18:27 -07:00
Mark McCaskey
4f23ed7f20 Readjust where things are exported in the new API 2020-04-10 12:12:36 -07:00
bors[bot]
6661ca73a6
Merge #1370
1370: feat(interface-types) Crate reorganization r=Hywan a=Hywan

This PR re-organizes the crate:

* `interpreter/wasm/values.rs` moves to `values.rs`,
* `interpreter/wasm/serde/*` moves to `serde/*`,
* `types.rs` is new, and includes `InterfaceType` and `RecordType`,
* Update the documentation.

Bonus: `InterfaceValue::Record`  now takes a `Vec1` rather than a `Vec` to match `InterfaceType::Record`.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-04-10 08:24:23 +00:00
Mark McCaskey
bf09dc5e67
Merge branch 'master' into feature/update-capi-to-use-new-api 2020-04-09 17:40:29 -07:00
bors[bot]
da1e963c52
Merge #1371
1371: Update tests to use new API where easily possible r=MarkMcCaskey a=MarkMcCaskey

The primary thing that wasn't updated yet is the compile and compile_with... functions.


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-04-09 22:56:57 +00:00
Mark McCaskey
5c09fedcd3 Remove all uses of wasmer_runtime from tests 2020-04-09 15:50:35 -07:00
Mark McCaskey
c9460e3a03 Migrate tests away from using runtime and runtime_core 2020-04-09 14:37:21 -07:00
Mark McCaskey
a149c9aaeb Update tests to use new API where easily possible 2020-04-09 12:51:18 -07:00
Ivan Enderlin
3e9c3a1694 doc(interface-types) Update the module documentation. 2020-04-09 12:16:57 +02:00
Ivan Enderlin
4c2fb953a4 feat(interface-types) InterfaceValue::Record now takes a Vec1.
It matches the definition of `InterfaceType::Record`.
2020-04-09 12:10:48 +02:00
Ivan Enderlin
700c290e55 feat(interface-types) Move the values and serde modules to the root of the crate. 2020-04-09 11:23:26 +02:00
Ivan Enderlin
e4b05d0b00 feat(interface-types) Remove the re-export of InterfaceType in values. 2020-04-09 10:54:09 +02:00
Ivan Enderlin
f955617d17 feat(interface-types) Extract InterfaceType and RecordType into its own types module. 2020-04-09 10:48:50 +02:00
bors[bot]
ad6f939e85
Merge #1362
1362: feat(interface-types) Remove allocator index from `string.lower_memory` r=Hywan a=Hywan

This PR updates `string.lower_memory` to remove the allocator index. Indeed, the string pointer is assumed to be present on the stack.
Also, this PR updates `string.size` to pop, and not to peek, the string to compute the length from.

That way, it matches the WIT proposal.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-04-09 08:05:50 +00:00
bors[bot]
1ef2fe3ac9
Merge #1368
1368: Fix issue with `kernel-net`; add it to CI r=MarkMcCaskey a=MarkMcCaskey

Resolves #1365 


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-04-09 00:26:34 +00:00
Mark McCaskey
23bc0fd720 Fix kernel-net check, fix misc warnings
Split out nightly check step
2020-04-08 17:05:25 -07:00
bors[bot]
3474c31355
Merge #1369
1369: Fix broken makefile commands and improve test consistency r=MarkMcCaskey a=MarkMcCaskey


# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-04-09 00:04:10 +00:00
Mark McCaskey
bb67a11c5f Fix broken makefile commands and improve test consistency 2020-04-08 17:01:32 -07:00
Mark McCaskey
b72000a2d6 Update emscripten in C API to use new API crate 2020-04-08 16:40:41 -07:00
Mark McCaskey
4d58ae2d14 Fix issue with kernel-net; add it to CI 2020-04-08 15:18:04 -07:00
bors[bot]
cd4706fbac
Merge #1367
1367: Move `dev-utils` crate into `tests` r=MarkMcCaskey a=MarkMcCaskey

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-04-08 20:41:23 +00:00
Mark McCaskey
9f99baa732 Fix check CI step
rm dev-utils from makefile
2020-04-08 13:40:34 -07:00
Mark McCaskey
9e8d08a771
Merge branch 'master' into feature/dev-utils-in-tests 2020-04-08 12:15:22 -07:00
Mark McCaskey
3d4ed92466 Move dev-utils crate into tests 2020-04-08 11:59:47 -07:00
bors[bot]
45c412e8dd
Merge #1363
1363: fix(interface-types) Don't duplicate code in the binary encoder. r=MarkMcCaskey a=Hywan

Use the `ToBytes` implementation of `RecordType` to encode the inner
record type of a type, so that it avoids code duplication.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-04-08 18:48:49 +00:00
bors[bot]
bf2d7e93cf
Merge #1361
1361: doc(interface-types) Add `record` instructions in the `README.md` r=MarkMcCaskey a=Hywan

This PR keeps the documentation up-to-date.

Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2020-04-08 18:00:28 +00:00
Mark McCaskey
db76aea198 Remove more uses of wasmer_runtime_core from the C API 2020-04-07 17:28:23 -07:00
bors[bot]
6857cc543f
Merge #1357
1357: Refactored bin commands into separate files r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Refactored bin commands into separate files.
This PR does not do any sustancial changes other than refactoring into different files for better readability.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-04-07 20:30:09 +00:00
Syrus
6e18121cba Fixed last kernel issues 2020-04-07 13:29:02 -07:00
Syrus
daeb0f775e Added kernel subcommand 2020-04-07 12:53:41 -07:00
Syrus
69899bf014 Fixed issues 2020-04-07 12:47:36 -07:00
Syrus
08061f51cb Move kwasmd into wasmer 2020-04-07 12:34:34 -07:00
Syrus
f7c84c8a26 Fixed issues 2020-04-07 10:00:47 -07:00
Ivan Enderlin
4eae19ccc7 fix(interface-types) Don't duplicate code in the binary encoder.
Use the `ToBytes` implementation of `RecordType` to encode the inner
record type of a type, so that it avoids code duplication.
2020-04-07 14:29:57 +02:00
Ivan Enderlin
1687744ec9 feat(interface-types) string.size pops the string.
Previously, `string.size` was just peeking the string.
2020-04-07 12:40:14 +02:00
Ivan Enderlin
bfa5821d98 test(interface-types) Update the test_executable_instruction macro.
It provides a better failure message.
2020-04-07 12:34:30 +02:00
Ivan Enderlin
2fffee32a5 fix(interface-types) Remove allocator index from string.lower_memory. 2020-04-07 12:34:07 +02:00
Ivan Enderlin
c0623b0f8c doc(interface-types) Add record instructions. 2020-04-07 11:58:13 +02:00
Syrus Akbary
cef3dfa3b0
Merge branch 'master' into features/refactor-bin 2020-04-06 18:54:33 -07:00
Syrus
5c0ccc0a4e Trying to fix kwasmd 2020-04-06 18:54:00 -07:00
Syrus Akbary
bc757908cd
Merge pull request #1349 from wasmerio/feature/reorganized-tests
Move integration tests to `tests` dir in workspace root
2020-04-06 18:40:50 -07:00
Mark McCaskey
ade38aa391 Use CRANELIFT instead of CLIF in test env vars 2020-04-06 17:21:57 -07:00
Mark McCaskey
83f0a043e7 Update C API to use new API 2020-04-06 17:09:50 -07:00
Syrus
3735dc2742 Address feedback 2020-04-06 17:02:01 -07:00
Mark McCaskey
3579d0d445 Fix emtests and wasitests to use the correct backend 2020-04-06 16:47:06 -07:00
Syrus Akbary
c47595012a
Merge branch 'master' into features/refactor-bin 2020-04-06 16:32:16 -07:00
Syrus
20d4a5682e Added changes into changelog 2020-04-06 16:31:31 -07:00
Syrus
c312bdc782 Improved imports 2020-04-06 16:31:23 -07:00
Syrus
5572ebd990 Refactored bin commands into separate files 2020-04-06 16:06:49 -07:00
Mark McCaskey
b6011d5dc4 Only run runtime_core tests on Android 2020-04-06 14:13:54 -07:00
Mark McCaskey
9d312f4500 Add support for android in spectests 2020-04-06 12:35:08 -07:00
Mark McCaskey
4c29cd4af3 Merge branch 'master' into feature/reorganized-tests 2020-04-06 12:04:36 -07:00
Mark McCaskey
52cbb60743 Fix up tests for CI 2020-04-06 11:42:44 -07:00
bors[bot]
99f8c949d1
Merge #1354
1354: test(middleware-common) Remove an unused import r=MarkMcCaskey a=Hywan

This PR removes an unused import.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-04-06 17:40:35 +00:00
Syrus Akbary
c5c3ddcfbd
Merge pull request #1355 from Hywan/doc-changelog-1331
doc(changelog) Add #1331
2020-04-06 02:08:30 -07:00
Ivan Enderlin
4ba5d6e4ab doc(changelog) Add #1331. 2020-04-06 09:40:03 +02:00
Ivan Enderlin
ac3288db1c test(middleware-common) Remove an unused import. 2020-04-06 08:34:55 +02:00
bors[bot]
4d33020b35
Merge #1331
1331: feat(interface-types) Implement the `record` instructions r=Hywan a=Hywan

### Description

This PR implements the `record` WIT type, along with the `record.lift` and `record.lower` instructions.

With my current understanding of the draft/specification, here is how it works. Let's say we want to represent a Rust struct like the following:

```rust
struct S {
    x: String,
    y: i32
}
```

First declare a WIT type, such as:

```wat
(@interface type (record (field string) (field i32)))
```

The `record` type is supported by the binary encoder, the WAT encoder, the binary decoder, and the WAT decoder. A new `TypeKind` node has been introduced in the AST to differentiate a function type (`(@interface type (func (param …) (result …)))`) of a record type (see above).

Second, the `record.lower` transforms a host value (here Rust value, `S`) into a WIT value. In our implementation, a record value is defined as:

```rust
InterfaceValue::Record(Vec<InterfaceValue>)
```

Multiple mechanisms are used to type check a record value based on a record type. The code of the `record.lower` is pretty straightforward.

Because transforming a host value into a WIT value isn't obvious, a `Serializer` has been implemented, based on [`serde`](https://serde.rs/). This feature is behind the `serde` flag, which is turned on by default.

Serde is only used to cross the host/Wasm boundary, but it's not used to represent the value in memory or anything. It's only a shortcut to transform a host value into a WIT value, and vice versa.

Use the following code to transform `S` into a WIT value:

```rust
#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct S {
    x: String,
    y: i32,
}

let host_value = S { x: "hello".to_string(), y: 42 };
let wit_value = to_interface_value(&host_value).unwrap();

assert_eq!(
    wit_value,
    InterfaceValue::Record(vec![
        InterfaceValue::String("hello".to_string()),
        InterfaceValue::I32(42),
    ])
);
```

Third, the `record.lift`  instruction does the opposite of `record.lower`: It transforms WIT values into a host value. To also facilitate the user experience, this PR contains a `Deserializer` implementation, still based on `serde`, with the `from_interface_values` function. It looks like this:

```rust
let wit_values = vec![
    InterfaceValue::Record(vec![
        InterfaceValue::String("hello".to_string()),
        InterfaceValue::I32(42),
    ])
];
let host_value = from_interface_values::<S>(&wit_values).unwrap();

assert_eq!(
    host_value,
    S { x: "hello".to_string(), y: 42 },
);
```

With the `Serializer` and `Deserializer`, it's super easy for the user to send or receive values from WIT.

The `record.lift` and `record.lower` instructions are kind of basic. The `record.lift` instruction has a little trick to reduce vector allocations, but there is a documentation for that.

#### Opened questions

Records of dimension 1 do not raise any issue. With `record.lift`, all values on the stack (the WIT interpreter stack) are popped, and are used as record field values. Something like:

```
[stack]
i32(1)
i64(2),
string("hello")
record.lift <record_type>
```

generates

```
[stack]
record { i32(1), i64(2), string("hello") }
```

But it's not clear what happens with record of dimension > 1, for instance for a type like `record (field i32) (record (field i32) (field i32)) (field string)`, it is assumed (in this PR) that the stack must be like this:

```
[stack]
i32(1)
i32(2)
i32(3)
string("hello")
record.lift <record_type>
```

to generate:

```
[stack]
record { i32(1), record { i32(2), i32(3) }, string("hello") }
```

If we want the stack to contain an intermediate record, we should have something like this:

```
[stack]
i32(1)
i32(2)
i32(3)
record.lift <record_type_2>
string("hello")
record.lift <record_type_1>
```

But it would imply that `record_type_1` is defined as `record (field i32) (record (type record_type_2)) (field i32)`.

A sub-record defined by another record type isn't support, as it is not specified in the draft. I believe my assumption is fine enough for a first implementation of records in WIT.

### To do

- [x] Encode and decode record type (`(@interface type (record string i32))`):
  - [x] Binary encoder/decoder
  - [x] WAT encoder/decoder
- [x] Implement the `record.lift` instruction
- [x] Implement the `record.lower` instruction
- [x] Test
- [x] Documentation
- [x] Surprise!
  - [x] Serialize a Rust value to WIT values (useful for `record`s)
  - [x] Deserialize WIT values to a Rust value (useful for `record`s)

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-04-06 06:17:45 +00:00
Ivan Enderlin
9f10b7ae50 doc(interface-types) Update from_interface_values's doc.
Using `InterfaceValue::Record` explicitely doesn't change anything
since values are flatten, but it's better for a usual reading to avoid
confusion.
2020-04-06 08:13:10 +02:00
Ivan Enderlin
27053d5ca6 doc(interface-types) Rewrite record_lift_ documentation. 2020-04-06 08:09:10 +02:00
Ivan Enderlin
c2b1b87f9a feat(interface-types) Use VecDeque to remove unsafe code. 2020-04-06 07:55:56 +02:00
Ivan Enderlin
4faf827dc9 feat(interface-types) Avoid clones by using owned items in an iterator.
`into_iter` owned the item, so no need to clone when moving them in
the stack.
2020-04-06 07:54:51 +02:00
Ivan Enderlin
4ad3d7f123 doc(interface-types) Explain a part of an algorithm. 2020-04-04 08:10:38 +02:00
Mark McCaskey
dfa6247075 Move spectests, wrap up test restructure 2020-04-03 14:24:40 -07:00
Ivan Enderlin
5119b6a58f feat(interface-types) Simplify FlattenInterfaceValueIterator with last_mut. 2020-04-03 16:22:26 +02:00
Ivan Enderlin
e4921bd496 feat(interface-types) Use Vec::last_mut to simplify code. 2020-04-03 16:20:22 +02:00
Ivan Enderlin
398d791c9f fix(interface-types) Also apply another lazy evaluation in the deserializer. 2020-04-03 16:19:07 +02:00
Ivan Enderlin
e160feb99a fix(interface-types) Use lazy evaluation in the deserializer. 2020-04-03 16:18:24 +02:00
Ivan Enderlin
d186142507 doc(interface-types) Fix a typo. 2020-04-03 16:16:53 +02:00
Ivan Enderlin
3159da5bfe feat(interface-types) Add the Vec1 type to represent a non-empty vector.
`Vec1` is used by `RecordType` to ensure that a record have at least 1
field. Then an `InterfaceValue::Record` is ensured to get at least one
value with the type-checking pass.
2020-04-03 16:13:44 +02:00
Ivan Enderlin
6cef1c244a doc(interface-types) Fix typos. 2020-04-03 14:46:59 +02:00
Mark McCaskey
513e6acbc1 Move emscripten-tests to tests dir + misc fixes 2020-04-02 16:51:58 -07:00
bors[bot]
1833af7eba
Merge #1350
1350: update blake3 to 0.3.1 r=syrusakbary a=oconnor663

Version 0.3.0 caused problems because it required a C compiler with
AVX-512 support, which broke Android x86 cross-compilation. Version
0.3.1 automatically falls back to a pure Rust build when the C compiler
either doesn't exist or doesn't support the flags we need.

Co-authored-by: Jack O'Connor <oconnor663@gmail.com>
2020-04-02 15:11:41 +00:00
Jack O'Connor
aca0bd11c0 update blake3 to 0.3.1
Version 0.3.0 caused problems because it required a C compiler with
AVX-512 support, which broke Android x86 cross-compilation. Version
0.3.1 automatically falls back to a pure Rust build when the C compiler
either doesn't exist or doesn't support the flags we need.
2020-04-02 11:02:49 -04:00
Ivan Enderlin
2011fda31d chore(interface-types) Split the serde module…
… into `serde/ser.rs` and `serde/de.rs`. I like smaller files.
2020-04-02 16:46:23 +02:00
Ivan Enderlin
be66ac8aa4 doc(interface-types) Improve serde module documentation. 2020-04-02 16:41:03 +02:00
Ivan Enderlin
010b10d7b0 chore(cargo) Update Cargo.lock. 2020-04-02 16:39:40 +02:00
Ivan Enderlin
e385bf66c7 feat(interface-types) Make unwraps safe by introducing more errors. 2020-04-02 16:38:40 +02:00
Ivan Enderlin
b0af014339 doc(interface-types) Update an example. 2020-04-02 16:29:52 +02:00
Ivan Enderlin
ee0596d2c3 feat(interface-types) Restrict supported type in the Deserializer.
`seq`, `map` and `tuple` for instance are not supported officially. It
was fun to play with it at the beginning, but it is time to remove it
to match the `Serializer` implementation.
2020-04-02 16:26:24 +02:00
Ivan Enderlin
d6f7e3ff02 doc(interface-types) Describe to_interface_value. 2020-04-02 15:59:07 +02:00
Ivan Enderlin
f9832fecaf feat(interface-types) Implement a serializer for WIT values. 2020-04-02 15:54:39 +02:00
Ivan Enderlin
8868d640fa feat(interface-types) Rename from_values to from_interface_values. 2020-04-02 13:56:20 +02:00
Ivan Enderlin
7b182416df feat(interface-types) Make serde optional behind a feature flag. 2020-04-02 13:53:10 +02:00
Ivan Enderlin
f8507533fb fix(interface-types) Fix a git-merge issue. 2020-04-02 12:16:30 +02:00
Ivan Enderlin
bac56a6e0b Merge branch 'master' into feat-interface-types-record-instructions 2020-04-02 12:10:01 +02:00
Ivan Enderlin
8f8c5f1bc8 chore(interface-types) Improve code readabilit of the record.lift instruction. 2020-04-02 12:06:54 +02:00
Ivan Enderlin
0023eea275 feat(interface-types) Implement the record.lower instruction. 2020-04-02 12:06:27 +02:00
Ivan Enderlin
11687c57ca feat(interface-types) Encodes/decodes the record.lower instruction. 2020-04-02 12:05:22 +02:00
Ivan Enderlin
b8ef82d1d0 test(interface-types) Rename test cases. 2020-04-02 11:59:35 +02:00
Ivan Enderlin
a1551b52af test(interface-types) Rename a test case. 2020-04-02 11:58:05 +02:00
Ivan Enderlin
aab82c122d feat(interface-types) Implement From<&Vec<InterfaceValue>> for RecordType. 2020-04-02 11:55:54 +02:00
Ivan Enderlin
3411ac7a1c feat(interface-types) Move serde::InterfaceTypeIterator into values::FlattenInterfaceValueIterator. 2020-04-02 11:55:20 +02:00
Ivan Enderlin
5ba6fda1c9 chore(interface-types) Improve code readibility of string instructions. 2020-04-02 11:51:34 +02:00
Mark McCaskey
976bf9b6a3 Move integration tests to tests dir in workspace root 2020-04-01 17:09:51 -07:00
bors[bot]
ecafa7564d
Merge #1313
1313: Add types and methods to provide updated API r=MarkMcCaskey a=MarkMcCaskey

Improving the API in a number of ways.

<details><summary>Current status </summary>

- [x] Get exports from Instance
  - [x] Func
     - [x] Documented
     - [x] Tested
  - [x] DynFunc
    - [x] Documented
    - [x] Tested
  - [x] Memory
    - [x] Documented
    - [x] Tested
  - [x] Table
    - [x] Documented
    - [ ] Tested ; fully testing this now will be difficult, blocked on Table API being completed
  - [x] Global
    - [x] Documented
    - [x] Tested
  - [x] Field syntax (fairly non-trivial)
- [x] Get imports from Module
  - [ ] Maybe update this to be an iterator instead of a Vec (side note, we may want to have a way to access specific types of imports too)
  - [x] Documented
  - [x] Tested
- [x] Get exports from Module
  - [x] Documented
  - [x] Tested
- [x] Get custom section from Module
  - [x] Figure out correct solution
  - [x] Ship separate PR that updates custom section code
  - [x] Documented
  - [x] Tested
- [ ] Updated Memory API
  - [x] Added conversion methods to bytes/pages with From
  - [ ] Documented
  - [ ] Tested
- [ ] Table APIs ; blocked on `wrap` being not linear time update (this update should also make it possible to retrieve a `Func` from `vm::Anyfunc`)
  - [ ] Table set (implemented needs to be checked)
    - [ ] Documented with examples
    - [x] Implemented
  - [ ] Table grow (implemented needs to be checked)
    - [ ] Documented with examples
    - [x] Implemented
  - [ ] Table get
    - [x] Structure implemented
    - [ ] Documented
    - [ ] Tested
- [ ] Module APIs (probably separate)
- [x] Update import object macro to handle a lack of trailing commas as well
  - [x] Add line in changelog about it
  - [x] Tested

</details>

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-03-31 23:25:28 +00:00
Mark McCaskey
0527b50af3 Improve consistency of names, reuse more code, and reorganize a bit 2020-03-31 16:00:52 -07:00
Mark McCaskey
bde319d9fb Fix bug and un-deprecate Instance::call 2020-03-31 14:06:30 -07:00
Mark McCaskey
836711f7cd Implement Instance::call in terms of the exports API 2020-03-31 12:40:55 -07:00
Mark McCaskey
50fcd57e45 Improve consistency and add misc clean ups 2020-03-31 12:37:50 -07:00
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
Syrus Akbary
3639ef6d24
Enable sccache in ARM 2020-03-30 20:41:12 -07:00
Syrus Akbary
0623fa0549
Merge pull request #1325 from wasmerio/dependabot/cargo/structopt-0.3.12
Bump structopt from 0.3.11 to 0.3.12
2020-03-30 17:58:03 -07:00
Syrus Akbary
5e05ea26c6
Merge pull request #1326 from wasmerio/dependabot/cargo/serde-1.0.105
Bump serde from 1.0.104 to 1.0.105
2020-03-30 17:57:49 -07:00
Syrus Akbary
7dc26cf867
Merge pull request #1336 from wasmerio/dependabot/cargo/regex-1.3.6
Bump regex from 1.3.4 to 1.3.6
2020-03-30 17:57:39 -07:00
Syrus Akbary
ad4cfd1583
Merge pull request #1341 from wasmerio/dependabot/cargo/errno-0.2.5
Bump errno from 0.2.4 to 0.2.5
2020-03-30 17:57:29 -07:00
Mark McCaskey
403d4b4c8b
Merge branch 'master' into feature/update-api 2020-03-30 17:40:18 -07:00
Mark McCaskey
7ca721bd83 Update from feedback
Deprecate more methods on `Instance`, add `into_iter` method on
`Exports`, add FuncSig to ImportType and other updates.
2020-03-30 17:38:51 -07:00
dependabot-preview[bot]
778b686e82
Bump structopt from 0.3.11 to 0.3.12
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.11 to 0.3.12.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.11...v0.3.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 00:16:44 +00:00
dependabot-preview[bot]
959a1937a0
Bump errno from 0.2.4 to 0.2.5
Bumps [errno](https://github.com/lambda-fairy/rust-errno) from 0.2.4 to 0.2.5.
- [Release notes](https://github.com/lambda-fairy/rust-errno/releases)
- [Commits](https://github.com/lambda-fairy/rust-errno/compare/v0.2.4...v0.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 00:16:43 +00:00
dependabot-preview[bot]
b5b5232a2b
Bump serde from 1.0.104 to 1.0.105
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.104 to 1.0.105.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.104...v1.0.105)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 00:16:42 +00:00
dependabot-preview[bot]
5d87810892
Bump regex from 1.3.4 to 1.3.6
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.4 to 1.3.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.3.4...1.3.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 00:16:41 +00:00
bors[bot]
4903064372
Merge #1339
1339: Create a valid target triple in the LLVM Module. r=MarkMcCaskey a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-03-30 23:46:04 +00:00
Mark McCaskey
06fe2ac70d
Merge branch 'master' into feature/llvm-target-triple 2020-03-30 16:08:50 -07:00
bors[bot]
af03dc11b9
Merge #1345
1345: Adding Azure pipelines to handle ARM r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Adding Azure pipelines to handle ARM
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-03-30 22:38:26 +00:00
Syrus
800d428e8c Added the architecture into the artifacts 2020-03-30 15:36:42 -07:00
Syrus
d26ddd1023 Merge branch 'master' into feature/arm-tests 2020-03-30 15:29:52 -07:00
Syrus
eb4dc71208 Added changes in changelog 2020-03-30 15:28:47 -07:00
Syrus Akbary
d2e1098316
Merge pull request #1346 from wasmerio/revert-1343-blake3_update
Revert "update blake3 to version 0.3.0"
2020-03-30 15:23:15 -07:00
Syrus Akbary
34638417a9
Revert "update blake3 to version 0.3.0" 2020-03-30 15:22:46 -07:00
Syrus
18c0896423 Trying to ffix pipelines 2020-03-30 15:10:31 -07:00
Syrus
d5cdd497fa Fixed missing poolName 2020-03-30 15:03:50 -07:00
Syrus Akbary
b3c9abcd59
Merge pull request #1343 from oconnor663/blake3_update
update blake3 to version 0.3.0
2020-03-30 14:53:05 -07:00
Syrus
eec7844bae Added ARM integration 2020-03-30 14:45:26 -07:00
Syrus Akbary
c9113ea6ba
Merge branch 'master' into feature/arm-tests 2020-03-30 14:20:46 -07:00
Syrus
8e144a457b Adding Azure pipelines to handle ARM 2020-03-30 14:18:51 -07:00
Jack O'Connor
566d2f7467 update blake3 to version 0.3.0
Version 0.3 switched to using assembly implementations by default, which
both perform better and build more quickly. This invokes the C compiler
from build.rs. If Wasmer would prefer to avoid that build dependency, we
could enable the new `pure` feature.
2020-03-30 11:19:39 -04: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
nlewycky
c4c4adb7bf
Merge branch 'master' into feature/llvm-target-triple 2020-03-28 11:55:37 -07:00
Syrus Akbary
baa74d7385
Merge pull request #1335 from Hywan/fix-runtime-c-api-1314
fix(runtime-c-api) Change mutability of `memory` to`const` in `wasmer_memory_data_length`
2020-03-28 10:41:33 -07:00
Syrus Akbary
b7ad8b2c7a
Merge pull request #1337 from Hywan/fix-interface-types-remove-as
feat(interface-types) Better handling of i32 to usize casts
2020-03-28 10:41:06 -07:00
Nick Lewycky
5b7a06c07b Use the inkwell package on crates.io!! 2020-03-27 15:47:50 -07:00
Mark McCaskey
7cd9e82015 Simplify ImportType 2020-03-27 14:00:02 -07:00
Nick Lewycky
5bd6b161d5 Create a valid target triple in the LLVM Module. 2020-03-27 13:54:18 -07:00
Mark McCaskey
a0dca15fbc Add misc. fixes and updates from feedback 2020-03-27 13:25:51 -07:00
Ivan Enderlin
2276d16f36
Merge branch 'master' into fix-runtime-c-api-1314 2020-03-27 07:48:23 +01:00
Ivan Enderlin
baeeea1535 doc(changelog) Fix typo. 2020-03-27 07:47:03 +01:00
Mark McCaskey
3eff8c1973 Convert usages of Instance::{func,dyn_func} to exports.get 2020-03-26 18:13:45 -07:00
Mark McCaskey
2fb8f8197b Deprecate Instance::func and Instance::dyn_func 2020-03-26 17:11:37 -07:00
Mark McCaskey
a18371eb91 Implement instance.exports field syntax 2020-03-26 16:24:23 -07: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
Ivan Enderlin
6e5d9624f1 feat(interface-types) Simplify code by implementing From<TryFromIntError>. 2020-03-26 10:49:49 +01:00
Ivan Enderlin
25cd6cd24a feat(interface-types) Add the NegativeValue instruction error. 2020-03-26 08:31:06 +01:00
Ivan Enderlin
f3be7981d2 test(interface-types) Test negative pointer or length in string.lift_memory. 2020-03-26 08:30:32 +01:00
Ivan Enderlin
86b545fd49 fix(interface-types) Avoid integer overflows in string instructions. 2020-03-26 08:27:51 +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
0e70e538cc fix(interface-types) Instruction::CallCore.function_index is a u32. 2020-03-26 07:53:44 +01:00
Ivan Enderlin
b0879d1d12 fix(interface-types) Cast index to usize to compare index to length.
The index is bound to `u32::max_value()`. The invocation inputs'
length is bound to `usize::max_value()`, which can be
`u64::max_value`. Consequently, casting the invocation inputs' length
to `u32` can lead to an integer overflow. It is better to cast `index`
to `usize` when comparing with the invocation inputs' length.
2020-03-26 07:46:59 +01:00
Ivan Enderlin
f71872c365 doc(changelog) Add #1335. 2020-03-26 07:35:54 +01:00
Ivan Enderlin
6eaf87d651 chore(runtime-c-api) Update C/C++ headers. 2020-03-26 07:32:57 +01:00
Ivan Enderlin
9826ff3813 fix(runtime-c-api) Change mutability of memory for const in wasmer_memory_data_length. 2020-03-26 07:30:34 +01:00
Ivan Enderlin
4a86cd16f9
Merge branch 'master' into feat-interface-types-new-types-and-instructions 2020-03-26 07:26:37 +01:00
Mark McCaskey
c14c88fb72 Improve high level API test 2020-03-25 16:14:04 -07:00
Mark McCaskey
cc13e45215 Add skeleton of external API and tests 2020-03-24 18:59:09 -07: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
Mark McCaskey
d8bd258ef2 Add skeleton of exported api 2020-03-23 17:53:01 -07: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
9829d97d7d Update Module::custom_sections to properly return multiples 2020-03-23 14:12:07 -07:00
Mark McCaskey
59bd6f6e86
Merge branch 'master' into feature/update-api 2020-03-23 14:07:02 -07: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
Mark McCaskey
844a572bca Rename new type fields from type_ to ty 2020-03-20 17:10:43 -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
Mark McCaskey
da949f47a1 Improve Table implementation for API
This commit also leaves comments explaining the current state of
things so that when it's unblocked it can be finished and the API made public.
2020-03-20 11:15:10 -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
Mark McCaskey
2dc3ea53eb Implement table getting and setting 2020-03-18 18:06:53 -07:00
Mark McCaskey
71be2c6763 Add getter to table and other misc changes 2020-03-18 15:33:34 -07: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
Mark McCaskey
a7ddae13d8 Fix OSX static library packaging 2020-03-18 13:03:33 -07:00
bors[bot]
0c0badc6a2
Merge #1315
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>
2020-03-18 19:32:06 +00:00
Jake Shadle
19ffd8ebb9 Fix warning (from clang) 2020-03-18 20:07:12 +01:00
Jake Shadle
9e389b9a5f Fix cross compilation
cfg!()/env!() are applied on the host platform during the build script's
build, the environment of the build script's execution is the proper way
to determine eg target_os
2020-03-18 20:06:55 +01:00
Jake Shadle
4de7deb568 Replace cmake with cc 2020-03-18 20:05:05 +01:00
losfair
c25ba627df Add comment for call argument list preprocessing. 2020-03-18 23:41:10 +08:00
Mark McCaskey
f864765298 Make trailing commas in imports! macro optional
We now use `,*` on the outside of a `$()` expression to match on
interspersed commas instead of trailing commas. To continue to handle
the trailing comma case, we optionally match on an extra comma at the
end with `$(,)?`.
2020-03-17 16:17:03 -07:00
Mark McCaskey
f4dc419b5e Add types and methods to provide updated API 2020-03-17 15:27:11 -07:00
losfair
8485ccc88c Update comment for nan_canonicalization. 2020-03-18 01:48:27 +08:00
losfair
29a431cfc7 Remove 4 spectest excludes that are no longer needed. 2020-03-18 01:43:05 +08:00
losfair
a9cd6d6814 Add aarch64 NaN canonicalization spectest excludes. 2020-03-18 01:16:18 +08:00
losfair
ea0cd7286e Cargo fmt 2020-03-18 01:03:55 +08:00
losfair
3a18b70d31 Merge remote-tracking branch 'origin/feature/singlepass-nan-cncl' into feature/singlepass-nan-cncl 2020-03-18 01:03:30 +08:00
losfair
86dde8cab2 Add missing movs. 2020-03-18 01:02:59 +08:00
Heyang Zhou
bfc3b8292c
Apply suggestions from code review
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-03-18 00:58:50 +08:00
losfair
8e92e3208a Disable canonicalization for aarch64. 2020-03-18 00:47:52 +08:00
losfair
5e40be48a1 Merge remote-tracking branch 'origin/master' into feature/singlepass-nan-cncl 2020-03-18 00:43:52 +08:00
losfair
72bc9f6531 Add call canonicalization tests. 2020-03-18 00:42:19 +08:00
losfair
1d9f0c53e1 Style fixes and fix missing canonicalization at function call. 2020-03-18 00:42:10 +08:00
bors[bot]
4746d04c44
Merge #1305
1305: Handle panics from DynamicFunc. r=losfair a=losfair

Fixes https://github.com/wasmerio/wasmer/issues/1251#issuecomment-599497118 .

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2020-03-17 11:02:46 +00:00
Heyang Zhou
5331a1c2e4
Merge branch 'master' into fix/dynamicfunc-panic 2020-03-17 19:02:20 +08:00
losfair
1ddf3a1c4e Add mem/local NaN tests. 2020-03-17 14:13:31 +08:00
losfair
e0538d32fa Remove clif spectest excludes. 2020-03-17 13:52:42 +08:00
losfair
4357c15046 Fix missing canonicalizations. 2020-03-17 13:52:11 +08:00
losfair
3ee7f43b1c Enable nan canonicalization for cranelift backend. 2020-03-17 13:09:22 +08:00
bors[bot]
c177c44aa2
Merge #1310
1310: upgrade the blake3 dependency to 0.2 r=MarkMcCaskey a=oconnor663

Version 0.2 makes assembly implementations available. They're off by default, and I haven't enabled them here, because they require the build machine to have a C toolchain installed. But if that's already a requirement for Wasmer, we could enable them with the `"c"` feature, for both better runtime performance and faster build times.

Co-authored-by: Jack O'Connor <oconnor663@gmail.com>
2020-03-16 21:49:54 +00:00
bors[bot]
de0578441b
Merge #1307
1307: Add FreeBSD specific failure excludes. r=MarkMcCaskey a=MikaelUrankar

These tests doesn't pass on FreeBSD amd64

Co-authored-by: MikaelUrankar <mikael.urankar@gmail.com>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-03-16 21:20:33 +00:00
Jack O'Connor
1cbafeb315 upgrade blake3 to version 0.2 2020-03-16 17:12:26 -04:00
bors[bot]
20c21e8737
Merge #1300
1300: Update `wasi-tests` to test multiple versions of WASI r=MarkMcCaskey a=MarkMcCaskey

This change also cleans up the `wasi-test` generation a bit.  It's
actually still really, really messy, but at least now it's split up
into easier to understand chunks.

There's still a lot of low-hanging fruit in terms of improving the
readability and maintainability of the code.

Improves test coverage over what's on master.  Things in `ignores.txt` weren't being tested on master either; we should do a follow up to remove them from there (will require finding a good solution for raw WASI calls)

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-03-16 20:48:35 +00:00
Mark McCaskey
382e244f18
Merge branch 'master' into freebsd 2020-03-16 12:53:10 -07:00
Mark McCaskey
fac27c749b
Merge branch 'master' into feature/improved-wasitests 2020-03-16 12:46:24 -07:00
Mark McCaskey
f78b41a269 Add changelog entry for wasitest update 2020-03-16 12:45:26 -07:00
Syrus Akbary
8f2bb8464a
Merge pull request #1308 from wasmerio/nlewycky/llvm-nan-cncl
Fix the new llvm-backend spectests failures.
2020-03-16 12:43:43 -07:00
Mark McCaskey
228c5baa53
Fix typo in wasitest build.rs
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2020-03-16 12:37:23 -07:00
Nick Lewycky
29b5223b3e Canonicalize NANs produced by f.trunc and f.nearby. 2020-03-16 11:36:17 -07:00
losfair
ae9b321365 Update changelog. 2020-03-16 23:41:44 +08:00
losfair
da07ed5011 Add clif/llvm NaN spectest failure excludes. 2020-03-16 23:40:28 +08:00
losfair
5d26d92d9b Add switch to turn on/off NaN canonicalization. 2020-03-16 23:40:02 +08:00
losfair
686fe4a1e1 Update changelog 2020-03-16 22:51:58 +08:00
losfair
0f663887ad Handle panics from DynamicFunc. 2020-03-16 22:49:37 +08:00
losfair
8ea7bfd563 NaN canonicalization by tracking values. 2020-03-16 00:43:19 +08:00
Syrus
5e2488c1ea Fixed lint 2020-03-14 15:38:16 -07:00
Syrus Akbary
77393c6ecc
Merge pull request #1301 from wasmerio/feature/use-rust-1.41.1
Update Rust version in CI to 1.41.1
2020-03-13 20:25:42 -07:00
Mark McCaskey
57d4a076cb Update Rust version in CI to 1.41.1 2020-03-13 16:32:40 -07:00
Mark McCaskey
6a5efcda98 Update wasi-tests to test multiple versions of WASI
This change also cleans up the `wasi-test` generation a bit.  It's
actually still really, really messy, but at least now it's split up
into easier to understand chunks.

There's still a lot of low-hanging fruit in terms of improving the
readibilty and maintainability of the code.
2020-03-13 15:41:50 -07:00
Syrus Akbary
c01afac783
Merge pull request #1298 from Hywan/doc-interface-types
doc(interface-types) Update the state of supported instructions
2020-03-12 09:00:53 -07:00
bors[bot]
f77df9b250
Merge #1285
1285: feat(interface-types) Greatly improve errors r=Hywan a=Hywan

~This PR is build on top of #1284. It must be merged first. [View the exact diff](https://github.com/Hywan/wasmer/compare/feat-interface-types-instructions-string-and-memory...Hywan:feat-interface-types-better-error?expand=1).~

Errors in `wasmer-interface-types` were just `&'static str`, which isn't quite great 😉. This PR introduces the `errors` module, with structures that represent errors. A `Display` implementation maps the errors to strings.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-03-12 13:58:22 +00:00
Ivan Enderlin
03910a51fb Merge branch 'master' into feat-interface-types-better-error 2020-03-12 14:52:15 +01:00
Ivan Enderlin
b78a6f47ab chore(interface-types) Simplify code. 2020-03-12 14:51:18 +01:00
Ivan Enderlin
f46099c67b feat(interface-types) Implement Error on errors. 2020-03-12 14:49:43 +01:00
Ivan Enderlin
64729aa8f4 feat(interface-types) Use include ranges to read the memory. 2020-03-12 14:39:15 +01:00
Ivan Enderlin
20085e84a6 doc(interface-types) Update the state of supported instructions. 2020-03-12 13:57:57 +01:00
bors[bot]
18168fc974
Merge #1283
1283: Workaround for floating point arguments and return values in `DynamicFunc`s. r=syrusakbary a=losfair

This PR makes floating point arguments and return values for `DynamicFunc`s work correctly in all three backends.

Previously Singlepass used integer registers for all arguments. This PR adds another thin trampoline layer just before control is transferred to the import function, so that arguments will be rearranged strictly according to the System V ABI.

The full fix would require singlepass to implement the SysV calling convention internally too: https://github.com/wasmerio/wasmer/pull/1271 . This is just a workaround.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-03-12 04:52:12 +00:00
Syrus Akbary
7617350851
Merge branch 'master' into fix/fpcc-workaround 2020-03-11 21:51:31 -07:00
bors[bot]
7b97b8abb7
Merge #1289
1289: Enable `DynamicFunc` for closures with captured environment. r=syrusakbary a=losfair

Previously we disabled `DynamicFunc` for any non-zero-sized closures to leave space for future changes. However this feature is critical for applications that needs to bring context with host functions, like integrations with dynamic lauguages. So it might be good to enable it.

A question left is: should we put this behind a feature flag or enable it by default?

@Hywan @syrusakbary 

Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-03-12 04:25:34 +00:00
Syrus Akbary
81f7411b60
Merge pull request #1295 from wasmerio/release/0.16.2
Prepare for 0.16.2 release
2020-03-11 19:16:39 -07:00
Mark McCaskey
fffdba395d Prepare for 0.16.2 release 2020-03-11 19:15:31 -07:00
Syrus Akbary
2234f790c3
Merge pull request #1294 from wasmerio/fix/wasmptr-len-0-is-okay
Allow zero length arrays and check base offset for being out of bounds
2020-03-11 19:12:58 -07:00
Mark McCaskey
c3865c919c Allow zero length arrays and check base offset for being out of bounds 2020-03-11 19:10:15 -07:00
Syrus Akbary
c99fdf6a85
Merge pull request #1291 from wasmerio/release/0.16.1
Prepare for 0.16.1 release
2020-03-11 17:02:58 -07:00
Syrus Akbary
418edef88f
Update CHANGELOG.md 2020-03-11 16:10:06 -07:00
Mark McCaskey
dc9cc3292c Prepare for 0.16.1 release 2020-03-11 16:00:21 -07:00
Syrus Akbary
a0d0263e86
Update azure-pipelines.yml 2020-03-11 15:57:26 -07:00
Syrus Akbary
65da0daf24
Merge pull request #1290 from wasmerio/fix/wax-packaging
Fix `wax` command packaging for install script
2020-03-11 15:56:20 -07:00
Mark McCaskey
9d6681006d Fix wax command packaging for install script 2020-03-11 15:54:45 -07:00
losfair
6c7f49a223 Put fat DynamicFuncs behind a feature flag. 2020-03-12 03:14:57 +08:00
Mark McCaskey
aaab59f69c Update deps in llvm and singlepass too 2020-03-11 12:00:36 -07:00
losfair
5edd1b5ab7 Enable DynamicFunc for closures with environment. 2020-03-12 02:58:36 +08:00
losfair
9930d54aaa Merge remote-tracking branch 'origin/fix/fpcc-workaround' into fix/fpcc-workaround 2020-03-12 02:53:19 +08:00
losfair
f93561dafc Add #1283 into changelog. 2020-03-12 02:52:48 +08:00
Mark McCaskey
ac3d9a37ae Update some dependencies manually, removing duplicate deps 2020-03-11 11:52:43 -07:00
losfair
fc9f1bc8b3 Merge remote-tracking branch 'origin/master' into fix/fpcc-workaround 2020-03-12 02:51:40 +08:00
losfair
adabfa02b0 Move feed_* into closures. 2020-03-12 02:51:22 +08:00
Syrus Akbary
68376116b8
Merge pull request #1287 from wasmerio/release/0.16.0
Prepare for 0.16.0 release
2020-03-11 11:17:08 -07:00
Mark McCaskey
d7d5f5b894 Prepare for 0.16.0 release 2020-03-11 11:15:07 -07:00
Syrus Akbary
603065fe5f
Merge pull request #1286 from wasmerio/wapm-wax
Updated Windows Wasmer icons. Add wax
2020-03-10 21:39:29 -07:00
Syrus
a4a90dfcd8 Fixed WAPM version 2020-03-10 21:38:17 -07:00
Syrus
f2c5f88b21 Added wax symlink 2020-03-10 18:24:10 -07:00
Syrus Akbary
cce134de50
Merge branch 'master' into wapm-wax 2020-03-10 10:53:18 -07:00
Syrus Akbary
a1cdeede40
Update CHANGELOG.md 2020-03-10 10:52:53 -07:00
Ivan Enderlin
4ffb158f14 doc(changelog) Add #1285. 2020-03-10 17:49:35 +01:00
Ivan Enderlin
7d6bc577b7 feat(interface-types) Reformat the instructions. 2020-03-10 17:49:35 +01:00
Ivan Enderlin
f0c97a1b81 feat(interface-types) Use better errors.
The new `errors` module contains structure to represent errors,
instead of using basic strings. The first usage is in the interpreter
itself.
2020-03-10 17:49:35 +01:00
Syrus Akbary
ea641495f8
Merge pull request #1284 from Hywan/feat-interface-types-instructions-string-and-memory
feat(interface-types) Implement string and memory instructions
2020-03-10 09:48:25 -07:00
Ivan Enderlin
58c3b3489a doc(changelog) Add #1284. 2020-03-10 16:00:05 +01:00
Ivan Enderlin
c1e40f165e fix: Revert a file that wasn't a commit candidate. 2020-03-10 15:58:27 +01:00
Ivan Enderlin
52312ff0ad feat(interface-types) Remove the 'input lifetime on Instruction. 2020-03-10 10:37:09 +01:00
Ivan Enderlin
717914f82b Merge branch 'master' into feat-interface-types-instructions-string-and-memory 2020-03-10 10:33:56 +01:00
Ivan Enderlin
e9de8f9999 feat(interface-types) write-utf8 is renamed string-to-memory. 2020-03-10 10:27:17 +01:00
Ivan Enderlin
1b0bda82dd feat(interface-types) Rename write-utf8 to string-to-memory. 2020-03-10 10:25:58 +01:00
Heyang Zhou
e521dfe8c1
Fix typo (2)
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-03-10 12:38:55 +08:00
Heyang Zhou
cfbcd886d0
Fix typo (1)
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-03-10 12:38:39 +08:00
losfair
3e63f1aaa9 Deprecate wasmer_trampoline_buffer_builder_add_callinfo_trampoline. 2020-03-10 12:37:40 +08:00
losfair
7d2d89b606 Resolve review comments. 2020-03-10 12:28:54 +08:00
losfair
7e2ede3960 Fix floating point return values. 2020-03-10 03:16:22 +08:00
losfair
fc114ac671 Merge remote-tracking branch 'Hywan/test-runtime-core-polymorphic-host-functions' into fix/fpcc-workaround 2020-03-10 02:47:00 +08:00
losfair
65962f0186 Add a translation layer before import call in singlepass. 2020-03-10 02:46:13 +08:00
losfair
79613e42d7 Prettier format panic message in spectest. 2020-03-10 02:45:31 +08:00
bors[bot]
674d18ed66
Merge #1281
1281: feat(interface-types) Rename `call` to `call-core`, and remove `call-export` r=syrusakbary a=Hywan

The latest standard removes `call-export` and has a single `call-core` instruction.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-03-09 18:03:28 +00:00
Syrus Akbary
50e5b78a6a
Merge pull request #1282 from Hywan/doc-interface-types-list-instructions
doc(interface-types) Improve the `README.md`
2020-03-09 10:41:16 -07:00
losfair
3ff3554345 Merge remote-tracking branch 'origin/master' into fix/fpcc-workaround 2020-03-10 01:29:15 +08:00
Ivan Enderlin
39d491e465 feat(interface-types) read-utf8 is renamed memory-to-string. 2020-03-09 15:06:35 +01:00
Ivan Enderlin
3cc4c6142c doc(interface-types) Improve the README.md. 2020-03-09 14:53:11 +01:00
Ivan Enderlin
637ff1e316 feat(interface-types) Rename call to call-core, and remove call-export. 2020-03-09 14:33:17 +01:00
bors[bot]
b292292267
Merge #1262
1262: Update to latest inkwell which adds context lifetime to basic blocks. r=nlewycky a=nlewycky

The latest inkwell adds lifetimes to basic blocks and also changes most APIs to pass them without reference.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2020-03-06 22:51:22 +00:00
Syrus
bd9aae1ed5 Updated Wasmer icons 2020-03-06 12:17:01 -08:00
Syrus
d1f79ae1e8 Fixed comments 2020-03-05 18:05:51 -08:00
Syrus
4b99a41e17 Added support for wapm wax 2020-03-05 17:22:16 -08:00
bors[bot]
4861e6ec5d
Merge #1272
1272: Fix WasmPtr to work with accesses accessing the final valid byte r=MarkMcCaskey a=MarkMcCaskey

Resolves #1258 

The fix was to change `>=` into `>`.  Doing this made us vulnerable to accessing memory to create an empty slice just out of bounds so we have to add some additional checks to make sure that that can't happen.

This PR also prevents accessing arrays of length 0 (the length bound is non-inclusive, so length 0 is never valid) and prevents access of zero-sized types.

The zero-sized type checks will probably be inlined (or will be in the future as `const fn` gets more mature) so provide no additional overhead.  The checking of if length == 0 does add some overhead, but on modern CPUs it shouldn't be an issue as it's a branch that should be always false in normal use.

# 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-05 23:46:37 +00:00
Mark McCaskey
8a8b3a43ac Add WasmPtr bug fix to changelog 2020-03-05 15:45:54 -08:00
Mark McCaskey
f8d34e0b57 Add WasmPtr access edge case test 2020-03-05 15:08:09 -08:00
Mark McCaskey
eb4c1bdace Prevent 0 length utf8 strings from WasmPtr too 2020-03-05 13:31:37 -08:00
Mark McCaskey
1c6424a754 Fix WasmPtr to work with accesses accessing the final valid byte
This also returns `None` for all accesses of zero sized types and
arrays of length 0.  Because the array accesses have a non-inclusive
length, length of 0 is not valid.  These checks prevent returning
empty slices that point just outside of memory bounds.
2020-03-05 13:23:50 -08:00
losfair
e62095da5d runtime-core: Move ArgumentRegisterAllocator into state. 2020-03-06 00:37:48 +08:00
losfair
a5de17fb18 runtime-core: Correctly allocate floating point registers for trampolines. 2020-03-05 22:49:58 +08:00
Ivan Enderlin
4d3e8ee117 test(runtime-core) Test polymorphic host functions with more types. 2020-03-05 14:17:04 +01:00
Syrus
548f8b19a2 Disable test-capi-singlepass 2020-03-04 14:19:19 -08:00
bors[bot]
5ab6e35672
Merge #1268
1268: Prepare for 0.15.0 release r=MarkMcCaskey a=MarkMcCaskey



# 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-04 20:47:25 +00:00
Mark McCaskey
c295adbaa8 Prepare for 0.15.0 release 2020-03-04 12:26:19 -08:00
bors[bot]
3b09d0ffac
Merge #1267
1267: Improve support for preopened directories in WASI syscalls r=MarkMcCaskey a=MarkMcCaskey

Ported over from #1263 

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# 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-04 19:54:05 +00:00
Mark McCaskey
69fd76af10 Improve support for preopened directories in WASI syscalls
Also filters our default logging more and improves some debug statements
2020-03-04 11:51:24 -08:00
bors[bot]
b2e6535aa0
Merge #1264
1264: feat(interface-types) Implement lifting and lowering instructions r=Hywan a=Hywan

For the moment, WIT defines [a bunch of lifting and lowering instructions](https://github.com/WebAssembly/interface-types/blob/master/proposals/interface-types/working-notes/instr.md). The encoders, the decoders and the AST support them, but we didn't have any instruction implementations for them. This PR implements the instructions for real.

To handle casting failure, I decided to use the `TryFrom` trait, instead of `as`, such as:

```rust
let x: i32 = 128;
let y: i8 = x.try_into().unwrap(); // fails
```

while:

```rust
let x: i32 = 128;
let y: i8 = x as _; // just overflows silently
```

Not all `*x` instructions aren't implement _yet_.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-03-04 13:43:33 +00:00
bors[bot]
973154cf33
Merge #1265
1265: Improve `WasmPtr` documentation r=MarkMcCaskey a=MarkMcCaskey

This came up multiple times when responding to people on our issue tracker.

Adds an example and a lot more information about `WasmPtr` and `ValueType`


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-03-04 01:05:31 +00:00
Mark McCaskey
4a6c96382d Update wording of doc comment from feedback 2020-03-03 17:04:52 -08:00
Mark McCaskey
469e43312a Improve WasmPtr documentation 2020-03-03 16:16:29 -08:00
bors[bot]
22d2031943
Merge #1217
1217: Polymorphic host functions based on dynamic trampoline generation. r=losfair a=losfair

This PR implements polymorphic host functions by dynamically generating the "glue" code that translates platform arguments to an array in `runtime-core`.

TODO:

- ~~Multiple return values.~~ Deferring to a future multivalue PR.
- [x] Dynamic signatures for polymorphic functions.
- [x] Use a proper executable memory allocator.

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2020-03-03 18:00:42 +00:00
losfair
f499dea0a7 Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-03-04 01:56:52 +08:00
losfair
d9e744d9dc Resolve review comments. 2020-03-04 01:56:48 +08:00
Ivan Enderlin
de53659ee7 feat(interface-types) Implement s64-to-i32x and u64-to-i32x
Actually, `s64-to-i32` and `u64-to-i32` already error when overflow
happens.
2020-03-03 17:17:26 +01:00
Ivan Enderlin
c157bdaf63 test(interface-types) Test when lowering or lifting fails because of the value. 2020-03-03 17:10:10 +01:00
Ivan Enderlin
6576dfd64b test(interface-types) Add test cases for errors. 2020-03-03 17:04:26 +01:00
Ivan Enderlin
30e72eb796 feat(interface-types) Implement lifting and lowering instructions. 2020-03-03 16:57:05 +01:00
MikaelUrankar
da04dab436 Add FreeBSD specific failure excludes. 2020-03-03 12:13:56 +01:00
Nick Lewycky
3e0d299227 Update to latest inkwell which adds context lifetime to basic blocks. 2020-03-02 14:25:30 -08:00
bors[bot]
115a6573a9
Merge #1261
1261: Fix our side of wasmparser typo. r=MarkMcCaskey a=nlewycky

This is a `cargo update` plus change to fix for ac6df05378 .


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2020-03-02 21:53:13 +00:00
bors[bot]
d2b546fef5
Merge #1260
1260: Recognize FreeBSD r=syrusakbary a=MikaelUrankar



Co-authored-by: MikaelUrankar <mikael.urankar@gmail.com>
2020-03-02 19:27:56 +00:00
Nick Lewycky
d5581331a2 Fix our side of wasmparser typo. 2020-03-02 11:16:21 -08:00
Syrus Akbary
e207c7f17d
Update LICENSE 2020-03-02 11:08:21 -08:00
MikaelUrankar
48fcc8af09 Recognize FreeBSD 2020-03-02 15:41:41 +01:00
Syrus Akbary
51084ec8fb
Update README.md 2020-02-29 09:47:00 -08:00
Syrus Akbary
5d55c69441
Update README.md 2020-02-29 09:41:31 -08:00
Syrus Akbary
2fe2bb9070
Update README.md 2020-02-29 09:39:53 -08:00
Syrus Akbary
b7231775bc
Update README.md 2020-02-29 09:36:41 -08:00
Syrus Akbary
527ac41415
Small improvements to README 2020-02-29 09:35:45 -08:00
Syrus Akbary
d647ac3023
Merge pull request #1252 from wasmerio/wasi-mapdir
Allow / in mapdir wasm path
2020-02-29 09:17:00 -08:00
Syrus
f8b206d438 Added changes into changelog 2020-02-29 08:49:38 -08:00
Syrus
7a88a320c7 Allow / in mapdir wasm path 2020-02-29 08:47:25 -08:00
Syrus
3f456db4ad Updated headers 2020-02-29 08:45:48 -08:00
Syrus
4c19cd65e8 Add capi in ARM 2020-02-29 08:45:24 -08:00
losfair
d443ad8d40 Remove outdated comment. 2020-02-29 11:15:09 +08:00
losfair
4012645aee Fix CodeMemory doc comments. 2020-02-29 11:13:34 +08:00
losfair
84179dbd5e Fix changelog. 2020-02-29 11:12:26 +08:00
Syrus
80f7e98651 Moved build wapm into Makefile 2020-02-28 11:11:31 -08:00
bors[bot]
85a3bb7148
Merge #1244
1244: feat(interface-types) Update to last standard version r=MarkMcCaskey a=Hywan

WIP

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-28 18:35:28 +00:00
losfair
2ddf9ad4c8 Disallow "fat" closures. 2020-02-28 22:16:29 +08:00
losfair
6516243e8a Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-28 11:54:13 +08:00
losfair
31a72e59fb Rename ErasedFunc to DynamicFunc and fix leaky PolymorphicContext. 2020-02-28 11:41:36 +08:00
bors[bot]
a13a897495
Merge #1212
1212: Add support for GDB JIT debugging r=MarkMcCaskey a=MarkMcCaskey

This PR adds support for JIT debugging to Wasmer with the Cranelift backend using a fork of `wasmtime-debug`.

The motivation for this change is partially inspired by the feature in Wasmtime and the implementation is largely derived from Wasmtime's `wasmtime-debug` crate and not included in this PR.  This implementation is currently Cranelift-only (if LLVM has value tracking we can add this there too without too much effort; we'd have to do the value tracking ourselves in Singlepass and I don't have enough context to know how hard that would be) and is based on a generic fork of the `wasmtime-debug` -- which will be published and uploaded in another repo.

This PR started out implementing the [Wasm-DWARF](https://yurydelendik.github.io/webassembly-dwarf/) reading and writing with gimli but after working on it for a few days, reading a chunk of the DWARF spec, seeing that Wasmtime had solved this well, and realizing how long this would likely take, I decided that it didn't make sense to spend the engineering effort there so I made a copy of `wasmtime-debug` and removed some of the less portable Cranelift pieces (very minor changes) and all code relying on data structures from wasmtime.  The resulting crate is completely generic and would work fine with Wasmtime or any other Wasm runtime at the cost of requiring some `transmute`s or a linear pass over the debug data to reconstruct it in terms of the new types exposed by the fork.  Perhaps there's a cleaner way to handle that that I haven't considered.

The integration with the GDB JIT interface is from the LLVM examples (I don't remember if I properly attributed everything in this PR/version of the code -- I still have the other branches locally though which I'll review before shipping this) and some of the code in this PR is from Wasmtime/Cranelift source code such as the sorting of the `ebb`s in `clif_backend::resolver`.  I spent a long time debugging some subtle bugs and ended up using a few things from Wasmtime's integration with `wasmtime-debug` and some bits from `cranelift-wasm` and `cranelift-codegen`.

If there's interest from other people in working on the generic `wasmtime-debug` fork, I'm happy to get other maintainers involved and/or move it to a shared organization.

Special thanks to [Yury Delendik](https://github.com/yurydelendik) and the other `wasmtime-debug` authors for their work on Wasm debugging.  Also shout out to Cranelift for the nice API for tracking variables/data.

### TODO:
- [x] Update attributions file for LLVM, [wasm-dwarf](https://github.com/yurydelendik/wasm-dwarf), and Wasmtime/Cranelift and do another pass over code to make sure we're in compliance with the licenses from the relevant projects and have properly attributed the code used from other projects.
- [x] Adjust API of wasm-debug based on feedback
- [x] Discuss with Nick integration with LLVM
- [x] Discuss with Heyang integration with Singlepass
- [x] Adjust implementation based on feedback from team (traits modified, etc.)
- [x] Clean up some pointer wrangling code
- [x] Add opt-in feature to wasmer-runtime-core to enale wasm-debug so library users who won't use debug info are not affected

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-27 22:23:22 +00:00
Mark McCaskey
91808b9df2 Update test-rest to explicitly test each crate 2020-02-27 14:22:26 -08:00
losfair
32915f0077 Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-27 23:49:10 +08:00
Mark McCaskey
0593965459 Make gdb jit symbol weak linking default in llvm-backend features 2020-02-26 19:41:53 -08:00
Mark McCaskey
b5cbb9df60 Fix test and build for musl 2020-02-26 19:07:30 -08:00
Mark McCaskey
dbb2ececf8 Work around unstable linkage attribute 2020-02-26 18:32:40 -08:00
Mark McCaskey
a089cf5a0c Link GDB JIT exposed global and fn as "linkonce"
This is required because LLVM exposes its own
2020-02-26 18:05:24 -08:00
Mark McCaskey
3691c80b7d Add generate_debug_info field to test 2020-02-26 17:29:18 -08:00
Mark McCaskey
0c8464e3bc Update changelog entry for gdb jit PR 2020-02-26 16:59:10 -08:00
Mark McCaskey
56e47c17b0 Revert Wasm parsing to improved old style, fixing singlepass 2020-02-26 16:35:25 -08:00
Mark McCaskey
cb20cd9b2d Merge branch 'master' into feature/debug-prototype2 2020-02-26 14:39:02 -08:00
Syrus Akbary
73370b9de9
Merge pull request #1250 from wasmerio/feature/update-wasmparser
Update wasmparser to 0.51.3 and clif forks to 0.59
2020-02-26 14:05:27 -08:00
Mark McCaskey
a8b4f2a1e4 Update clif option string, fix table parsing to match AnyFunc 2020-02-26 13:25:41 -08:00
Mark McCaskey
0a92d9c65e Update LLVM backend to wasmparser 0.51.3 2020-02-26 13:07:31 -08:00
Mark McCaskey
21fd95d760 Update wasmparser to 0.51.3 and clif forks to 0.59 2020-02-26 12:51:56 -08:00
Ivan Enderlin
c0933c52ca feat(interface-types) Fix clippy errors and warnings. 2020-02-26 17:02:52 +01:00
losfair
72e6a85ea5 Update changelog. 2020-02-26 23:42:48 +08:00
Ivan Enderlin
bff63e3fad Merge branch 'master' into feat-interface-types-update-to-last-standard-version 2020-02-26 16:22:56 +01:00
Ivan Enderlin
4e82d59ea1 feat(interface-types) Implement lifting and lowering instructions.
List from https://github.com/WebAssembly/interface-types/blob/master/proposals/interface-types/working-notes/instr.md.
2020-02-26 16:20:39 +01:00
Ivan Enderlin
f951b6aa53 feat(interface-types) Remove abandonned instructions. 2020-02-26 15:48:00 +01:00
Ivan Enderlin
350a30507f fix(interface-types) arg.get's index is of type u32. 2020-02-26 15:42:29 +01:00
Ivan Enderlin
3653c42e23 test(interface-types) Test adapter to binary. 2020-02-26 15:38:59 +01:00
Ivan Enderlin
4b7cd3a875 doc(interface-types) Fix a typo. 2020-02-26 15:34:04 +01:00
Ivan Enderlin
45283d4f52 test(interface-types) Fix all tests based on previous commits. 2020-02-26 15:32:14 +01:00
losfair
eb89720d5a Merge remote-tracking branch 'origin/feature/polymorphic-v2' into feature/polymorphic-v2 2020-02-26 17:09:10 +08:00
losfair
b0877b26e5 Add safety notice for TrampolineBufferBuilder::remove_global. 2020-02-26 17:07:56 +08:00
Heyang Zhou
a438a644b6
fold() -> sum()
Co-Authored-By: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-26 17:01:36 +08:00
Heyang Zhou
292e42addc
Update lib/runtime-core/src/typed_func.rs
Co-Authored-By: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-26 17:01:16 +08:00
losfair
262d431b49 Remove unneeded allow(dead_code). 2020-02-26 16:59:31 +08:00
losfair
a0ea1af71f Remove pub(self). 2020-02-26 16:54:33 +08:00
losfair
96d9e39913 Specify imports instead of using a *. 2020-02-26 13:40:02 +08:00
Mark McCaskey
52d4dac450 Rename feed_event's loc to source_loc 2020-02-25 17:15:17 -08:00
Mark McCaskey
6f5ebb564c Allow building clif-backend without wasm-debug 2020-02-25 17:08:09 -08:00
losfair
40d823e298 Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-26 01:45:18 +08:00
losfair
80f824e708 Auto-release trampolines. 2020-02-26 01:45:11 +08:00
losfair
b7c9c1843a Add dynamic executable memory allocation & tests to trampolines. 2020-02-26 01:44:50 +08:00
bors[bot]
6059c04630
Merge #1220
1220: chore(deps): bump smallvec from 0.6.13 to 1.2.0 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.2.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/servo/rust-smallvec/releases">smallvec's releases</a>.</em></p>
<blockquote>
<h2>v1.2.0</h2>
<ul>
<li><code>IntoIter</code> now implements <code>Debug</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/196">#196</a>).</li>
<li><code>smallvec!</code> macro is now easier to use in <code>no_std</code> contexts where the <code>vec!</code> macro isn't automatically imported (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/198">#198</a>).</li>
</ul>
<h2>v1.1.0</h2>
<ul>
<li>Added new method <code>SmallVec::into_boxed_slice</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/190">#190</a>).</li>
<li>Added new methods <code>IntoIter::as_slice</code> and <code>as_mut_slice</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/182">#182</a>).</li>
<li><code>IntoIter</code> now implements <code>Clone</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/192">#192</a>).</li>
<li>Improved documentation and testing (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/186">#186</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/189">#189</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/193">#193</a>).</li>
<li>Minor code cleanups (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/176">#176</a>).</li>
</ul>
<h2>v1.0.0</h2>
<ul>
<li>Requires Rust 1.36 or later.</li>
<li>[breaking change] Use <code>MaybeUninit</code> to avoid possible undefined behavior (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/162">#162</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/170">#170</a>).</li>
<li>[breaking change] The <code>drain</code> method now takes a range argument, just like the standard <code>Vec::drain</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/145">#145</a>).</li>
<li>[breaking change] Remove the <code>unreachable</code> function and replace it with the new standard <code>unreachable_unchecked</code> function (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/164">#164</a>).</li>
<li>[breaking change] Use <code>no_std</code> by default. This crate depends only on <code>core</code> and <code>alloc</code> by default. If the optional <code>write</code> feature is enabled then it depends on <code>std</code> so that <code>SmallVec&lt;[u8;_]&gt;</code> can implement the <code>std::io::Write</code> trait (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/173">#173</a>).</li>
<li>[breaking change] Remove the deprecated <code>VecLike</code> trait (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/165">#165</a>).</li>
<li>Add support for 96-element small vectors, <code>SmallVec&lt;[T; 96]&gt;</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/163">#163</a>).</li>
<li>Iterators now implement <code>FusedIterator</code> (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/172">#172</a>).</li>
<li>Indexing now uses the standard <code>SliceIndex</code> trait (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/166">#166</a>).</li>
<li>Add automatic fuzz testing and MIRI testing (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/168">#168</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/162">#162</a>).</li>
<li>Update syntax and formatting to Rust 2018 standard (<a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/174">#174</a>, <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/167">#167</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="08b82495c0"><code>08b8249</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/199">#199</a> - mbrubeck:bump, r=emilio</li>
<li><a href="04d54bd9ca"><code>04d54bd</code></a> Version 1.2.0</li>
<li><a href="ea0dbc89c5"><code>ea0dbc8</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/198">#198</a> - mbrubeck:macro, r=jdm</li>
<li><a href="74e9319b47"><code>74e9319</code></a> Use full path to vec! in smallvec! macro</li>
<li><a href="6e61239a2a"><code>6e61239</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/196">#196</a> - Nemo157:intoiter-debug, r=mbrubeck</li>
<li><a href="a4ed1b854f"><code>a4ed1b8</code></a> impl Debug for IntoIter</li>
<li><a href="34d7b8d8e2"><code>34d7b8d</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/193">#193</a> - mbrubeck:bump, r=emilio</li>
<li><a href="436dedbd50"><code>436dedb</code></a> Version 1.1.0</li>
<li><a href="19048d5270"><code>19048d5</code></a> Add a simple example to the README</li>
<li><a href="941d6aae0f"><code>941d6aa</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/servo/rust-smallvec/issues/192">#192</a> - L0uisc:clone-into-iter, r=mbrubeck</li>
<li>Additional commits viewable in <a href="https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.2.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=smallvec&package-manager=cargo&previous-version=0.6.13&new-version=1.2.0)](https://dependabot.com/compatibility-score/?dependency-name=smallvec&package-manager=cargo&previous-version=0.6.13&new-version=1.2.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-02-24 21:53:50 +00:00
dependabot-preview[bot]
1bc6565935
chore(deps): bump smallvec from 0.6.13 to 1.2.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.2.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-24 21:45:50 +00:00
bors[bot]
c183a187ca
Merge #1246
1246: Prepare for 0.14.1 release r=MarkMcCaskey a=MarkMcCaskey

0.14.1 differs from 0.14.0 primarily in that the GNU/Linux build is
built on Ubuntu 16.04 instead of 18.04, meaning we'll use an earlier
version of GLIBC.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-24 21:21:21 +00:00
Mark McCaskey
ce21910077 Prepare for 0.14.1 release
0.14.1 differs from 0.14.0 primarily in that the GNU/Linux build is
built on Ubuntu 16.04 instead of 18.04, meaning we'll use an earlier
version of GLIBC.
2020-02-24 13:20:12 -08:00
bors[bot]
077d81f2bb
Merge #1245
1245: Revert change of Ubuntu 18.04 to 16.04 r=MarkMcCaskey a=MarkMcCaskey

I didn't document why I changed it to 18.04 in #1163 ; making this PR to run CI and find out why.

It looks like CI is passing!  I have no idea why I updated to 18.04.  Perhaps I misread [the support table](https://wiki.ubuntu.com/Releases) and thought 16.04 no longer had standard support.

Either way, this PR seems good to merge.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-24 19:37:47 +00:00
Mark McCaskey
f3d4b56746 Revert change of Ubuntu 18.04 to 16.04 2020-02-24 11:05:09 -08:00
losfair
b67acbc0e3 Add ErasedFunc for type-erased functions. 2020-02-25 01:19:19 +08:00
Ivan Enderlin
0c5d46eec9 feat(interface-types) Re-implement interface kinds.
Adopt a flat structure: Flat resolved imports, flat resolved exports,
flat resolved types etc.

Also, use the latest textual format for adapters & co.
2020-02-24 18:12:01 +01:00
losfair
2020901d75 Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-25 00:56:46 +08:00
Heyang Zhou
644755faec
Merge pull request #1225 from Hywan/feature/polymorphic-v2.1
feat(runtime-core) Allow dynamic signature for polymorphic host functions
2020-02-25 00:55:28 +08:00
Ivan Enderlin
c64febdad6 feat(interface-types) Re-implement Type.
The semantics of “types” have changed since the previous draft. Now, a
type is like a regular WebAssembly type but with Interface Types.
2020-02-24 16:23:31 +01:00
Ivan Enderlin
d1ed647efc feat(interface-types) Forwarded adapters have been removed. 2020-02-24 15:56:11 +01:00
Ivan Enderlin
8538e3be33 feat(interface-types) The “helper adapter” has been removed. 2020-02-24 15:49:03 +01:00
Ivan Enderlin
ac68325cc9 feat(interface-types) Update interface types.
According to the last working notes, new interface types are s8, s16,
s32, s64, u8, u16, u32, u64, f32, f64, string, anyref, i32, and i64.

Their binary reprensentations are changing too, from 0x00 to 0x0d.
2020-02-24 15:37:03 +01:00
Syrus Akbary
ad04e07c67
Merge pull request #1243 from wasmerio/dependabot/cargo/hex-0.4.2
Bump hex from 0.4.1 to 0.4.2
2020-02-24 00:33:32 -08:00
Syrus Akbary
30dc9a18ba
Merge pull request #1242 from wasmerio/dependabot/cargo/libc-0.2.67
Bump libc from 0.2.66 to 0.2.67
2020-02-24 00:33:00 -08:00
dependabot-preview[bot]
eaeb17e2c9
Bump hex from 0.4.1 to 0.4.2
Bumps [hex](https://github.com/KokaKiwi/rust-hex) from 0.4.1 to 0.4.2.
- [Release notes](https://github.com/KokaKiwi/rust-hex/releases)
- [Commits](https://github.com/KokaKiwi/rust-hex/compare/v0.4.1...v0.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-24 08:06:51 +00:00
dependabot-preview[bot]
a145a75758
Bump libc from 0.2.66 to 0.2.67
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.66 to 0.2.67.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.66...0.2.67)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-24 08:06:17 +00:00
bors[bot]
9b7cc5f901
Merge #1241
1241: Remove signatures_raw r=syrusakbary a=nlewycky

# Description
I previously added a new field to LLVMModuleCodeGenerator which wasn't necessary. The data is available in ModuleInfo which in turn is available everywhere we need it. Remove the dead field, use ModuleInfo instead.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-02-21 23:57:36 +00:00
Syrus Akbary
a739b583c7
Merge branch 'master' into nlewycky/remove-signatures-raw 2020-02-21 15:57:15 -08:00
Mark McCaskey
d7fca539c1 Make JitCodeDebugInfoEntryHandleInner Send and Sync 2020-02-21 15:10:58 -08:00
Mark McCaskey
40e4dddc4b Add updates from feedback
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-21 14:33:32 -08:00
Nick Lewycky
a56660bfe9 Remove LLVMModuleCodeGenerator::signatures_raw which is a clone of a mapping available in ModuleInfo. 2020-02-21 13:31:49 -08:00
Syrus Akbary
409ddc440e
Merge pull request #1240 from wasmerio/nlewycky-patch-1
Fix typo in comment.
2020-02-21 11:49:52 -08:00
nlewycky
3b1a1227c7
Fix typo in comment.
Noticed while inspecting the generated wasmer.h.
2020-02-21 11:49:18 -08:00
Nick Lewycky
642e6c3db1 Fix typo in comment. 2020-02-21 11:44:31 -08:00
Syrus Akbary
f632b8179c
Merge pull request #1234 from wasmerio/feature/spectest-check-excluded
Check for unused excluded spectest failures.
2020-02-21 11:10:28 -08:00
losfair
f717d4c779 Merge remote-tracking branch 'origin/master' into feature/spectest-check-excluded 2020-02-22 01:26:10 +08:00
losfair
f2084982d4 Make excludes more specialized. 2020-02-22 01:25:14 +08:00
Syrus Akbary
210eeae018
Merge pull request #1238 from Hywan/doc-readme-logo
doc(readme) Fix logo
2020-02-21 08:12:55 -08:00
Ivan Enderlin
6b667805d7
Merge branch 'master' into doc-readme-logo 2020-02-21 13:41:35 +01:00
Ivan Enderlin
1e52d4b9b2 doc(readme) Fix logo. 2020-02-21 13:39:43 +01:00
bors[bot]
a96c436afc
Merge #1232
1232: feat(interface-types) Implement the WAT decoder r=Hywan a=Hywan

WIP

The goal is the define a minimal WAT to AST decoder for WIT, so that it's muuuuuuch easier to develop and debug.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-21 11:38:50 +00:00
Ivan Enderlin
4b0a1ef6d6 doc(changelog) Add #1232. 2020-02-21 12:38:16 +01:00
Ivan Enderlin
4acd4becaf chore(cargo) Update Cargo.lock. 2020-02-21 12:25:27 +01:00
Ivan Enderlin
48f8823879 Merge branch 'master' into feat-interface-types-decoders-wat 2020-02-21 12:24:52 +01:00
Ivan Enderlin
80d0b5116f doc(interface-types) Add intra links. 2020-02-21 12:23:58 +01:00
Ivan Enderlin
0afd308c44 feat(interface-types) Add the parse public API.
Also rename `kw` to `keyword`.
2020-02-21 12:23:20 +01:00
Mark McCaskey
3d6e915108
Merge branch 'master' into feature/debug-prototype2 2020-02-20 17:48:02 -08:00
Mark McCaskey
7c5f8251e3 Flatten tuple in return type, conditionally remove more jit debug code 2020-02-20 16:59:59 -08:00
Syrus Akbary
5455616463
Update README.md 2020-02-20 15:31:19 -08:00
Syrus Akbary
903d2f7344
Update README.md 2020-02-20 15:26:30 -08:00
Syrus Akbary
a0878ab4f1
Merge pull request #1236 from wasmerio/feature/clean-codebase
Cleanup codebase structure
2020-02-20 15:18:08 -08:00
Syrus
22f8b41667 Improved Homebrew message 2020-02-20 15:11:52 -08:00
Syrus
25eb86afe3 Remove make wapm from Makefile 2020-02-20 15:10:57 -08:00
Syrus
51f906a25a Fixed docs links 2020-02-20 15:08:26 -08:00
Syrus
1901c5088c Deleted unused dockerignore 2020-02-20 15:05:43 -08:00
Syrus Akbary
f078d7d3f4
Update README.md 2020-02-20 14:50:33 -08:00
Syrus Akbary
2842baca82
Update README.md 2020-02-20 14:49:55 -08:00
Syrus
f229dd7aa5 Cleanup the codebase 2020-02-20 14:48:10 -08:00
Syrus Akbary
805bd40ee2
Merge pull request #1235 from wasmerio/release/0.14.0
Prepare for 0.14.0 release
2020-02-20 13:17:33 -08:00
Mark McCaskey
1374bf0806 Prepare for 0.14.0 release 2020-02-20 13:15:29 -08:00
Mark McCaskey
0ec08b5bbd Add updates from feedback 2020-02-20 13:06:50 -08:00
bors[bot]
49ab1a1bba
Merge #1233
1233: Improved Wasmer C API release artifacts r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->


# Description

This PR updates the artifacts generated for Wasmer C API, in a way that is much more consumable, including a quick README and License.

So, after running `make capi && make build-capi` We will have a `wasmer-c-api.tar.gz` file with the following structure
```
/
  lib/
    libwasmer.a
    libwasmer.so
  include/
    wasmer.h
    wasmer.hh
  README.md
  LICENSE
```

See example generated artifact here: 
[wasmer-c-api.tar.gz](https://github.com/wasmerio/wasmer/files/4228560/wasmer-c-api.tar.gz)

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-02-20 20:47:23 +00:00
Syrus
69d88ced53 Make commands more clear 2020-02-20 11:59:44 -08:00
Syrus
38830ed8e5 Fixed unused cd 2020-02-20 11:56:47 -08:00
losfair
02047875c6 Update changelog. 2020-02-21 03:47:26 +08:00
losfair
3fa62461e6 Specify excludes separately for linux/macos singlepass. 2020-02-21 03:47:17 +08:00
losfair
456d2dc2a8 Match against both target OS and family. 2020-02-21 03:47:01 +08:00
Syrus
c8df4fb5da Removed empty lines 2020-02-20 11:25:46 -08:00
Syrus
aa0f33203c Reuse doc file for capi docs 2020-02-20 11:24:54 -08:00
losfair
c1f1a82854 Check for unused excludes. 2020-02-21 03:23:44 +08:00
Mark McCaskey
65a9e04f3c Add updates from feedback
Co-authored-by: Nick Lewycky <nick@wasmer.io>
2020-02-20 11:20:40 -08:00
Ivan Enderlin
2ef13cdc81 fix(interface-types) Remove #[allow(unused)]. 2020-02-20 15:16:35 +01:00
Ivan Enderlin
5e00153d29 feat(interface-types) Decode instructions in WIT's text format. 2020-02-20 15:13:11 +01:00
Ivan Enderlin
cda53a57b5 feat(interface-types) Replace nom by wast for decoding WIT's text format. 2020-02-20 14:43:58 +01:00
Syrus
1d9741b856 Fixed make capi script in windows 2020-02-19 23:14:10 -08:00
Syrus
f0abcb0a7a Fixing C api creation only for Linux 2020-02-19 21:49:47 -08:00
Syrus
b31d8d73d8 Fixed windows library 2020-02-19 21:39:47 -08:00
Syrus Akbary
8933f3208e
Merge branch 'master' into feature/release-capi 2020-02-19 19:03:57 -08:00
Syrus
6d0efd274a Updated changelog 2020-02-19 19:03:22 -08:00
Syrus
edeabd419b Add links for API Docs 2020-02-19 18:58:22 -08:00
Syrus
0b5064694f Ignore the capi folder 2020-02-19 18:55:18 -08:00
Syrus
40fb54c58f Improved Wasmer C API artifacts 2020-02-19 18:54:32 -08:00
Syrus
d93d878aa4 Fixed runtime doc links 2020-02-19 18:53:10 -08:00
Mark McCaskey
3bca20d3d3 Add changelog entry, clean up 2020-02-19 16:37:43 -08:00
Mark McCaskey
64cc59179a
Merge branch 'master' into feature/debug-prototype2 2020-02-19 16:13:35 -08:00
Mark McCaskey
a2e531bda4 Update to use published wasm-debug; make dep optional in clif-backend 2020-02-19 15:53:36 -08:00
Mark McCaskey
68af917d4c Update field names in wasm-debug types 2020-02-19 15:46:43 -08:00
Ivan Enderlin
00e36508d6 feat(interface-types) Parse Adapter in the WAT decoders. 2020-02-19 17:41:06 +01:00
Ivan Enderlin
2e78cf1fc0 feat(interface-types) Parse Import in the WAT decoders. 2020-02-19 17:20:18 +01:00
Ivan Enderlin
c97122899d feat(interface-types) Start implementing the WAT decoder. 2020-02-19 16:12:06 +01:00
Mark McCaskey
1ac59a31f6 Add various small improvements, update attributions file 2020-02-18 17:31:12 -08:00
Mark McCaskey
3653a448f5 Clean up code, add documentation, implement pieces properly 2020-02-18 16:51:02 -08:00
bors[bot]
3d4d6eb366
Merge #1223
1223: feat(runtime-core) Implement `TryFrom<native_type>` for `Value` r=Hywan a=Hywan

Extracted from #1018.

This PR implements `TryFrom` for `Value`. It is required to support dynamically-typed values for polymorphic host functions.

This PR also refactors the code by using a macro (`value_conversions!`) to implement `From` and `TryFrom` in one shot.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-18 09:14:40 +00:00
Ivan Enderlin
e9333c5790
Merge branch 'master' into feat-runtime-core-value-try-from 2020-02-18 10:01:03 +01:00
bors[bot]
a16a220cc0
Merge #1216
1216: feat(interface-types) Add the binary encoder r=Hywan a=Hywan

This PR adds the `encoders::binary` module, which exposes the `ToBytes` trait. It is used to encode the AST into the WIT binary representation.

Check the tests to get examples, but quickly, the roundtrip works:

```rust
fn test_binary_encoding_decoding_roundtrip() {
    // Let `original_ast` be an AST representing a set of WIT interfaces
    let original_ast = Interfaces {
        exports: vec![Export {
            name: "ab",
            input_types: vec![InterfaceType::I32],
            output_types: vec![InterfaceType::I32],
        }],
        types: vec![Type::new(
            "ab",
            vec!["cd", "e"],
            vec![InterfaceType::I32, InterfaceType::I32],
        )],
        imports: vec![Import {
            namespace: "a",
            name: "b",
            input_types: vec![InterfaceType::I32],
            output_types: vec![InterfaceType::I64],
        }],
        adapters: vec![Adapter::Import {
            namespace: "a",
            name: "b",
            input_types: vec![InterfaceType::I32],
            output_types: vec![InterfaceType::I32],
            instructions: vec![Instruction::ArgumentGet { index: 1 }],
        }],
        forwards: vec![Forward { name: "a" }],
    };

    // Let's encode the AST into the WIT binary representation.
    let mut binary = vec![];

    original_ast
        .to_bytes(&mut binary)
        .expect("Failed to encode the AST.");

    // And let's go back to the AST land.
    let (remainder, ast) = parse::<()>(binary.as_slice()).expect("Failed to decode the AST.");

    assert!(remainder.is_empty());

    // They must equal.
    assert_eq!(original_ast, ast);
}
```

The implementation with the `ToBytes` trait and the `io::Write` trait is —I hope— Rust idiomatic. I reckon the code is easy to read and understand.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-18 08:57:57 +00:00
Ivan Enderlin
cc93f3197b
Merge branch 'master' into feat-interface-types-encoders-binary 2020-02-18 09:57:29 +01:00
bors[bot]
8c17455456
Merge #1229
1229: Add clippy::missing_safety_doc lint to wasi, misc clean up r=MarkMcCaskey a=MarkMcCaskey

Part of #1219 

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-18 00:32:44 +00:00
Syrus Akbary
5bf6be445a
Delete index.html 2020-02-17 16:09:37 -08:00
Mark McCaskey
c005f94a55 Add clippy::missing_safety_doc lint to wasi, misc clean up 2020-02-17 15:15:04 -08:00
bors[bot]
bcb1f0421c
Merge #1226
1226: chore(runtime-core) Some code clean ups r=syrusakbary a=Hywan

Extracted from #1018. Opinionated patch.

Some code clean ups, mostly renaming `ExternalFunction` to `HostFunction`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-02-17 21:00:54 +00:00
Syrus Akbary
abd44e9fba
Merge branch 'master' into feat-runtime-core-cleanup-typed-func 2020-02-17 13:00:13 -08:00
bors[bot]
7cf383032f
Merge #1222
1222: feat(runtime-core) Simplify `WasmExternType` implementations with macros r=Hywan a=Hywan

Extracted from #1018.

This PR simplifies the code (understand, remove code duplication) of `WasmExternType` by using a macro.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-17 19:57:47 +00:00
Ivan Enderlin
8d31f0b7e9
Merge branch 'master' into feat-runtime-core-wasm-extern-type-macros 2020-02-17 20:57:27 +01:00
bors[bot]
adc651def6
Merge #1224
1224: fix(runtime-core) Remove warnings r=Hywan a=Hywan

Because we can use the `impl_traits!` macro with only one identifier,
a warning is emitted saying the parenthesis are useless for this
specific usecase. They are required for all the other usecases
though. We can safely ignore this warning.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-02-17 19:34:57 +00:00
Ivan Enderlin
7f0e220f70
Merge branch 'master' into fix-runtime-core-warnings 2020-02-17 20:34:05 +01:00
Ivan Enderlin
8d8a5f6d5a
Merge branch 'master' into feat-runtime-core-cleanup-typed-func 2020-02-17 20:33:35 +01:00
bors[bot]
1158951d5c
Merge #1221
1221: doc(interface-types) Add a `README.md` file r=MarkMcCaskey a=Hywan

Just a small `README.md`, so that users aren't totally loss.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-17 19:15:58 +00:00
bors[bot]
5832b48159
Merge #1228
1228: Singlepass cleanup: Resolve several FIXMEs and remove protect_unix. r=losfair a=losfair



Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-02-17 18:57:30 +00:00
losfair
b1e2a7fb4d Update changelog. 2020-02-18 02:38:33 +08:00
losfair
ed826cb389 Cleanup various FIXMEs and remove protect_unix. 2020-02-18 02:35:19 +08:00
Ivan Enderlin
9013d52ea4 doc(runtime-core) Hide some traits and structs in the documentation.
Those are not necessary for the user. It's only internal
implementation, that must be public because it ends up in public
types, but the compiler infers everything automatically.
2020-02-17 16:03:54 +01:00
Ivan Enderlin
ad77803243 fix(runtime-core) Rename ExternalFunction to HostFunction. 2020-02-17 16:02:23 +01:00
Ivan Enderlin
533609ff70 chore(runtime-core) Move one statement to be closer to the definition. 2020-02-17 16:01:01 +01:00
Ivan Enderlin
2ee1e80f3b feat(runtime-core) Allow dynamic signature for polymorphic host functions.
This patch adds a new field in `Func`: `signature`. It contains the
signature of the host function.

For non-polymorphic host functions, the signature is computed from the
`Args` and `Rets` implementation parameters at compile-time.

For polymorphic host functions though, to be fully dynamic, the
signature given to `new_polymorphic` is used in `Func` as the correct
signature.
2020-02-17 15:50:12 +01:00
Ivan Enderlin
ad20a008e0 fix(runtime-core) Use explicit dyn for trait objects. 2020-02-17 15:30:25 +01:00
Ivan Enderlin
ff154999f3 fix(runtime-core) Remove warnings.
Because we can use the `impl_traits!` macro with only one identifier,
a warning is emitted saying the parenthesis are useless for this
specific usecase. They are required for all the other usecases
though. We can safely ignore this warning.
2020-02-17 15:20:21 +01:00
Ivan Enderlin
1d1ffcc10a feat(runtime-core) Implement TryFrom<native_type> for Value. 2020-02-17 14:56:43 +01:00
Ivan Enderlin
9088f6b9e2 feat(runtime-core) Simplify WasmExternType implementations with macros. 2020-02-17 14:53:09 +01:00
Ivan Enderlin
d6cd1fa6c4 doc(interface-types) Add a README.md file. 2020-02-17 14:48:58 +01:00
Ivan Enderlin
ff2ff0691b doc(changelog) Add #1216. 2020-02-17 14:12:55 +01:00
Ivan Enderlin
306d19274b test(interface-types) Test roundtrip: AST to binary to AST. 2020-02-17 13:55:59 +01:00
Ivan Enderlin
8736f0548e test(interface-types) Fix one bug and write the test suite. 2020-02-17 13:55:59 +01:00
Ivan Enderlin
1149158589 feat(interface-types) Add the binary encoder. 2020-02-17 13:55:59 +01:00
Syrus Akbary
a21cf6d4c3
Added link to a custom ABI example repo
https://github.com/wasmerio/wasmer-rust-customabi-example
2020-02-16 12:48:20 -08:00
losfair
7b0f7ee55e Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-16 00:39:27 +08:00
losfair
5f4561e5ef Fix compilation error on Aarch64. 2020-02-16 00:28:43 +08:00
Mark McCaskey
923e4ac83a Add command line flag, make debug crate optional, clean up API 2020-02-14 12:34:25 -08:00
bors[bot]
32991e676e
Merge #1218
1218: Enable clif verifier in debug mode, fix issue with verifier r=MarkMcCaskey a=MarkMcCaskey

Ensures we're using I32s to index into things that are indexed by I32s

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-14 19:47:20 +00:00
Mark McCaskey
23275d07f6 Improve clif verifier error message 2020-02-14 11:45:11 -08:00
Mark McCaskey
5e3147db08 Enable clif verifier in debug mode, fix issue with verifier 2020-02-14 11:32:49 -08:00
losfair
12373bb872 Func::new_polymorphic 2020-02-15 01:31:49 +08:00
losfair
2fe6e6f039 Global trampoline buffer. 2020-02-15 01:31:33 +08:00
Syrus Akbary
8faac62bc0
Merge pull request #1215 from Hywan/fix-interface-types-dbg
fix(interface-types) Remove a `dbg!` macro
2020-02-14 08:37:49 -08:00
Ivan Enderlin
0c4c9107d5 fix(interface-types) Remove a dbg! macro. 2020-02-14 12:19:29 +01:00
Syrus Akbary
07c8eff47f
Use wapm packages last after $PATH 2020-02-14 00:16:32 -08:00
bors[bot]
f4829c7fe5
Merge #1209
1209: Maybe improve safety of MemoryView Deref r=MarkMcCaskey a=MarkMcCaskey

Possibly slightly better... (effectively does exactly the same thing the same way):

Notably this code still violates the safety rules of its unsafe functions:

It violates rule 2 from https://doc.rust-lang.org/std/slice/fn.from_raw_parts_mut.html :

> The memory referenced by the returned slice must not be accessed through any other pointer (not derived from the return value) for the duration of lifetime ’a. Both read and write accesses are forbidden.


Some comments in the stdlib indicate that casting between `Cell<T>` and `T` isn't something that's safe to do outside of the stdlib 🤷‍♂ .

Fundamentally, `MemoryView` is unsound.  Our docs say that it does not have undefined behavior, but we don't properly justify that.   I believe it relies very heavily on undefined behavior.

Looking for feedback here about what we can do.  It seems like we'll have to break the public API to make a sound API... if we can decide on a sufficiently good one, we can deprecate the old one and roll out the new one to prevent user breakage.

We may need to use something like https://docs.rs/crossbeam/0.7.3/crossbeam/atomic/struct.AtomicCell.html or implement something like it.

Where I'm at in regards to memory access from the host is that it's not possible to make any kind of efficient API that is not entirely `unsafe`.  Even given that, we need to figure out the bounds with which the `unsafe` functions can be used relatively safely.  I think even if we marked our existing functions as `unsafe`, it's too complex to figure out whether or not you're using it correctly...

Bonus points if your solution works across multiple threads properly...

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-14 00:13:48 +00:00
Mark McCaskey
c8e3a0925b
Merge branch 'master' into feature/changed-memory-view 2020-02-13 16:04:43 -08:00
bors[bot]
7dbe357e89
Merge #1214
1214: test(interface-types) Add `wasmer-interface-types` to `make check` r=MarkMcCaskey a=Hywan

Sequel of #787. Forgot to update the changelog, and to add `wasmer-interface-types` to `make check`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-13 19:02:21 +00:00
Mark McCaskey
344bf0716c
Merge branch 'master' into test-interface-types 2020-02-13 11:01:57 -08:00
bors[bot]
1d3ae6a00e
Merge #1213
1213: Fixed WASI isatty r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Current WASI implementation returns a wrong response when libc `isatty` is used for `stdin`, `stdout` or `stderr`.

This PR fixes it.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-02-13 18:42:30 +00:00
Syrus Akbary
7a45bd8a39
Merge branch 'master' into fix/isatty 2020-02-13 10:42:09 -08:00
Syrus
60e686ff76 Added change into changelog 2020-02-13 10:37:27 -08:00
Syrus
61c85b3fbf Improved fd_write debugging 2020-02-13 10:35:48 -08:00
Syrus
c287170166 Fixed wasi isatty tests when being generated 2020-02-13 10:33:27 -08:00
Ivan Enderlin
07ba2c82b9 test(interface-types) Add wasmer-interface-types to make check. 2020-02-13 15:38:35 +01:00
Ivan Enderlin
2e2c5ab9c1 doc(changelog) Add #787. 2020-02-13 15:38:21 +01:00
bors[bot]
16245c6bd2
Merge #787
787: feat(interface-types) Implement Interface Types (WIT) r=Hywan a=Hywan

So far, this PR implements a new crate named `wasmer-interface-types`. The goal is to implement the WebAssembly Interface Types (WIT) proposal, https://github.com/WebAssembly/interface-types. Keep in mind the proposal is highly unstable and experimental.

The `wasmer-interface-types` is designed to be _runtime agnostic_, which means that there is no connection between this crate and `wasmer-runtime-core` or `wasmer-runtime` (or any backend crates). The hope is that other runtimes could use `wasmer-interface-types` according to their needs.

The `wasmer-interface-types` is composed of 4 parts:
* AST: [The WIT language, represented as an AST](https://github.com/Hywan/wasmer/blob/feat-interface-types/lib/interface-types/src/ast.rs) (it's not really abstract though),
* Decoders: So far, it contains only [one parser that reads the WIT binary language](https://github.com/Hywan/wasmer/blob/feat-interface-types/lib/interface-types/src/decoders/binary.rs) and produces an AST,
* Encoders: So far, it contains only [one compiler that transforms the AST into "WIT.wat”](https://github.com/Hywan/wasmer/blob/feat-interface-types/lib/interface-types/src/encoders/wat.rs), i.e. the textual representation of an Interface Types AST
* Instructions: WIT defines a new concept called Adapters. An adapter contains a set of instructions. Those instructions are executed when data are bound. So, in more details, this module contains:
  * [`interpreter.rs`](https://github.com/Hywan/wasmer/blob/feat-interface-types/lib/interface-types/src/interpreter/mod.rs), a stack-based interpreter, defined by:
    * A compiler that transforms a set of instructions into a set of _executable_ instructions,
    * A stack,
    * A runtime that holds the “invocation inputs” (arguments of the interpreter), the stack, and the Wasm instance (which holds the exports, the imports, the memories, the tables etc.),
  * [`stack.rs`](https://github.com/Hywan/wasmer/blob/feat-interface-types/lib/interface-types/src/interpreter/stack.rs), a very light and generic stack implementation, exposing only the API required by the interpreter,
  * [`wasm/*.rs`](https://github.com/Hywan/wasmer/blob/feat-interface-types/lib/interface-types/src/interpreter/wasm/structures.rs), a set of enums, types, and traits to represent a Wasm runtime —basically this is the part a runtime should take a look to support the `wasmer-interface-types` crate—.

Progression:

* [x] WIT binary parser,
* [x] WIT.wat compiler,
* [ ] Interpreter:
  * [ ] Wasm runtime traits to represent:
    * [x] Instance,
    * [x] Export,
    * [x] Memory,
    * [x] Import,
    * [ ] Table,
  * [x] Generic stack implementation,
  * [ ] Implemented instructions:
    * [x] `arg.get`,
    * [x] `call`,
    * [x] `call-export`,
    * [x] `read-utf8`,
    * [x] `write-utf8`,
    * [ ] `as-wasm`,
    * [ ] `as-interface`
    * [ ] `table-ref-add`
    * [ ] `table-ref-get`
    * [ ] `call-method`
    * [ ] `make-record`
    * [ ] `get-field`
    * [ ] `const`
    * [ ] `fold-seq`
    * [ ] `add`
    * [ ] `mem-to-seq`
    * [ ] `load`
    * [ ] `seq.new`
    * [ ] `list.push`
    * [ ] `repeat-until`
    * [ ] `seq-to-mem`
    * [ ] `store`
* [ ] Plug `wasmer-interface-types` into `wasmer-runtime-core`

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-13 13:41:32 +00:00
Ivan Enderlin
c697e6812f Merge branch 'master' into feat-interface-types 2020-02-13 14:40:46 +01:00
Ivan Enderlin
7f8d9165d4 fix(interface-types) Clean up cargo features. 2020-02-13 14:38:05 +01:00
Ivan Enderlin
eb2f9db230 feat(interface-types) Forbids unsafe code. 2020-02-13 14:36:17 +01:00
Ivan Enderlin
9559747394 doc(interface-types) Add #[deny(missing_docs)]. 2020-02-13 14:34:45 +01:00
Ivan Enderlin
ae6e26158f chore(interface-types) Simplify code. 2020-02-13 14:26:50 +01:00
Ivan Enderlin
6891517c8b chore(encoders) Changing unimplemented!() to todo!(). 2020-02-13 14:24:07 +01:00
Ivan Enderlin
13cee90d17 feat(encoders) Implement ToString instead of From<…> for String. 2020-02-13 14:19:31 +01:00
Ivan Enderlin
722727bd56 chore(decoders) Simplify code. 2020-02-13 13:56:30 +01:00
Ivan Enderlin
d8f923091f chore(decoders) Simplify code. 2020-02-13 13:54:26 +01:00
Ivan Enderlin
3f0c32bf44 fix(decoders) Remove the unsafe block in the string parser.
Instead of using `str::from_utf8_unchecked`, this patch updates the
code to use `str::from_utf8` and handles the error appropriately.
2020-02-13 13:52:23 +01:00
Ivan Enderlin
370fd6d866 feat(decoders) Improve LEB parser in the binary module.
The LEB parser is renamed `uleb`. It now checks for overflow, and
badly-formed bits, resp. `TooLarge` or `Eof`. More test cases are
added, whose from the DWARF 4 standard.
2020-02-13 13:36:18 +01:00
Ivan Enderlin
1ad42d81cb doc(interface-types) Improve documentation of decoders::binary::leb. 2020-02-13 11:41:02 +01:00
Ivan Enderlin
b7941f4019 feat(interface-types) Ensure ast::Type is always well-formed.
As @MarkMcCaskey noted, `Type` can be corrupted because `field_names`
and `field_types` must have the same length. This patch removes the
public visibility, and adds methods like `new`, `add_field`,
`field_names` and `field_types` to encapsulate `Type` internal data.
2020-02-13 11:24:29 +01:00
Syrus
62e1526037 Fixed WASI isatty 2020-02-12 23:00:30 -08:00
Mark McCaskey
e34e0bb897 Clean up, everything works 2020-02-12 17:09:30 -08:00
Ivan Enderlin
13b9cb3995 doc(interface-types) Improve the documentation of the interpreter module. 2020-02-12 17:37:06 +01:00
Ivan Enderlin
6b0e43b7c4 doc(interface-types) Improve the documentation of the instruction module. 2020-02-12 16:01:33 +01:00
Ivan Enderlin
b3c102da37 doc(interface-types) Improve documentation of the instruction module.
Also, rename `RepeatWhile` to `RepeatUntil`.
2020-02-12 15:59:41 +01:00
Ivan Enderlin
98c73099c3 doc(interface-types) Improve documentation of the macros module. 2020-02-12 15:52:15 +01:00
Mark McCaskey
5e3c5f703f Fix validation issue, cast to the correct type 2020-02-11 16:35:42 -08:00
Mark McCaskey
93dcb63348 Maybe improve safety of MemoryView Deref 2020-02-11 14:13:25 -08:00
bors[bot]
f2d9a49e3f
Merge #1208
1208: Fix trap handling bug on Windows and add test r=MarkMcCaskey a=MarkMcCaskey

Resolves #1204

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-11 21:54:49 +00:00
Mark McCaskey
132645e0d0 Fix trap handling bug on Windows and add test 2020-02-11 13:24:26 -08:00
bors[bot]
3fb5f548ab
Merge #1191
1191: Fix singlepass miscompilation on `Operator::CallIndirect`. r=losfair a=losfair

This fixes the 3 failing tests mentioned in https://00f.net/2019/10/22/updated-webassembly-benchmark/ .

(TODO: Add test cases?)

Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-02-11 19:00:08 +00:00
losfair
2f4e9b1fe3 Update changelog. 2020-02-12 02:56:12 +08:00
losfair
c6861d1827 Merge remote-tracking branch 'origin/master' into fix/singlepass-indirect-call 2020-02-12 02:55:48 +08:00
losfair
01e570d60a Add test for PR 1191. 2020-02-12 02:54:27 +08:00
bors[bot]
df268cff0e
Merge #1207
1207: Update Rust version used to build docs to be consistent r=syrusakbary a=MarkMcCaskey

In response to #1196 


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-02-11 18:43:12 +00:00
Mark McCaskey
491ba27528 Update Rust version used to build docs to be consistent 2020-02-11 10:41:17 -08:00
losfair
5ca6c22cbf Merge remote-tracking branch 'origin/master' into fix/singlepass-indirect-call 2020-02-12 02:28:25 +08:00
bors[bot]
eaa081e359
Merge #1192
1192: Use `ExceptionCode` for error representation. r=losfair a=losfair

Extends https://github.com/wasmerio/wasmer/pull/1129 to all backends.

Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-02-11 18:15:50 +00:00
losfair
3999728e39 Merge remote-tracking branch 'origin/master' into feature/remove-wasm-trap-info 2020-02-12 02:14:30 +08:00
losfair
2071a4bddf Fix LLVM invoke_trampoline. 2020-02-12 02:14:07 +08:00
Mark McCaskey
0564000da3 Add wip debugging code 2020-02-11 09:52:21 -08:00
Syrus Akbary
97328b3af7
Fixed typo 2020-02-10 13:24:11 -08:00
bors[bot]
9d80584c97
Merge #1202
1202: doc(runtime-c-api) Improve documentation of the `memory` module r=syrusakbary a=Hywan

Address https://github.com/wasmerio/wasmer/issues/1203.

As part of the daily doc routine, this patch improves the documentation of `memory` module.

This patch also handles more null pointers.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-10 19:55:02 +00:00
losfair
cee4bed95e Update changelog 2020-02-11 03:19:15 +08:00
losfair
cc4b512bde Fix clif trap code conversions. 2020-02-11 03:16:56 +08:00
losfair
b40edd4512 Fix failures on test compilation. 2020-02-11 03:03:05 +08:00
losfair
e17d8f20b8 Merge remote-tracking branch 'origin/master' into feature/remove-wasm-trap-info 2020-02-11 02:52:14 +08:00
Syrus Akbary
4a63e09d6d
Merge pull request #1200 from wasmerio/dependabot/cargo/byteorder-1.3.4
Bump byteorder from 1.3.2 to 1.3.4
2020-02-10 09:43:40 -08:00
Syrus Akbary
27da143e59
Merge pull request #1199 from wasmerio/dependabot/cargo/blake3-0.1.4
Bump blake3 from 0.1.3 to 0.1.4
2020-02-10 09:43:21 -08:00
Syrus Akbary
f5ec7d10b6
Merge pull request #1198 from wasmerio/dependabot/cargo/indexmap-1.3.2
Bump indexmap from 1.3.1 to 1.3.2
2020-02-10 09:43:07 -08:00
Syrus Akbary
7238681132
Merge pull request #1197 from wasmerio/dependabot/cargo/hex-0.4.1
Bump hex from 0.4.0 to 0.4.1
2020-02-10 09:42:56 -08:00
Syrus Akbary
ed431b1b91
Merge pull request #1201 from Hywan/fix-runtime-c-api-remove-test-bin
fix(runtime-c-api) Remove a file that should have been ignored
2020-02-10 09:42:34 -08:00
Ivan Enderlin
c5b963b81b doc(interface-types) Improve documentation of the wat module. 2020-02-10 17:12:32 +01:00
Ivan Enderlin
55ae0e474e doc(interface-types) Add a doctest for decoders::binary::parse. 2020-02-10 16:48:25 +01:00
Ivan Enderlin
98fb0697d1 test(interface-types) Test the parse parser. 2020-02-10 16:39:34 +01:00
Ivan Enderlin
9fda6f9451 doc(interface-types) Improve documentation of the binary module. 2020-02-10 16:39:06 +01:00
Ivan Enderlin
2fc1fbb7ec doc(interface-types) Improve documentation of the ast module. 2020-02-10 15:44:28 +01:00
Ivan Enderlin
d667cb8e2f doc(interface-types) Improve documentation of the ast module. 2020-02-10 15:41:41 +01:00
Ivan Enderlin
36c7dbd92f feat(interface-types) Rename ImportedFunction to Import.
So that we are consistent with `Export`.
2020-02-10 15:41:10 +01:00
Ivan Enderlin
32325c1861 doc(interface-types) Improve module descriptions. 2020-02-10 15:27:04 +01:00
Ivan Enderlin
d63508f19e doc(interface-types) Improve documentation of the stack module. 2020-02-10 15:23:28 +01:00
Ivan Enderlin
e098934328 doc(interface-types) Improve documentation of the crate itself. 2020-02-10 15:22:56 +01:00
Ivan Enderlin
5ed5ac82c0 test(interface-types) Improve test cases for Stack. 2020-02-10 15:22:22 +01:00
Ivan Enderlin
102ebe87f8 chore(interface-types) Format code. 2020-02-10 14:41:40 +01:00
Ivan Enderlin
0b0a89bf0f test(interface-types) Fix a documentation message. 2020-02-10 14:41:06 +01:00
Ivan Enderlin
60a905698d feat(interface-types) Use nom 5.1. 2020-02-10 14:05:13 +01:00
Ivan Enderlin
fe14c5c06b chore(interface-types) Update crate version. 2020-02-10 13:32:04 +01:00
Ivan Enderlin
ba16d12b1a Merge branch 'master' into feat-interface-types 2020-02-10 13:25:57 +01:00
Ivan Enderlin
c8af1b1fb7 feat(interface-types) Remove dev-dependencies to any runtime. 2020-02-10 13:15:52 +01:00
Ivan Enderlin
b56240010c feat(interface-types) Simplify code. 2020-02-10 13:14:46 +01:00
Ivan Enderlin
207d69fdbd feat(interface-types) Change Instance::local_or_import(&self) to Instance::local_or_import(&mut self).
It allows the instance to create or update locals/imports when the
`local_or_import` function is called. It's not ideal, but fine enough
for a first step.
2020-02-10 13:14:19 +01:00
Ivan Enderlin
99c9fc44dc chore(interface-types) The tests/ directory has moved in wasmer-runtime-core-tests. 2020-02-10 13:13:03 +01:00
Ivan Enderlin
7b3ab38608 chore(interface-types) Simplify the code. 2020-02-10 13:03:36 +01:00
Ivan Enderlin
d8134721a8 feat(interface-types) Introduce the wasm::structures::MemoryView trait. 2020-02-10 13:00:29 +01:00
Ivan Enderlin
285c564de1 chore(runtime-c-api) Simplify code. 2020-02-10 11:47:04 +01:00
Ivan Enderlin
c54c8297f5 chore(runtime-c-api) Update C/C++ headers. 2020-02-10 11:37:45 +01:00
Ivan Enderlin
151ca3792a test(runtime-c-api) Simplify code. 2020-02-10 11:37:29 +01:00
Ivan Enderlin
b57cd83504 doc(runtime-c-api) Improve documentation of wasmer_memory_destroy. 2020-02-10 11:36:53 +01:00
Ivan Enderlin
38ee947354 doc(runtime-c-api) Rephrase null pointers. 2020-02-10 11:36:40 +01:00
Ivan Enderlin
ee0f05f9a1 feat(runtime-c-api) wasmer_memory_data_length returns 0 if memory is NULL. 2020-02-10 11:31:54 +01:00
Ivan Enderlin
b1a0e1933c doc(runtime-c-api) Improve documentation of wasmer_memory_data_length. 2020-02-10 11:31:24 +01:00
Ivan Enderlin
da439fc05f doc(runtime-c-api) Improve documentation of wasmer_memory_data. 2020-02-10 11:31:03 +01:00
Ivan Enderlin
7eeffb8d63 feat(runtime-c-api) wasmer_memory_data returns NULL if memory is NULL. 2020-02-10 11:17:15 +01:00
Ivan Enderlin
e5fa1b3c1b doc(runtime-c-api) Improve documentation of wasmer_memory_data. 2020-02-10 11:16:48 +01:00
Ivan Enderlin
59d35656a9 feat(runtime-c-api) wasmer_memory_grow returns WASMER_ERROR if memory is NULL. 2020-02-10 11:08:59 +01:00
Ivan Enderlin
534db599b2 feat(runtime-c-api) wasmer_memory_length returns 0 if memory is NULL. 2020-02-10 11:04:41 +01:00
Ivan Enderlin
78056df6cc doc(runtime-c-api) Improve documentation of wasmer_memory_length. 2020-02-10 11:04:09 +01:00
Ivan Enderlin
ed77c9c64f doc(runtime-c-api) Improve documentation of wasmer_memory_grow. 2020-02-10 11:03:48 +01:00
Ivan Enderlin
8d083da303 doc(runtime-c-api) Improve documentation of wasmer_memory_new. 2020-02-10 11:03:22 +01:00
Ivan Enderlin
2aecb49227 doc(runtime-c-api) Improve documentation of wasmer_memory_t. 2020-02-10 11:02:50 +01:00
Ivan Enderlin
602fd8334e doc(runtime-c-api) Improve documentation of wasmer_limit_option_t. 2020-02-10 11:02:28 +01:00
Ivan Enderlin
933a0de5e3 doc(runtime-c-api) Improve documentation of wasmer_limits_t. 2020-02-10 11:02:07 +01:00
Ivan Enderlin
62a2e3ecad doc(runtime-c-api) Fix a typo. 2020-02-10 11:01:48 +01:00
Ivan Enderlin
4d67a32a1e fix(runtime-c-api) Remove a file that should have been ignored. 2020-02-10 09:57:54 +01:00
dependabot-preview[bot]
59602ce56f Bump byteorder from 1.3.2 to 1.3.4
Bumps [byteorder](https://github.com/BurntSushi/byteorder) from 1.3.2 to 1.3.4.
- [Release notes](https://github.com/BurntSushi/byteorder/releases)
- [Changelog](https://github.com/BurntSushi/byteorder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/byteorder/compare/1.3.2...1.3.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 08:02:34 +00:00
dependabot-preview[bot]
15a0025ef0 Bump blake3 from 0.1.3 to 0.1.4
Bumps [blake3](https://github.com/BLAKE3-team/BLAKE3) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/BLAKE3-team/BLAKE3/releases)
- [Commits](https://github.com/BLAKE3-team/BLAKE3/compare/0.1.3...0.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 08:02:03 +00:00
dependabot-preview[bot]
4e10a3af50 Bump indexmap from 1.3.1 to 1.3.2
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.3.1...1.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 08:01:32 +00:00
dependabot-preview[bot]
899305c582 Bump hex from 0.4.0 to 0.4.1
Bumps [hex](https://github.com/KokaKiwi/rust-hex) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/KokaKiwi/rust-hex/releases)
- [Commits](https://github.com/KokaKiwi/rust-hex/compare/v0.4...v0.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-10 08:00:51 +00:00
Syrus Akbary
5b8c44c529 Try to fix docs generation 2020-02-07 22:30:51 -08:00
Syrus Akbary
e521339694
Merge pull request #1194 from wasmerio/nlewycky-patch-1
Fix typo in comment.
2020-02-07 12:16:54 -08:00
nlewycky
073d342f01
Fix typo in comment. 2020-02-07 12:16:16 -08:00
Syrus Akbary
e387569818
Merge pull request #1193 from wasmerio/feature/document-private-items
Include implementation details when generating our documentation.
2020-02-07 11:49:46 -08:00
Nick Lewycky
0a89c8188c Include implementation details when generating our documentation.
In passing, replace deprecated flag --all with equivalent flag --workspace.
2020-02-07 11:48:45 -08:00
losfair
e0aafbe9dd Remove WasmTrapInfo and passExceptionCode in the generic Box<Any> container. 2020-02-06 23:49:50 +08:00
losfair
ee9ddb18fc Fix singlepass miscompilation on Operator::CallIndirect. 2020-02-06 23:10:55 +08:00
bors[bot]
2c44b700c8
Merge #1183
1183: Make full preemption an optional feature. r=syrusakbary a=losfair

Full preemption requires two additional memory loads on loop backedges and function calls. This PR allows disabling full preemption at code generation time, and disables it by default.

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2020-02-05 01:05:04 +00:00
bors[bot]
abbdda7ebe
Merge #1189
1189: Fix a couple typos in comments. r=MarkMcCaskey a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2020-02-04 18:03:12 +00:00
losfair
d2fc5c8013 Cargo fmt 2020-02-05 00:45:24 +08:00
losfair
d3f2cf594a Fix comments. 2020-02-05 00:44:59 +08:00
Heyang Zhou
b5a629b065
Use less-than to compare sizes.
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-02-05 00:37:40 +08:00
Heyang Zhou
fe5ed7b27a
Improve comment for memory_bound_check_mode.
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-02-05 00:35:15 +08:00
Mark McCaskey
42132c42b6 Restructure to use external crate, add integration 2020-02-03 16:01:23 -08:00
Nick Lewycky
5a795d560e Fix a couple typos in comments. 2020-02-03 12:41:57 -08:00
losfair
bb79df7e69 Merge remote-tracking branch 'origin/master' into feature/optional-full-preemption 2020-02-04 01:58:53 +08:00
losfair
60c7d1e0fc Fix register zeroing in emit_compare_and_swap. 2020-02-04 01:58:21 +08:00
bors[bot]
cc034cd5e1
Merge #1186
1186: Improve some docs and misc code segments r=MarkMcCaskey a=MarkMcCaskey

A bit of a follow up to #1184 plus some clippy fixes and doc improvements

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-31 23:51:29 +00:00
Mark McCaskey
929825cba1 Improve some docs and misc code segments 2020-01-31 15:42:18 -08:00
bors[bot]
a54f4e730e
Merge #1185
1185: Bump supported Rust version to 1.40.0 r=MarkMcCaskey a=MarkMcCaskey

Rust 1.41.0 released yesterday

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-31 23:09:57 +00:00
Mark McCaskey
bff7027e81 Bump supported Rust version to 1.40.0 2020-01-31 14:56:20 -08:00
bors[bot]
a01fd4cafb
Merge #1184
1184: Add minor documentation updates r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-31 22:50:37 +00:00
Mark McCaskey
870c057826 Add minor documentation updates 2020-01-31 13:10:02 -08:00
Mark McCaskey
800b2a42cc Add debug prototype 2 (fork of wasmtime-debug) 2020-01-31 12:42:09 -08:00
losfair
455783aa21 Make full preemption an optional feature. 2020-02-01 01:12:06 +08:00
Syrus Akbary
a6c55ea548
Merge pull request #1181 from Hywan/doc-runtime-c-api-value
doc(runtime-c-api) Improve documentation of the `value` module
2020-01-29 08:55:46 -08:00
Ivan Enderlin
743b192512 chore(runtime-c-api) Update C/C++ headers. 2020-01-29 14:50:18 +01:00
Ivan Enderlin
5fb7f4ea3b doc(runtime-c-api) Generate documentation for wasmer.h only. 2020-01-29 14:49:45 +01:00
Ivan Enderlin
a2ddbab03d doc(runtime-c-api) Improve documentation of wasmer_value_t. 2020-01-29 14:49:20 +01:00
Ivan Enderlin
9c4ce52d45 doc(runtime-c-api) Improve documentation of wasmer_value. 2020-01-29 14:48:57 +01:00
Ivan Enderlin
5d7020a296 doc(runtime-c-api) Improve documentation of wasmer_value_tag. 2020-01-29 14:47:56 +01:00
Syrus Akbary
cc3eee47ae
Merge pull request #1137 from wasmerio/dependabot/cargo/wasmparser-0.45.2
Bump wasmparser from 0.45.0 to 0.45.2
2020-01-28 15:47:52 -08:00
bors[bot]
c5d033e760
Merge #1120
1120: Port to FreeBSD r=MarkMcCaskey a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

I disovered this great patch today: https://github.com/MikaelUrankar/webasm/blob/master/www/wasmer/files/patch-freebsd

And then realized that @MikaelUrankar forked wasmer to add support for FreeBSD.

I'm creating this PR to follow up on that fork and merge the changes upstream.

@MikaelUrankar let us know if everything is good to go with this PR!

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: MikaelUrankar <mikael.urankar@gmail.com>
2020-01-28 22:08:39 +00:00
MikaelUrankar
fcbdada259 Port to FreeBSD 2020-01-28 21:49:55 +01:00
dependabot-preview[bot]
98ce368278
Bump wasmparser from 0.45.0 to 0.45.2
Bumps [wasmparser](https://github.com/yurydelendik/wasmparser.rs) from 0.45.0 to 0.45.2.
- [Release notes](https://github.com/yurydelendik/wasmparser.rs/releases)
- [Commits](https://github.com/yurydelendik/wasmparser.rs/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-28 18:58:41 +00:00
bors[bot]
589a99452c
Merge #1180
1180: Fix compilation for target `x86_64-unknown-linux-musl`. r=losfair a=losfair

Fixes compilation failure when built for `x86_64-unknown-linux-musl`.

- Allows disabling the `wabt` feature to avoid depending on a C++ compiler.
- Disables XMM register dump on fault as a workaround for missing musl libc types (https://github.com/rust-lang/libc/pull/1646).

Fixes https://github.com/wasmerio/wasmer/issues/1178 and https://github.com/wasmerio/wasmer/issues/1173 .

Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-01-28 18:40:10 +00:00
losfair
6fa199614b Install musl-tools 2020-01-29 01:18:25 +08:00
losfair
5119fb3d68 Add musl build target for CI. 2020-01-29 01:07:55 +08:00
losfair
bf5234b06f Fix kernel-loader with musl. 2020-01-29 01:07:23 +08:00
losfair
f5d2294126 Update changelog 2020-01-29 00:50:18 +08:00
losfair
fb15aa003e Cargo fmt 2020-01-29 00:43:24 +08:00
losfair
8845e1104b Fix musl compatibility issues. 2020-01-29 00:38:39 +08:00
losfair
5476994c90 Remove CLI dependency on wabt. 2020-01-29 00:38:25 +08:00
losfair
8411e56f4f Make wabt optional. 2020-01-29 00:37:43 +08:00
Syrus
05227266df Fix tag overwritting 2020-01-27 17:13:58 -08:00
Syrus Akbary
1d4d2a0200
Merge pull request #1176 from wasmerio/dependabot/cargo/smallvec-1.1.0
Bump smallvec from 0.6.13 to 1.1.0
2020-01-27 11:47:08 -08:00
Syrus Akbary
e2ca217cb7
Merge pull request #1177 from wasmerio/dependabot/cargo/blake3-0.1.3
Bump blake3 from 0.1.0 to 0.1.3
2020-01-27 11:46:57 -08:00
dependabot-preview[bot]
ff2533a3e2
Bump blake3 from 0.1.0 to 0.1.3
Bumps [blake3](https://github.com/BLAKE3-team/BLAKE3) from 0.1.0 to 0.1.3.
- [Release notes](https://github.com/BLAKE3-team/BLAKE3/releases)
- [Commits](https://github.com/BLAKE3-team/BLAKE3/compare/0.1.0...0.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-27 07:48:05 +00:00
dependabot-preview[bot]
c00cd2ce3c
Bump smallvec from 0.6.13 to 1.1.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.1.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-27 07:47:27 +00:00
bors[bot]
9ce1fb26aa
Merge #1174
1174: Clean up misc. bits of runtime-core r=MarkMcCaskey a=MarkMcCaskey

Also includes the lock file which has been showing up in my diffs for a while, so I guess I should commit it 


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-24 23:32:35 +00:00
Mark McCaskey
0a02f3bb97 Clean up misc. bits of runtime-core 2020-01-24 15:31:52 -08:00
bors[bot]
ddaaa30e2d
Merge #1172
1172: Share some more code in runtime-core::sys r=MarkMcCaskey a=MarkMcCaskey

This code was partially duplicated


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-22 21:40:23 +00:00
Mark McCaskey
2c45106ae0 Share some more code in runtime-core::sys 2020-01-22 13:34:50 -08:00
bors[bot]
5dfa61e30a
Merge #1170
1170: Add new features to WasiState builder API r=MarkMcCaskey a=MarkMcCaskey

Allows for ergonomic swapping out of stdin, stdout, stderr as well as
a new PreopenDir sub-builder which enables for user control over the
permissions that the directory is preopened with.

This PR includes breaking changes to the pubilc API.

TODO:
- [x] Add doc examples of using the new sub-builder
- [x] Discuss and maybe readd removed broken API with `deprecated` attributes on them

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-01-22 01:09:30 +00:00
Mark McCaskey
4862828165 Clean up and add another example 2020-01-21 17:06:50 -08:00
Mark McCaskey
19ea53b86e
Update lib/wasi/src/state/builder.rs
Co-Authored-By: nlewycky <nick@wasmer.io>
2020-01-21 16:57:33 -08:00
Mark McCaskey
7ea6943af1 Update example in doc to use new preopened dir builder 2020-01-21 16:33:49 -08:00
Mark McCaskey
d1cadf98e1 Add new features to WasiState builder API
Allows for ergonomic swapping out of stdin, stdout, stderr as well as
a new PreopenDir sub-builder which enables for user control over the
permissions that the directory is preopened with.

This PR includes breaking changes to the pubilc API.
2020-01-21 16:23:30 -08:00
bors[bot]
0157596021
Merge #1150
1150: doc(readme) Add `brew install wasmer` r=MarkMcCaskey a=Hywan

Depends on https://github.com/Homebrew/homebrew-core/pull/49045. Wait until it's merged.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-21 18:13:09 +00:00
bors[bot]
b73f26124a
Merge #1161
1161: Require that imported functions must be `Send` r=MarkMcCaskey a=MarkMcCaskey

resolves #1074 

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-01-21 17:48:10 +00:00
Mark McCaskey
f1db4aec1d
Merge branch 'master' into fix/imported-functions-must-be-send 2020-01-21 09:47:46 -08:00
bors[bot]
caa651cf32
Merge #1140
1140: Use blake3 instead of blake2_simd r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

Blake3 has a much faster hashing rate than Blake2/Blake2b_simd. This PR updates wasmer to use it as the default hashing algorithm.

More info here: https://www.infoq.com/news/2020/01/blake3-fast-crypto-hash/

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-01-20 22:17:11 +00:00
Syrus
0d2d4369aa Fixed lint issue 2020-01-20 14:15:02 -08:00
Syrus Akbary
5293bad793
Merge branch 'master' into blake3 2020-01-20 14:13:27 -08:00
bors[bot]
d73d8374a4
Merge #1129
1129: Standard exception types for singlepass backend. r=losfair a=losfair



Co-authored-by: losfair <zhy20000919@hotmail.com>
2020-01-20 18:22:50 +00:00
losfair
1b5d9f2a21 Update changelog. 2020-01-21 02:21:55 +08:00
losfair
526611676b Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-21 02:20:37 +08:00
losfair
dc216364be Fix backend string type. 2020-01-21 02:07:32 +08:00
bors[bot]
328d53895f
Merge #1168
1168: doc(runtime-c-api) Improve documentation of the `instance`, `error` and `export` modules r=syrusakbary a=Hywan

Daily doc', that turned to be an obsession. The entire `instance`, `error` modules are fully documented. The `exports` module's documentation have been improved too.

This PR also contains some “bug fixes” when `instance` pointers are null for instance (in this case, we do nothing or we return `void`).

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-20 17:58:15 +00:00
losfair
74eb11352a Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-21 01:10:40 +08:00
losfair
16dee04d22 Add aarch64-specific failure excludes. 2020-01-21 01:10:14 +08:00
Ivan Enderlin
13f87b1618 chore(runtime-c-api) Update C/C++ headers. 2020-01-20 15:59:30 +01:00
Ivan Enderlin
8283b6d0da doc(runtime-c-api) Improve documentation of wasmer_instance_destroy. 2020-01-20 15:58:27 +01:00
Ivan Enderlin
f4c8997c6d doc(runtime-c-api) Fix a link. 2020-01-20 15:58:11 +01:00
Ivan Enderlin
11e915f00f test(runtime-c-api) Simplify code. 2020-01-20 15:52:59 +01:00
Ivan Enderlin
df2b93ea81 fix(runtime-c-api) wasmer_instance_context_data_get returns void if instance is null. 2020-01-20 15:52:14 +01:00
Ivan Enderlin
c89f53b6fa doc(runtime-c-api) Improve documentation of wasmer_instance_context_memory. 2020-01-20 15:51:48 +01:00
Ivan Enderlin
32ee93ef73 fix(runtime-c-api) wasmer_instance_context_data_set does nothing if instance is null. 2020-01-20 15:43:14 +01:00
Ivan Enderlin
05dae9ef9d doc(runtime-c-api) Improve documentation of wasmer_instance_context_data_set. 2020-01-20 15:42:50 +01:00
Ivan Enderlin
edf45049e1 doc(runtime-c-api) Improve documentation of wasmer_instance_context_t. 2020-01-20 15:42:27 +01:00
Ivan Enderlin
cb632f3452 feat(runtime-c-api) Do nothing if instance is null in wasmer_instance_exports. 2020-01-20 15:30:00 +01:00
Ivan Enderlin
19627bdb8b doc(runtime-c-api) Improve documentation of wasmer_instance_exports. 2020-01-20 15:29:35 +01:00
Ivan Enderlin
3efd7d1232 doc(runtime-c-api) Improve documentation of wasmer_instance_call. 2020-01-20 15:29:04 +01:00
Ivan Enderlin
076931de91 doc(runtime-c-api) Improve documentation of wasmer_exports_destroy. 2020-01-20 15:28:30 +01:00
Ivan Enderlin
3022a16ec3 doc(runtime-c-api) Improve documentation of wasmer_import_export_value. 2020-01-20 15:28:13 +01:00
Ivan Enderlin
97c25f7862 doc(runtime-c-api) Improve documentation of wasmer_exports_t. 2020-01-20 15:27:50 +01:00
Ivan Enderlin
ee424bbadf doc(runtime-c-api) Improve documentation of wasmer_result_t. 2020-01-20 15:26:52 +01:00
Ivan Enderlin
585f5615cf fix(runtime-c-api) Fix imports, and check for null pointer. 2020-01-20 14:36:45 +01:00
Ivan Enderlin
77ba77446d doc(runtime-c-api) Improve documentation of wasmer_instance_context_get. 2020-01-20 14:36:11 +01:00
Ivan Enderlin
cd3a1064f9 chore(runtime-c-api) Move wasmer_module_import_instantiate to the module module. 2020-01-20 14:25:13 +01:00
Ivan Enderlin
384c501c93 doc(runtime-c-api) Improve error functions' documentations. 2020-01-20 14:23:52 +01:00
Syrus Akbary
9b483d3fe8
Merge pull request #1167 from wasmerio/dependabot/cargo/indexmap-1.3.1
Bump indexmap from 1.3.0 to 1.3.1
2020-01-20 01:05:33 -08:00
Syrus Akbary
366c48a588
Merge pull request #1166 from wasmerio/dependabot/cargo/structopt-0.3.8
Bump structopt from 0.3.7 to 0.3.8
2020-01-20 01:05:25 -08:00
Syrus Akbary
1b6f4c4b0d
Merge pull request #1165 from wasmerio/dependabot/cargo/smallvec-1.1.0
Bump smallvec from 0.6.13 to 1.1.0
2020-01-20 01:05:13 -08:00
dependabot-preview[bot]
1b806c4b2a
Bump indexmap from 1.3.0 to 1.3.1
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.3.0...1.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 08:00:06 +00:00
dependabot-preview[bot]
aff8256eb9
Bump structopt from 0.3.7 to 0.3.8
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.7...v0.3.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 07:59:18 +00:00
dependabot-preview[bot]
8721f6c17b
Bump smallvec from 0.6.13 to 1.1.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.1.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-20 07:58:42 +00:00
bors[bot]
9589e48712
Merge #1163
1163: Add clippy error checking in lint step r=MarkMcCaskey a=MarkMcCaskey


# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-18 00:19:03 +00:00
Mark McCaskey
d1f049916b Make Clippy Lint a separate step; upgrade all Ubuntu to 18.04 2020-01-17 16:04:57 -08:00
bors[bot]
37765819d7
Merge #1162
1162: Update CODEOWNERS r=MarkMcCaskey a=bjfish

Updating the CODEOWNERS file.

Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2020-01-17 23:49:32 +00:00
Mark McCaskey
5931944a21 Add clippy error checking in lint step 2020-01-17 15:47:45 -08:00
Brandon Fish
e5ffac08b5
Update CODEOWNERS 2020-01-17 17:15:00 -06:00
Mark McCaskey
8c760da83a Require that imported functions must be Send 2020-01-17 15:14:11 -08:00
bors[bot]
59dc6fd889
Merge #1160
1160: Docs/misc runtime core and cleanup r=MarkMcCaskey a=MarkMcCaskey

Adds some docs and deletes `mono_vec` (it's not publicly exposed, or used at all and I asked about it on Slack about it > 6 months ago and no one was attached to it)

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-17 22:42:48 +00:00
Mark McCaskey
c187d1656e Add misc doc improvements to runtime-core 2020-01-17 14:31:10 -08:00
Mark McCaskey
1b682bf353 Delete runtime-core::mono_vec 2020-01-17 14:31:00 -08:00
bors[bot]
00082e45be
Merge #1159
1159: Document runtime-core::vmcalls functions r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-17 01:03:52 +00:00
Mark McCaskey
0cbcc0aff6 Document runtime-core::vmcalls functions 2020-01-16 17:02:40 -08:00
bors[bot]
5dfe5d5b8e
Merge #1157
1157: Prepare for 0.13.1 release r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-16 22:15:44 +00:00
Mark McCaskey
430524ce51 Prepare for 0.13.1 release 2020-01-16 14:07:18 -08:00
bors[bot]
49bb849df2
Merge #1156
1156: Added release badge to wasmex in the README r=Hywan a=tessi

# Description

Added the release badge for wasmex to our README. 

This time attempting not to break the layout ;)

<img width="917" alt="Screenshot 2020-01-16 at 13 13 42" src="https://user-images.githubusercontent.com/206108/72524372-0d575880-3862-11ea-986d-b0aeeb6a82d4.png">


# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file

I guess this does not need a CHANGELOG entry 🤔 


Co-authored-by: Philipp Tessenow <philipp@tessenow.org>
2020-01-16 15:09:00 +00:00
Philipp Tessenow
5a5643f6ac Added release badge to wasmex in the README 2020-01-16 13:11:53 +01:00
Syrus Akbary
59c818863a
Merge pull request #1155 from Hywan/doc-runtime-c-api-daily
doc(runtime-c-api) Daily documentation improvements
2020-01-16 12:46:26 +01:00
Ivan Enderlin
96f96f5d20 chore(runtime-c-api) Update C/C++ headers. 2020-01-16 12:31:43 +01:00
Ivan Enderlin
d42bbb1f06 doc(runtime-c-api) Improve fragment readability in Doxygen. 2020-01-16 12:31:13 +01:00
Ivan Enderlin
44a80dc4a0 doc(runtime-c-api) Improve documentation of wasmer_instantiate. 2020-01-16 12:30:26 +01:00
Ivan Enderlin
13800872ff doc(runtime-c-api) Improve documentation of wasmer_instance_context_t. 2020-01-16 12:29:33 +01:00
Ivan Enderlin
88ca11628a doc(runtime-c-api) Improve documentation of wasmer_instance_t. 2020-01-16 12:29:09 +01:00
Ivan Enderlin
798557367a doc(runtime-c-api) Improve documentation of wasmer_validate. 2020-01-16 12:28:42 +01:00
Syrus Akbary
a4c13c8d18
Added docs to the language table 2020-01-16 11:59:41 +01:00
Syrus Akbary
677a399ad1
Merge pull request #1154 from Hywan/doc-assets-languages-elixir-reduce
doc(assets) Reduce Elixir logo to ~25px
2020-01-16 11:18:08 +01:00
Ivan Enderlin
08352b449a doc(assets) Reduce Elixir logo to ~25px. 2020-01-16 10:26:34 +01:00
bors[bot]
9ae83981be
Merge #1153
1153: Added Wasmex, an Elixir language integration r=MarkMcCaskey a=tessi

# Description

Thanks for creating wasmer. I missed a language integration and, thus, implemented it. This PR adds [Wasmex](https://github.com/tessi/wasmex), an integration into the Elixir language, to the list of supported languages in the README.

The implementation "borrows" some ideas (esp on the Rust side and documentation) of your language integrations. I hope this is OK with you. If not, tell me :)

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Philipp Tessenow <philipp@tessenow.org>
2020-01-16 00:50:56 +00:00
Philipp Tessenow
02c142200a
added link to the PR to CHANGELOG.md 2020-01-16 01:35:43 +01:00
Philipp Tessenow
b60c0fbad8 Added Wasmex, an Elixir language integration 2020-01-16 01:31:20 +01:00
bors[bot]
16c2e7fda4
Merge #1152
1152: Update clif-backend to use new published crates r=MarkMcCaskey a=MarkMcCaskey

With help from @nlewycky, this updates clif-backend to use the published forks



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-15 20:42:06 +00:00
Mark McCaskey
bb794598e9 Update clif-backend to use new published crates 2020-01-15 12:11:02 -08:00
bors[bot]
dbd8637e53
Merge #1151
1151: Prepare for 0.13.0 release r=MarkMcCaskey a=MarkMcCaskey


# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-15 19:23:11 +00:00
Mark McCaskey
3c996bc821 Prepare for 0.13.0 release 2020-01-15 11:09:47 -08:00
losfair
d3ebb5fbc8 Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-16 03:01:21 +08:00
losfair
1b3e679bf0 Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-16 02:59:56 +08:00
losfair
35870b33e5 Update spectests to test singlepass traps. 2020-01-16 02:59:27 +08:00
bors[bot]
12f1f2d8a8
Merge #1143
1143: Set backend_id to static str r=MarkMcCaskey a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

As per feedback in #1099, set backend_id to static str.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-15 18:32:01 +00:00
Mark McCaskey
75d7f106f2 Update remaining locations to use a &'static str for backend 2020-01-15 10:28:06 -08:00
bors[bot]
606ed7a848
Merge #1149
1149: fix(bin) Remove a warning for unreachable code. r=MarkMcCaskey a=Hywan

The `panic!` statement is indeed unreachable for regular usages, but
not for wrong feature configurations. Allowing `unreachable_code` to
avoid a warning.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-15 17:28:03 +00:00
Ivan Enderlin
95c4befd72 doc(readme) Add brew install wasmer. 2020-01-15 15:50:09 +01:00
Ivan Enderlin
7156056ac3 fix(bin) Remove a warning for unreachable code.
The `panic!` statement is indeed unreachable for regular usages, but
not for wrong feature configurations. Allowing `unreachable_code` to
avoid a warning.
2020-01-15 14:08:04 +01:00
Syrus
273a6307f7 Use &’static str for backend 2020-01-15 14:04:42 +01:00
bors[bot]
6514e57b6f
Merge #760
760: Add Publish_Docs stage, make it push to a fake gh-pages branch for testing whenever master is updated. r=syrusakbary a=nlewycky

bors r-

Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Azure Pipelines <azuredevops@microsoft.com>
2020-01-15 12:58:13 +00:00
Syrus
e84753eec2 Removed circleci-clean from makefile 2020-01-15 13:57:08 +01:00
Syrus
a99d0c209d Fixed based on feedback 2020-01-15 13:21:14 +01:00
Syrus
02dc47297f Changed from rust to crates 2020-01-15 13:21:05 +01:00
Syrus Akbary
2a2a3585d7
Merge pull request #1148 from Hywan/fix-runtime-c-api-error-message
fix(runtime-c-api) Fix error message.
2020-01-15 12:53:05 +01:00
Ivan Enderlin
7a16828e6e fix(runtime-c-api) Fix error message. 2020-01-15 12:50:18 +01:00
Syrus
991a777f72 Only commit if there are files to commit 2020-01-15 12:43:58 +01:00
Syrus
84beb446d9 Make docs only build and publish on master 2020-01-15 12:41:21 +01:00
Syrus
5a6afe4e68 Fixed makefile 2020-01-15 12:32:27 +01:00
Syrus
943dc7d868 Fixed mkdir 2020-01-15 11:04:00 +01:00
Syrus
d343cd1d2d Improved C-API documentation links 2020-01-15 11:01:48 +01:00
Syrus
47d38c9759 Trying to debug the issue 2020-01-15 11:01:22 +01:00
Syrus
ab77433128 Fixed redirect url 2020-01-15 10:45:47 +01:00
Syrus
892c95ef57 Added git user config to pass commit 2020-01-15 09:56:48 +01:00
bors[bot]
50acd8ba98
Merge #1133
1133: feat(runtime-c-api) Implement `wasmer_trap` r=Hywan a=Hywan

Idea is to provide an API to get fallible host function by calling `wasmer_trap` to run the Wasmer trapping API.

This is probably the easiest solution to not break the existing API, and not add a lot of complexity in the code.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-15 07:50:32 +00:00
Ivan Enderlin
fb06ee33e3 test(runtime-c-api) Rename wasmer_import_trap to wasmer_trap. 2020-01-15 08:47:52 +01:00
Ivan Enderlin
f4ae606006 doc(changelog) Update #1133. 2020-01-15 08:46:12 +01:00
Ivan Enderlin
ce3fb49b21 Merge branch 'master' into feat-runtime-c-api-import-trap 2020-01-15 08:44:56 +01:00
Ivan Enderlin
cd16a7d1a7 chore(runtime-c-api) Update C/C++ headers. 2020-01-15 08:42:17 +01:00
Ivan Enderlin
bcbde69694 doc(runtime-core) Fix a typo. 2020-01-15 08:41:37 +01:00
Ivan Enderlin
4cdf868a0b doc(runtime-c-api) Explain why code is unreachable in wasmer_trap. 2020-01-15 08:40:36 +01:00
Ivan Enderlin
c0b439e66a feat(runtime-c-api) Rename wasmer_import_trap to wasmer_trap. 2020-01-15 08:37:20 +01:00
bors[bot]
d350613f0c
Merge #1147
1147: Update logging to use `log`, add command line flag to toggle it r=MarkMcCaskey a=MarkMcCaskey

This PR:
- ports our logging to the [`log`](https://crates.io/crates/log) crate which is the de-facto standard way to do logging in Rust (it defines a trait which logging backends can implement (we can also implement our own at a later date using these traits)).  Another benefit of using the standard logging utilities is that we can now allow users of our libraries to filter and display log messages from Wasmer in a more natural way.
- adds a command line flag to enable/disable logging
- updates the `debug` and `trace` features to pass the correct static toggles to the `log` crate; judging by the `log` documentation these features need to only be set once
- copies and slightly modifies our `fern` configuration from wapm
- updates the makefile so that `make release` compiles out all log statements
- TODO: update CI to not print with color (may not be necessary actually)

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Here's some example output:

```
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::inodes
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::preopen_dirs
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::mapped_dirs
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::end
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_get: fd=3
[1579035881.810 DEBUG wasmer_wasi::state] in prestat_fd Fd { rights: 536870911, rights_inheriting: 536870911, flags: 0, offset: 0, open_flags: 1, inode: Index { index: 3, generation: 0 } }
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_dir_name: fd=3, path_len=2
[1579035881.810 DEBUG wasmer_wasi::syscalls] => result: "/"
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_fdstat_get: fd=3, buf_ptr=1048536
[1579035881.810 DEBUG wasmer_wasi::state] fdstat: Fd { rights: 536870911, rights_inheriting: 536870911, flags: 0, offset: 0, open_flags: 1, inode: Index { index: 3, generation: 0 } }
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_get: fd=4
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::environ_sizes_get
[1579035881.810 DEBUG wasmer_wasi::syscalls] env_var_count: 0, env_buf_size: 0
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_sizes_get
[1579035881.810 DEBUG wasmer_wasi::syscalls] => argc=3, argv_buf_size=92
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_get
[1579035881.810 DEBUG wasmer_wasi::syscalls] => args:
                   0: /Users/mark/.wasmer/globals/wapm_packages/mark/rust-example@0.1.11/wasi-example.wasm
                   1: -e
                   2: HQ+
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_sizes_get
[1579035881.811 DEBUG wasmer_wasi::syscalls] => argc=3, argv_buf_size=92
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::args_get
[1579035881.811 DEBUG wasmer_wasi::syscalls] => args:
                   0: /Users/mark/.wasmer/globals/wapm_packages/mark/rust-example@0.1.11/wasi-example.wasm
                   1: -e
                   2: HQ+
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::random_get buf_len: 16
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::fd_write: fd=1
Hello, world!

[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::fd_write: fd=1
HQ+
```


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-14 21:53:54 +00:00
Mark McCaskey
39025d0205 Check if printing to a terminal for color output 2020-01-14 13:50:48 -08:00
Mark McCaskey
286e5db370 Remove vestigial debug features from various crates 2020-01-14 13:03:19 -08:00
Mark McCaskey
12f7416a85 Update logging to use log, add command line flag to toggle it 2020-01-14 12:41:46 -08:00
Syrus
a933e10e5f Use api-docs proper path 2020-01-14 20:04:07 +01:00
Syrus
a54b95e3f4 Fix copying files 2020-01-14 19:32:00 +01:00
Syrus
d2097aa92d trying more 2020-01-14 18:58:02 +01:00
Syrus
5403b9822b Fixed makefile 2020-01-14 18:54:11 +01:00
Syrus
d0e9161104 Trying to test docs 2020-01-14 18:51:26 +01:00
Syrus
ed96f32e58 Fix publish dir 2020-01-14 16:50:01 +01:00
Syrus
52f45455f3 Try cargo doc all 2020-01-14 16:38:23 +01:00
Syrus
46b6601488 Fixed cargo doc to document only local packages 2020-01-14 16:31:44 +01:00
losfair
6dfd5916c2 Improve error message on exception. 2020-01-14 20:56:34 +08:00
Syrus
34e01bbf0b Trying to fix api-docs publishing 2020-01-14 13:49:20 +01:00
losfair
a45cbd6bbc Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-14 20:47:14 +08:00
Syrus
5c5bf311ce Trying to fix building docs 2020-01-14 13:35:06 +01:00
Syrus
41ab3fd5b4 Fixed azure issue 2020-01-14 13:20:41 +01:00
Syrus
220bbc9563 Trying to improve docs build pipeline 2020-01-14 13:17:47 +01:00
Syrus
dc8c1d825a Publishing GitHub Pages ***CI*** 2020-01-14 12:34:12 +01:00
Syrus
13de911759 Merge branch 'master' into feature/auto-doc-update
# Conflicts:
#	Makefile
2020-01-14 12:10:10 +01:00
Syrus Akbary
a8ed5b9d1a
Update README.md 2020-01-14 12:06:32 +01:00
Syrus Akbary
9a0f51f621
Merge branch 'master' into blake3 2020-01-14 10:33:13 +01:00
Syrus
1cd198a5a5 Use a 32 byte array instead of 64 one 2020-01-14 10:32:32 +01:00
bors[bot]
4099cc1984
Merge #1142
1142: doc(runtime-c-api) Setup Doxygen r=syrusakbary a=Hywan

With @MarkMcCaskey, we discussed generating the documentation of `wasmer-runtime-c-api` with [Doxygen](http://www.doxygen.nl/).

This patch does the following:

1. Set up a `doxyfile`, which is the configuration file for Doxygen.
2. Set up a `doc/header.html` and `doc/footer.html` files, because Doxygen HTML output is… well, not a master piece 😉.
3. Set up a `doc/css/wasmer.css` stylesheet. I tried to mimic Wasmer color scheme. Usually, I'm not a bad designer, but Doxygen HTML output is so “alembic-ed” that it makes customizing the CSS a real challenge for the very short period of time I've.

Anyway, I believe it's an acceptable first step.

To generate the documentation:

```sh
$ doxygen doxyfile
```

And then open `doc/html/index.html`.

It looks like this:

![Screen Shot 2020-01-13 at 15 20 09](https://user-images.githubusercontent.com/946104/72263046-692ea100-3618-11ea-9feb-6dfd3244d375.png)
![Screen Shot 2020-01-13 at 15 20 25](https://user-images.githubusercontent.com/946104/72263072-70ee4580-3618-11ea-941d-fa652bd7f14e.png)
![Screen Shot 2020-01-13 at 15 20 35](https://user-images.githubusercontent.com/946104/72263082-7481cc80-3618-11ea-81e7-f4da7b71d665.png)
![Screen Shot 2020-01-13 at 15 20 57](https://user-images.githubusercontent.com/946104/72263098-78155380-3618-11ea-9cfc-16b7695c9e89.png)

The next step is to publish the documentation on Github Pages, thoughts @syrusakbary?

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-14 08:08:06 +00:00
bors[bot]
220ad08337
Merge #1145
1145: Update io device file name r=MarkMcCaskey a=MarkMcCaskey

Small update

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-14 02:03:20 +00:00
Mark McCaskey
3fd1408cbc Update io device file name 2020-01-13 17:56:46 -08:00
Syrus Akbary
88d0dc5626
Merge pull request #1144 from Hywan/fix-runtime-c-api-build
fix(runtime-c-api) Remove duplicated line
2020-01-13 18:01:56 +01:00
Ivan Enderlin
6dbfa9d4a2 fix(runtime-c-api) Remove duplicated line.
A copy-paste error has been spotted!
2020-01-13 17:11:12 +01:00
Syrus
a1d8b9aa5b Move backend_id to static str 2020-01-13 15:40:09 +01:00
losfair
f4fb1077c9 Fix type of backend passed to push_code_version. 2020-01-13 22:39:04 +08:00
losfair
42e5e7881f Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-13 22:36:55 +08:00
Syrus Akbary
cb5cf00442
Update CHANGELOG.md 2020-01-13 15:14:56 +01:00
Ivan Enderlin
7df0bbcc1e doc(runtime-c-api) Setup Doxygen. 2020-01-13 15:14:30 +01:00
Syrus
fcb158b243 Fixed cache 2020-01-13 15:11:02 +01:00
Syrus
c45819de32 Remove unnecessary import 2020-01-13 14:59:50 +01:00
Syrus Akbary
3d00903054
Merge branch 'master' into blake3 2020-01-13 13:26:31 +01:00
bors[bot]
b27c35326c
Merge #1099
1099: Remove backend::Backend from runtime-core r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

This PR removes the dependency of a Backend in runtime-core. So it's agnostic and more backends can be plugged in easily.

Why this is important?
* By removing backends from wasmer-runtime-core we can make the runtime agnostic, so anyone can plug their own backend into Wasmer without needing to touch the main source code (V8, JavascriptCore, wasm3, ...).
* It simplifies the codebase and avoids code leaks from the backend to the runtime API.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-01-13 11:05:20 +00:00
Syrus
3892ea827d Fixed lint 2020-01-13 12:04:39 +01:00
Syrus
6c0568798f Added Blake3 changes into changelog 2020-01-13 12:02:07 +01:00
Syrus
661df38cf2 Use blake3 instead of blake2_simd 2020-01-13 11:58:31 +01:00
Syrus
846c632b50 Fixed runtime check 2020-01-13 10:17:37 +01:00
Syrus
4faa78b38c Fixed changelog link 2020-01-13 10:17:37 +01:00
Syrus
aa6189a06a Make all tests pass 2020-01-13 10:17:37 +01:00
dependabot-preview[bot]
22e35fc670 Bump cc from 1.0.48 to 1.0.50
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.48 to 1.0.50.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.48...1.0.50)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:37 +01:00
dependabot-preview[bot]
f18a4280a6 Bump regex from 1.3.1 to 1.3.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.3.1...1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:36 +01:00
dependabot-preview[bot]
00618e852e Bump parking_lot from 0.9.0 to 0.10.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.9.0...0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:36 +01:00
dependabot-preview[bot]
8fd143368d Bump getrandom from 0.1.13 to 0.1.14
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.13 to 0.1.14.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.13...v0.1.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 10:17:36 +01:00
Mark McCaskey
5b52589021 Update the experimental io device path to include /dev/ 2020-01-13 10:17:36 +01:00
Mark McCaskey
cc28804efe Update the name of experimental IO devices in fs 2020-01-13 10:17:36 +01:00
Syrus Akbary
da0d8b39c5
Merge pull request #1139 from wasmerio/dependabot/cargo/cc-1.0.50
Bump cc from 1.0.48 to 1.0.50
2020-01-13 10:10:51 +01:00
Syrus Akbary
0eb6ea0800
Merge pull request #1138 from wasmerio/dependabot/cargo/regex-1.3.3
Bump regex from 1.3.1 to 1.3.3
2020-01-13 10:10:38 +01:00
Syrus Akbary
10d9650d5f
Merge pull request #1136 from wasmerio/dependabot/cargo/parking_lot-0.10.0
Bump parking_lot from 0.9.0 to 0.10.0
2020-01-13 10:10:24 +01:00
Syrus Akbary
82a9881ccb
Merge pull request #1135 from wasmerio/dependabot/cargo/getrandom-0.1.14
Bump getrandom from 0.1.13 to 0.1.14
2020-01-13 10:10:12 +01:00
dependabot-preview[bot]
cbd5ed1916
Bump cc from 1.0.48 to 1.0.50
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.48 to 1.0.50.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.48...1.0.50)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:59:14 +00:00
dependabot-preview[bot]
25f75a0f98
Bump regex from 1.3.1 to 1.3.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.1 to 1.3.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.3.1...1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:58:45 +00:00
dependabot-preview[bot]
5364b2c308
Bump parking_lot from 0.9.0 to 0.10.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.9.0...0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:57:23 +00:00
dependabot-preview[bot]
1556e3090c
Bump getrandom from 0.1.13 to 0.1.14
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.1.13 to 0.1.14.
- [Release notes](https://github.com/rust-random/getrandom/releases)
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.1.13...v0.1.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-13 07:56:50 +00:00
Ivan Enderlin
176152e7d5 test(runtime-c-api) Remove a hardcoded value. 2020-01-13 07:46:48 +01:00
Ivan Enderlin
b5e96b8aa1 doc(changelog) Add #1133. 2020-01-13 07:40:33 +01:00
Ivan Enderlin
6e7d5baccc chore(runtime-c-api) Update C/C++ headers. 2020-01-13 07:39:04 +01:00
Ivan Enderlin
b494bd860d doc(runtime-c-api) Improve wasmer_import_func_new's documentation. 2020-01-13 07:35:57 +01:00
Ivan Enderlin
a506411eb5 doc(runtime-c-api) Improve documentation of wasmer_import_trap. 2020-01-13 07:35:37 +01:00
Ivan Enderlin
b45ead289f test(runtime-c-api) Test wasmer_import_trap. 2020-01-13 07:22:03 +01:00
Ivan Enderlin
8790f6dbc9 feat(runtime-c-api) Check pointers aren't null in wasmer_import_trap. 2020-01-13 07:20:06 +01:00
bors[bot]
95cc18ae8f
Merge #1134
1134: Update the name of experimental IO devices in fs r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-11 01:11:42 +00:00
Mark McCaskey
2fb9415e32 Update the experimental io device path to include /dev/ 2020-01-10 17:10:46 -08:00
Mark McCaskey
600f4ded9e Update the name of experimental IO devices in fs 2020-01-10 17:00:26 -08:00
Ivan Enderlin
4bf3d6dd41 test(runtime-c-api) Test wasmer_import_trap. 2020-01-10 15:14:52 +01:00
Ivan Enderlin
c7a4825bee doc(runtime-core) Update documentation. 2020-01-10 15:14:34 +01:00
Ivan Enderlin
684620435f chore(runtime-c-api) Update headers. 2020-01-10 15:14:18 +01:00
Ivan Enderlin
35459c2931 feat(runtime-c-api) Implement wasmer_import_trap.
The new `wasmer_import_trap` allows a host function to fail properly
with the Wasmer trapping API.
2020-01-10 15:13:30 +01:00
Ivan Enderlin
e913e8928f chore(runtime-c-api) Fix CS. 2020-01-10 15:12:56 +01:00
Ivan Enderlin
ec378597f1 chore(runtime-c-api) Update headers. 2020-01-10 14:49:14 +01:00
Syrus Akbary
9ca97706d7
Merge branch 'master' into backend-refactor 2020-01-10 13:41:49 +01:00
Syrus
f353ac00eb Remove unused backend flags 2020-01-10 13:40:21 +01:00
bors[bot]
50f3079d82
Merge #1121
1121: Add test for ImportObject's `allow_missing_functions` r=Hywan a=MarkMcCaskey

work in progress, testing to see if this test fails CI

resolves #1118 

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-01-10 10:16:32 +00:00
Ivan Enderlin
66574e3e27
Merge branch 'master' into fix/import-object-allow-missing 2020-01-10 11:16:09 +01:00
bors[bot]
be29b2e007
Merge #1128
1128: fix(runtime-core) Avoid crashing when missing host functions are allowed r=Hywan a=Hywan

Fix #1118. #1121 can be merged after

This PR fixes 2 things:

* When droping the import backing, check that `vm::FuncCtx` isn't null before dropping it,
* Use an `always_trap` as a placeholder host function when a host function is missing.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-01-10 09:23:58 +00:00
Ivan Enderlin
43742cf980 doc(changelog) Add #1128. 2020-01-10 10:18:51 +01:00
Ivan Enderlin
9b2f0fc635 chore(runtime-core) Avoid code duplication. 2020-01-10 10:15:26 +01:00
bors[bot]
57b6ad0600
Merge #1126
1126: Set default scale on fb window to fit screen r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-09 22:15:02 +00:00
bors[bot]
fab3b787eb
Merge #1130
1130: Add WindowClosed event to experimental fb r=MarkMcCaskey a=MarkMcCaskey

Allows things to behave properly and know when the window closes

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-09 20:25:36 +00:00
losfair
10da5bab6c Merge remote-tracking branch 'origin/master' into feature/unified-exceptions 2020-01-10 02:58:50 +08:00
losfair
9e2080def1 Run cargo fmt. 2020-01-10 02:54:50 +08:00
losfair
0a23327401 Emit exception table in singlepass. 2020-01-10 02:54:23 +08:00
losfair
8bf0c1966c Push code version for non-WASI entrypoints. 2020-01-10 02:53:31 +08:00
losfair
4b5b8976e9 Serialize/deserialize exception codes. 2020-01-10 02:53:08 +08:00
Mark McCaskey
b08b65913b Add WindowClosed event to experimental fb 2020-01-09 12:11:34 -05:00
Ivan Enderlin
c81e49a091 feat(runtime-core) Replace missing host function by always_trap. 2020-01-09 15:12:09 +01:00
Ivan Enderlin
6018aa32e1 fix(runtime-core) Drop vm::FuncCtx if not null. 2020-01-09 15:11:51 +01:00
Ivan Enderlin
19c3837881 feat(runtime-core) Create the always_trap host function. 2020-01-09 15:10:53 +01:00
Ivan Enderlin
cd6e4bdaee test(runtime) Fix CS. 2020-01-09 15:10:23 +01:00
bors[bot]
6370fd7b81
Merge #1123
1123: feat(runtime-c-api) Define the `DEPRECATED` C macro. r=Hywan a=Hywan

This PR defines a cross-compiler `DEPRECATED(message)` macro. It must
be used as follows in Rust:

```rust
/// This is a documentation.
/// cbindgen:prefix=DEPRECATED("This is a deprecation message.")
pub extern "C" fn wasmer_foo() -> c_uint {
    42
}
```

It will generate the following C header:

```c
/**
 * This is a documentation.
 */
DEPRECATED("This is a deprecation message.")
unsigned int wasmer_foo();
```

And once this code is used by a C compiler, it will print something
like this (example from Clang):

```
…/test.c:…:…: error: 'wasmer_foo' is deprecated: This is a deprecation message. [-Werror,-Wdeprecated-declarations]
    unsigned int x = wasmer_foo();
                     ^
…/wasmer.h:…:…: note: 'wasmer_foo' has been explicitly marked deprecated here
DEPRECATED("This is a deprecation message.")
^
…/wasmer.h:…:…: note: expanded from macro 'DEPRECATED'
```

This is required for further deprecations.

(cf https://github.com/eqrion/cbindgen/issues/408)

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
2020-01-09 13:11:52 +00:00
Ivan Enderlin
49401b7a9d
Merge branch 'master' into feat-runtime-c-api-deprecated 2020-01-09 14:11:30 +01:00
Mark McCaskey
f48a74e44a Set default scale on fb window to fit screen 2020-01-09 06:48:03 -05:00
Ivan Enderlin
7b6d8993e1 chore(runtime-c-api) Update C/C++ headers. 2020-01-09 10:17:34 +01:00
Ivan Enderlin
038fbc287d Merge branch 'feat-runtime-c-api-deprecated' of github.com:Hywan/wasmer into feat-runtime-c-api-deprecated 2020-01-09 10:16:41 +01:00
Ivan Enderlin
67b684ac85 feat(runtime-c-api) Improve DEPRECATED compatibility.
Clang can emulate GNUC or MSVC behaviors. So instead of detecting
whether Clang is used to compile the code, it's better to detect the
targeted features are available.

Code proposed by @nlewycky, thanks!
2020-01-09 10:13:22 +01:00
bors[bot]
8e6015f231
Merge #1124
1124: Update wapm submodule to 0.4.2 r=MarkMcCaskey a=MarkMcCaskey

Uses the updated wapm from the new release https://github.com/wasmerio/wapm-cli/releases/tag/0.4.2 which fixes a bug

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-08 18:42:01 +00:00
Mark McCaskey
34bf886883 Update wapm submodule to 0.4.2 2020-01-08 13:37:29 -05:00
losfair
f44517b9fb Look up exception tables in trap handler. 2020-01-09 01:42:50 +08:00
losfair
5c15ff9673 ExceptionCode and ExceptionTable. 2020-01-09 01:42:21 +08:00
Ivan Enderlin
c23eca25c0
Merge branch 'master' into feat-runtime-c-api-deprecated 2020-01-08 15:50:50 +01:00
Ivan Enderlin
4f691dde17 chore(runtime-c-api) Update headers. 2020-01-08 15:25:48 +01:00
Ivan Enderlin
b31a3dcdec feat(runtime-c-api) Define the DEPRECATED macro.
This PR defines a cross-compiler `DEPRECATED(message)` macro. It must
be used as follows in Rust:

```rust
/// This is a documentation.
/// cbindgen:prefix=DEPRECATED(This is a deprecation message.")
pub extern "C" fn wasmer_foo() -> c_uint {
    42
}
```

It will generate the following C header:

```c
/**
 * This is a documentation.
 */
DEPRECATED("This is a deprecation message.")
unsigned int wasmer_foo();
```

And once this code is used by a C compiler, it will print something
like this (example from Clang):

```
…/test.c:…:…: error: 'wasmer_foo' is deprecated: This is a deprecation message. [-Werror,-Wdeprecated-declarations]
    unsigned int x = wasmer_foo();
                     ^
…/wasmer.h:…:…: note: 'wasmer_foo' has been explicitly marked deprecated here
DEPRECATED("This is a deprecation message.")
^
…/wasmer.h:…:…: note: expanded from macro 'DEPRECATED'
```

This is required for further deprecations.
2020-01-08 15:02:57 +01:00
Mark McCaskey
078242b55b Add test for ImportObject's allow_missing_functions 2020-01-07 12:04:50 -05:00
Syrus Akbary
61cde95698
Merge pull request #1102 from wasmerio/dependabot/cargo/rayon-1.3.0
Bump rayon from 1.2.1 to 1.3.0
2020-01-07 16:38:39 +01:00
Syrus Akbary
3e5545f4c2
Merge pull request #1105 from wasmerio/dependabot/cargo/smallvec-1.1.0
Bump smallvec from 0.6.13 to 1.1.0
2020-01-07 16:38:27 +01:00
Syrus Akbary
b60c22937a
Merge pull request #1112 from wasmerio/dependabot/cargo/structopt-0.3.7
Bump structopt from 0.3.5 to 0.3.7
2020-01-07 16:38:13 +01:00
Syrus Akbary
0a8cfa5f97
Merge pull request #1114 from wasmerio/dependabot/cargo/blake2b_simd-0.5.10
Bump blake2b_simd from 0.5.9 to 0.5.10
2020-01-07 16:38:03 +01:00
Syrus Akbary
f7ce59db0f
Merge pull request #1115 from wasmerio/dependabot/cargo/generational-arena-0.2.7
Bump generational-arena from 0.2.6 to 0.2.7
2020-01-07 16:37:49 +01:00
Syrus
d544f5a80f Run formatting 2020-01-07 16:14:58 +01:00
Syrus
ee6949bcb4 Add checks back into makefile 2020-01-07 16:13:33 +01:00
Syrus
59945a8875 Use detault 2020-01-07 16:13:33 +01:00
Syrus
3b9cdc396d Recovered deleted tests 2020-01-07 16:13:33 +01:00
Syrus
63f1d6b7ba Fixed path variable name 2020-01-07 16:13:33 +01:00
Syrus
f967770ccf Fixed linting 2020-01-07 16:13:33 +01:00
Syrus
720d4ec99c Fix checks on binary 2020-01-07 16:13:33 +01:00
Syrus
8cff1adf5c Fix wasmer binary 2020-01-07 16:12:39 +01:00
Syrus
d36d883528 Fix lint 2020-01-07 16:12:39 +01:00
Syrus
e57677b63f Make cranelift optional for middleware 2020-01-07 16:12:39 +01:00
Syrus
ac0c5c93ce Fixed lint 2020-01-07 16:12:39 +01:00
Syrus
5d2ea93a89 Fixed changelog link 2020-01-07 16:12:39 +01:00
Syrus
0cb3df256d Removed unnecessary checks 2020-01-07 16:12:39 +01:00
Syrus
71be5bea16 Improved syntax 2020-01-07 16:12:39 +01:00
Syrus
f3b9ecbaea Remove backend specific features from root Cargo 2020-01-07 16:12:39 +01:00
Syrus
18421e3623 Make all tests pass 2020-01-07 16:12:39 +01:00
Syrus
d7154fe791 Remove Backend dependency 2020-01-07 16:12:39 +01:00
Syrus
d4e964519d Move requires pre validation into the ModuleCodeGenerator 2020-01-07 16:10:46 +01:00
Syrus
303d44cb0f Remove backend code 2020-01-07 16:10:46 +01:00
Syrus Akbary
94bcea909b
Merge pull request #1119 from Hywan/doc-runtime-c-api-typo
doc(runtime-c-api) Fix a typo.
2020-01-07 14:42:36 +01:00
Ivan Enderlin
0274668675 doc(runtime-c-api) Fix a typo. 2020-01-07 14:21:50 +01:00
dependabot-preview[bot]
8f694dab54
Bump rayon from 1.2.1 to 1.3.0
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.2.1...rayon-core-v1.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 20:59:17 +00:00
dependabot-preview[bot]
6e52685b64
Bump blake2b_simd from 0.5.9 to 0.5.10
Bumps [blake2b_simd](https://github.com/oconnor663/blake2_simd) from 0.5.9 to 0.5.10.
- [Release notes](https://github.com/oconnor663/blake2_simd/releases)
- [Commits](https://github.com/oconnor663/blake2_simd/compare/0.5.9...0.5.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 20:59:17 +00:00
dependabot-preview[bot]
37a3a15ea8
Bump generational-arena from 0.2.6 to 0.2.7
Bumps [generational-arena](https://github.com/fitzgen/generational-arena) from 0.2.6 to 0.2.7.
- [Release notes](https://github.com/fitzgen/generational-arena/releases)
- [Changelog](https://github.com/fitzgen/generational-arena/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/generational-arena/compare/0.2.6...0.2.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 20:59:14 +00:00
dependabot-preview[bot]
f134f01983
Bump smallvec from 0.6.13 to 1.1.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.1.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 20:59:13 +00:00
dependabot-preview[bot]
e6dd79a2fb
Bump structopt from 0.3.5 to 0.3.7
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.5 to 0.3.7.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.5...v0.3.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 20:59:11 +00:00
bors[bot]
9cf97aa02b
Merge #1117
1117: Improve formatting of error messages we display from wabt r=MarkMcCaskey a=MarkMcCaskey

Resolves #1107 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-01-06 20:38:28 +00:00
Mark McCaskey
d3d720babd Improve formatting of error messages we display from wabt 2020-01-06 15:30:30 -05:00
Syrus Akbary
d408831ed6
Merge pull request #1103 from wasmerio/dependabot/cargo/parking_lot-0.10.0
Bump parking_lot from 0.9.0 to 0.10.0
2019-12-30 11:30:11 +01:00
dependabot-preview[bot]
1e6149ed94
Bump parking_lot from 0.9.0 to 0.10.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.9.0...0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-23 07:38:11 +00:00
bors[bot]
afc3363e35
Merge #1101
1101: Add MIT license to crates that were missing it r=syrusakbary a=repi

Ran into a few crates in this repo with our license scanner that didn't have any license attached to them.

Added MIT to be consistent with the other crates. Please adjust if not correct.

Co-authored-by: Johan Andersson <repi@repi.se>
2019-12-22 16:14:42 +00:00
Johan Andersson
81f879565d Add MIT license to crates that were missing it
Ran into a few crates in this repo with our license scanner that didn't have any license attached to them.

Added MIT to be consistent with the other crates. Please adjust if not correct.
2019-12-22 12:28:33 +01:00
bors[bot]
f2f1a08e07
Merge #1100
1100: Fix unused import warning, deny more warnings. r=syrusakbary a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-22 03:19:41 +00:00
Nick Lewycky
1cffb90fea Fix unused import warning, deny more warnings. 2019-12-21 14:35:43 -08:00
bors[bot]
7390372eb6
Merge #1097
1097: Move inline breakpoint outside of runtime backend r=syrusakbary a=syrusakbary


<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
There was some code smell leaking inline breakpoint implementation into the runtime core backend instead of the compiler itself. This PR fixes it.

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
2019-12-21 05:13:50 +00:00
Syrus
ad82beffb4 Fixed tests 2019-12-20 21:11:55 -08:00
Syrus
a7764a6fd6 Simplified code 2019-12-20 20:49:32 -08:00
Syrus
7efda4da66 Added changes to changelog 2019-12-20 20:47:39 -08:00
Syrus
24a9814ba6 Remove unused imports 2019-12-20 20:47:03 -08:00
Syrus
afcd1d5b68 Fixed wasmer calls 2019-12-20 20:46:04 -08:00
Syrus
1a960a01ae Improved lint 2019-12-20 20:45:10 -08:00
Syrus
c4d70a6b75 Use Arc instead of Rc 2019-12-20 20:37:47 -08:00
Syrus
097353d0d4 Fix lint 2019-12-20 19:20:32 -08:00
Syrus
0f45bd4f0d Fixed tiering docs 2019-12-20 19:12:35 -08:00
Syrus
c143bc8fc8 Revert emscripten changes 2019-12-20 19:09:07 -08:00
Syrus
2404203ae4 Improved based on feedback 2019-12-20 19:03:49 -08:00
Syrus
527d7072b3 Remove unsafe transmute copy 2019-12-20 18:52:30 -08:00
Syrus
294cc28135 Move inline breakpoint outside of runtime backend
There was some code smell leaking inline breakpoint implementation into the runtime core backend instead of the compiler itself
2019-12-20 18:26:56 -08:00
bors[bot]
0419df937e
Merge #1095
1095: Update to cranelift 0.52 r=nlewycky a=nlewycky

# Description
Update to cranelift 0.52.

To use our wasmer branch of cranelift, we point to its path on git. Per @syrusakbary , we don't want to push updated wasmer-clif crates until we're ready to release the matching wasmer that will use them.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-21 01:45:45 +00:00
Nick Lewycky
a0739b6355 Add changelog entry. 2019-12-20 17:16:54 -08:00
Nick Lewycky
c8e79178ee Update to cranelift 0.52 (wasmer branch) 2019-12-20 17:16:54 -08:00
Mark McCaskey
fe969be612 Update wasmparser to version 0.45.0 2019-12-20 17:16:54 -08:00
Mark McCaskey
8cddea341b Update to 0.45.0 wasmparser Operator names in llvm-backend 2019-12-20 17:16:54 -08:00
Mark McCaskey
adecb36d15 Update to 0.45.0 wasmparser Operator names in singlepass-backend 2019-12-20 17:15:38 -08:00
Nick Lewycky
c2f287e65b Update to cranelift 0.51. 2019-12-20 17:10:36 -08:00
bors[bot]
d5d82e2508
Merge #1096
1096: Add TBAA labels to initialization (default and copy) of locals. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-21 01:06:23 +00:00
Nick Lewycky
cca73c0a6f Add TBAA labels to initialization (default and copy) of locals. 2019-12-20 17:02:58 -08:00
bors[bot]
4018494f6e
Merge #1071
1071: Add support for non-trapping float-to-int conversions. r=nlewycky a=nlewycky

# Description
Rewrites LLVM implementation of non-trapping float-to-int conversions. LLVM's conversion operations produce unspecified output when the input floats are out of range for the conversion.

Add implementation to singlepass for both x86-64 and AArch64.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-21 00:23:31 +00:00
Nick Lewycky
bba0129150 Remove comments with register names that might not be right and don't really matter. 2019-12-20 16:20:58 -08:00
Nick Lewycky
e738a9f2b5 Name the magic constants in the singlepass backend. 2019-12-20 16:20:58 -08:00
Nick Lewycky
f00283ab03 Name the magic constants in the LLVM backend. 2019-12-20 16:20:58 -08:00
Nick Lewycky
56fd66403c Update changelog again, to move entry to new unreleased section since there's been a release. 2019-12-20 16:20:58 -08:00
Nick Lewycky
f8d792cf04 Add changelog entry. 2019-12-20 16:20:58 -08:00
Nick Lewycky
b7929e6561 Add support for non-trapping float to int conversions in singlepass+AArch64. 2019-12-20 16:20:58 -08:00
Nick Lewycky
32ed6f2c10 Enable non-trapping float to int conversions by default. 2019-12-20 16:20:58 -08:00
Nick Lewycky
d52c193e84 Finish implementation of trunc_sat in singlepass x86-64. 2019-12-20 16:20:58 -08:00
Nick Lewycky
442c40f5f1 Initial implementatio of trunc-sat instructions in singlepass. 27 test failures. 2019-12-20 16:20:58 -08:00
Nick Lewycky
6fe2f434c6 Add tests for non-trapping float to int conversions.
This breaks all of conversions.wast on singlepass. LLVM and Cranelift pass.
2019-12-20 16:20:58 -08:00
Nick Lewycky
0cfe08fff3 Correct implementation of non-trapping float to int conversions in the llvm backend. 2019-12-20 16:20:58 -08:00
Nick Lewycky
5b35313099 Use type traits to ensure that the float and int types match in trunc_sat. 2019-12-20 16:20:58 -08:00
bors[bot]
fa29a1b9f2
Merge #1092
1092: Add function to get nul-terminated strings from memory r=MarkMcCaskey a=srenatus

## Description

This is meant to fix #1086.

 I'm a bit new to this -- is this how you'd do it? Happy to take directions! 😃 

I've added a note regarding the special case in the comment.

Are there existing tests to expand?

## Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Stephan Renatus <srenatus@chef.io>
2019-12-20 21:08:01 +00:00
Stephan Renatus
782be5b51a Add function to get nul-terminated strings from memory
Fixes #1086.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-12-20 21:53:08 +01:00
Syrus Akbary
957bfd6add
Merge pull request #1093 from wasmerio/fix/update-page-size
Update page_size crate
2019-12-20 09:33:53 -08:00
bors[bot]
6672bc1f7a
Merge #1026
1026: Bump smallvec from 0.6.13 to 1.0.0 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.0.0.
<details>
<summary>Release notes</summary>

*Sourced from [smallvec's releases](https://github.com/servo/rust-smallvec/releases).*

> ## v1.0.0
>  * Requires Rust 1.36 or later.
>  * [breaking change] Use `MaybeUninit` to avoid possible undefined behavior ([#162](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/162), [#170](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/170)).
>  * [breaking change] The `drain` method now takes a range argument, just like the standard `Vec::drain` ([#145](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/145)).
>  * [breaking change] Remove the `unreachable` function and replace it with the new standard `unreachable_unchecked` function ([#164](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/164)).
>  * [breaking change] Use `no_std` by default. This crate depends only on `core` and `alloc` by default. If the optional `write` feature is enabled then it depends on `std` so that `SmallVec<[u8;_]>` can implement the `std::io::Write` trait ([#173](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/173)).
>  * [breaking change] Remove the deprecated `VecLike` trait ([#165](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/165)).
>  * Add support for 96-element small vectors, `SmallVec<[T; 96]>` ([#163](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/163)).
>  * Iterators now implement `FusedIterator` ([#172](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/172)).
>  * Indexing now uses the standard `SliceIndex` trait ([#166](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/166)).
>  * Add automatic fuzz testing and MIRI testing ([#168](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/168), [#162](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/162)).
>  * Update syntax and formatting to Rust 2018 standard ([#174](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/174), [#167](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/167)).
> 
</details>
<details>
<summary>Commits</summary>

- [`34c2628`](34c26282c4) Auto merge of [#175](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/175) - mbrubeck:one, r=jdm
- [`523a6dc`](523a6dc919) Version 1.0.0
- [`a2c0504`](a2c0504511) Auto merge of [#174](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/174) - mbrubeck:2018, r=jdm
- [`a51059c`](a51059cd38) Update to Rust 2018 edition
- [`01917a6`](01917a6b1c) Auto merge of [#168](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/168) - dpc:fuzz, r=mbrubeck
- [`a3ba738`](a3ba738ce6) Add a fake stub input case for afl fuzzer
- [`85c54a5`](85c54a5689) Add simple fuzzing
- [`b2c9c65`](b2c9c65129) Auto merge of [#173](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/173) - mbrubeck:std, r=emilio
- [`fffb185`](fffb185d4f) Use no_std by default
- [`af73fbd`](af73fbdc27) Auto merge of [#172](https://github-redirect.dependabot.com/servo/rust-smallvec/issues/172) - mbrubeck:fused, r=mbrubeck
- Additional commits viewable in [compare view](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.0.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=smallvec&package-manager=cargo&previous-version=0.6.13&new-version=1.0.0)](https://dependabot.com/compatibility-score.html?dependency-name=smallvec&package-manager=cargo&previous-version=0.6.13&new-version=1.0.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-12-20 16:31:15 +00:00
Mark McCaskey
b12f346dad Update page_size crate 2019-12-20 10:57:43 -05:00
bors[bot]
572399dce8
Merge #1089
1089: Add misc doc link fixes and update old comment r=MarkMcCaskey a=MarkMcCaskey

I spent way too long trying to make things work, `#[doc(no_inline)]`, adding doc comments on top of things with doc comments, and linking in the context of inlining are way harder than they seem like they should be 🙀 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-19 23:50:07 +00:00
bors[bot]
823c699ef2
Merge #1090
1090: Fix plugin example, add examples to test recipe r=syrusakbary a=MarkMcCaskey

This was reported [on spectrum](https://spectrum.chat/wasmer/general/failure-running-plugin-sample-on-mac~58c72ff0-47cd-4158-8069-fb726d7bb5dd).  This PR fixes the issue and adds it to `test` so we test it in CI.

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-19 23:10:25 +00:00
Mark McCaskey
ca52265a1c Fix plugin example, add examples to test recipe 2019-12-19 16:32:28 -05:00
Mark McCaskey
ad8945a555 Add misc doc link fixes and update old comment 2019-12-19 16:22:51 -05:00
Syrus
0daaa75a70 Revert incorrect toolchain changes from ”Fix azure pipelines release"
This reverts partially the commit c88196355dacc4009b2292d8d969d6d44dd8dd9a.
2019-12-19 11:57:20 -08:00
Syrus Akbary
c88196355d
Fix azure pipelines release 2019-12-19 11:54:42 -08:00
dependabot-preview[bot]
61a30804b3
Bump smallvec from 0.6.13 to 1.0.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 0.6.13 to 1.0.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.13...v1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-19 19:54:26 +00:00
bors[bot]
c96559305d
Merge #1087
1087: Update stable Rust to 1.39.0; pin nightly to 2019-12-19 r=MarkMcCaskey a=MarkMcCaskey

Both of these should speed up compile times:

The new stable has better parallelization and the new nightly has [new parallelization features](https://internals.rust-lang.org/t/help-test-parallel-rustc/11503)

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-19 19:21:37 +00:00
Mark McCaskey
3e3fe9ac6a Update Travis CI nightly version to 2019-12-19 2019-12-19 14:20:42 -05:00
Mark McCaskey
5888f44e95 Cargo fmt with Rust 1.39.0 2019-12-19 14:06:27 -05:00
Mark McCaskey
bb9cb4e90b Update stable Rust to 1.39.0; pin nightly to 2019-12-19 2019-12-19 14:00:26 -05:00
bors[bot]
6fb52e812e
Merge #1084
1084: Prepare for 0.12.0 release r=MarkMcCaskey a=MarkMcCaskey

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-19 16:43:39 +00:00
bors[bot]
096ea7ca97
Merge #1081
1081: Remove type_to_llvm_int_only, only use type_to_llvm. r=syrusakbary a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-18 23:08:18 +00:00
Syrus Akbary
10dccd9556
Merge branch 'master' into feature/llvm-use-floats 2019-12-18 15:07:43 -08:00
Mark McCaskey
6a74b7e994 Prepare for 0.12.0 release 2019-12-18 17:24:29 -05:00
bors[bot]
7083ff9e85
Merge #1083
1083: Add experimental IO devices r=MarkMcCaskey a=MarkMcCaskey

Adds some private stuff for us to experiment with


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Aaron Turner <aaron@aaronthedev.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-18 21:34:11 +00:00
Mark McCaskey
81ece2bf7a Enable IO devices for CI's build 2019-12-18 16:31:40 -05:00
Syrus Akbary
3deaf3e525
Merge pull request #1082 from wasmerio/feature/travis-can-retry
Add retry logic to Travis CI
2019-12-18 12:51:12 -08:00
Mark McCaskey
caa75fa157 Merge branch 'master' into wat 2019-12-18 15:42:14 -05:00
Mark McCaskey
6201671791 Add retry logic to Travis CI 2019-12-18 15:36:27 -05:00
Mark McCaskey
7d77511ad5 Additional clean up, cargo update to fix merge issue 2019-12-18 15:24:42 -05:00
Nick Lewycky
5d0429989a Remove type_to_llvm_int_only, only use type_to_llvm. 2019-12-18 11:53:48 -08:00
Mark McCaskey
4539ef44d0 Rename to experimental-io-devices and clean up for release 2019-12-18 14:10:54 -05:00
Syrus Akbary
09dbb49f84
Merge pull request #1079 from srenatus/sr/fix-markup
docs: fix markup runtime-core docs
2019-12-18 08:39:41 -08:00
Stephan Renatus
b5b8484f6a docs: fix markup runtime-core docs
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-12-18 15:06:46 +01:00
bors[bot]
6229346dd2
Merge #1078
1078: Add more parameters to Func r=Hywan a=Jasper-Bekkers

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
We ran into the issue that we needed to pass more then the available number of parameters to wasm, so I've extended the parameter count for `Func` to have max 26 parameters now.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Jasper-Bekkers <bekkers@gmail.com>
2019-12-18 12:56:20 +00:00
Jasper-Bekkers
22b3a06b40 Skip formatting test_func_arity_n! invocations with more then 15 parameters 2019-12-18 13:22:22 +01:00
Jasper-Bekkers
52440b66f3 Add pull request to CHANGELOG.md 2019-12-18 12:43:06 +01:00
Jasper-Bekkers
ee2e595e5b Add more parameters to Func 2019-12-18 12:36:19 +01:00
bors[bot]
49c512b2c5
Merge #1075
1075: Add include guards for WASI APIs in runtime-c-api r=syrusakbary a=MarkMcCaskey

Improves correctness, but the readability does suffer.

In the future we should probably have separate header files or find a way to merge the conditional includes

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-18 03:15:33 +00:00
bors[bot]
d3d328189f
Merge #1077
1077: Improve some doc comments relating to type-safe indexing r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-18 00:51:46 +00:00
Mark McCaskey
13b097e8c3 Improve the wording of typed index doc comments. 2019-12-17 19:10:36 -05:00
bors[bot]
ca0cb6a182
Merge #1076
1076: Use function defined in wasmer-runtime-core instead of llvm-backend's own copy of it. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-18 00:03:54 +00:00
Mark McCaskey
d165a85743 Improve some doc comments relating to type-safe indexing 2019-12-17 18:45:07 -05:00
Nick Lewycky
6a0a4390c1 Use function defined in wasmer-runtime-core instead of our own copy of it. 2019-12-17 15:12:54 -08:00
Mark McCaskey
6618750ebd Add include guards for WASI APIs in runtime-c-api 2019-12-17 16:25:26 -05:00
bors[bot]
f9bb579c05
Merge #1062
1062: Add emscripten functions and types to the C API r=MarkMcCaskey a=MarkMcCaskey

resolves #574 

Left to do:
- [x] Add tests
- [x] Add memory set up, etc (need to break up monolithic ("run" function in wasmer_emscripten into pieces)
- [x] Add passing args, etc

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-17 19:20:20 +00:00
Syrus Akbary
83fded4f20
Merge branch 'master' into feature/emscripten-in-c-api 2019-12-17 10:54:21 -08:00
bors[bot]
971f4e3e88
Merge #1068
1068: Various cleanups for the singlepass backend on AArch64. r=losfair a=losfair

ref: https://github.com/wasmerio/wasmer/pull/713

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-12-17 15:28:47 +00:00
losfair
1681af7e1d Merge remote-tracking branch 'origin/master' into fix/aarch64-cleanup 2019-12-17 23:27:53 +08:00
bors[bot]
c02846a147
Merge #1069
1069: Add fn for splitting borrow of memory & data in Ctx, use in WASI r=MarkMcCaskey a=MarkMcCaskey

Fixes a soundness issue / some undefined behavior

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
2019-12-17 00:55:56 +00:00
Mark McCaskey
3a2881e85c Add split borrow memory/data from Ctx to changelog 2019-12-16 19:55:13 -05:00
Mark McCaskey
bb90cffac9 Address feedback; improve emscripten fn names in C API 2019-12-16 19:43:57 -05:00
Mark McCaskey
2819821ab7
Fix typo in doc comment
Co-Authored-By: nlewycky <nick@wasmer.io>
2019-12-16 16:37:34 -08:00
Syrus Akbary
9dd8326c1b
Merge pull request #1065 from wasmerio/dependabot/cargo/log-0.4.10
Bump log from 0.4.8 to 0.4.10
2019-12-16 16:30:30 -08:00
Syrus Akbary
21ac9fde23
Merge branch 'master' into dependabot/cargo/log-0.4.10 2019-12-16 16:30:21 -08:00
Syrus Akbary
efa37b6ad4
Merge pull request #1064 from wasmerio/dependabot/cargo/serde-1.0.104
Bump serde from 1.0.103 to 1.0.104
2019-12-16 16:29:33 -08:00
Syrus Akbary
f9d95131dd
Merge pull request #1066 from wasmerio/dependabot/cargo/bincode-1.2.1
Bump bincode from 1.2.0 to 1.2.1
2019-12-16 16:29:17 -08:00
bors[bot]
a8497d07fb
Merge #1072
1072: Add minor changes to runtime/vm doc comments + make fns const fns r=syrusakbary a=MarkMcCaskey

Slightly improves readability of docs and makes more functions `const fn`

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-16 23:40:38 +00:00
Mark McCaskey
9ccb59eae5 Add minor changes to runtime/vm doc comments + make fns const fns 2019-12-16 18:27:37 -05:00
Mark McCaskey
15c52fd743 Update doc comment on borrow splitting ctx fn 2019-12-16 18:16:20 -05:00
Mark McCaskey
cd0b4a3d7f Add capi emscripten test to test-capi recipe 2019-12-16 18:07:07 -05:00
Mark McCaskey
a2b47bd591 Update changelog, clean up, fix test 2019-12-16 18:06:37 -05:00
dependabot-preview[bot]
1e1ec83738
Bump log from 0.4.8 to 0.4.10
Bumps [log](https://github.com/rust-lang/log) from 0.4.8 to 0.4.10.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.8...0.4.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 22:37:30 +00:00
dependabot-preview[bot]
1ebfecad26
Bump serde from 1.0.103 to 1.0.104
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.103...v1.0.104)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 22:37:28 +00:00
dependabot-preview[bot]
de74719b92
Bump bincode from 1.2.0 to 1.2.1
Bumps [bincode](https://github.com/servo/bincode) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/servo/bincode/releases)
- [Commits](https://github.com/servo/bincode/compare/v1.2.0...v1.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 22:37:26 +00:00
bors[bot]
bedf707419
Merge #1070
1070: Update Inkwell r=MarkMcCaskey a=MarkMcCaskey

Updates inkwell which removes the networking dep from building Inkwell -- this should speed up our CI

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-16 22:00:05 +00:00
Mark McCaskey
05012f9514 Update Inkwell 2019-12-16 16:51:33 -05:00
Mark McCaskey
06d4897d11
Merge branch 'master' into feature/emscripten-in-c-api 2019-12-16 13:50:12 -08:00
Mark McCaskey
bb344c1ab1 Add fn for splitting borrow of memory & data in Ctx, use in WASI 2019-12-16 16:48:52 -05:00
bors[bot]
76800c7367
Merge #1032
1032: Fix abort signature in emscripten ABI r=MarkMcCaskey a=MarkMcCaskey

Needs tests; this is preventing python on wapm from working

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-16 20:48:03 +00:00
Mark McCaskey
e86b3941d0 Update Emscripten API layout; expose inner parts to to C API; add test 2019-12-16 15:45:28 -05:00
losfair
f9928752ba Update changelog. 2019-12-17 00:42:26 +08:00
losfair
912c2f8996 Run cargo fmt. 2019-12-17 00:36:00 +08:00
losfair
5521352f52 singlepass: Use a valid instruction as the inline breakpoint marker. (AArch64) 2019-12-17 00:33:18 +08:00
losfair
4d7eec10e9 fault, state: Cleanup and keep consistent with backend. 2019-12-17 00:32:26 +08:00
losfair
57615e5673 runtime-core/backend: Add comments and cleanup. 2019-12-17 00:31:47 +08:00
bors[bot]
598fbfa44a
Merge #1063
1063: Add more doc comments to our WASI implementation r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-14 01:13:40 +00:00
Mark McCaskey
24e0e34fb2 Add more doc comments to our WASI implementation 2019-12-13 17:11:13 -08:00
bors[bot]
e749029a3b
Merge #1044
1044: Initial commit for support of AArch64 in the llvm backend. r=syrusakbary a=nlewycky

# Description
Enables AArch64 in the llvm backend, and inkwell when the target_arch is aarch64. Adds relevant failing spectests to the excludes.txt.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-13 22:08:27 +00:00
Syrus Akbary
243e0b5e2c
Trying to fix Windows LLVM - 3rd intent 2019-12-13 14:07:59 -08:00
Mark McCaskey
f1c95a81ab Add foundational emscripten functions and types to C API 2019-12-13 14:02:48 -08:00
Syrus Akbary
963494080f
Trying to fix Windows LLVM Installation 2019-12-13 13:57:24 -08:00
Syrus Akbary
952309a36b
Merge branch 'master' into feature/llvm-on-arm 2019-12-13 13:03:51 -08:00
Syrus Akbary
b84ff0e293
Trying to fix Win64 LLVM release for ARM 2019-12-13 13:03:27 -08:00
bors[bot]
17aecf9541
Merge #1060
1060: Test the capi with multiple backends r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

This PR updates the codebase to test the capi with multiple backends.
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-13 19:54:21 +00:00
Syrus
6946d6883a Install LLVM for the CAPI 2019-12-13 11:53:31 -08:00
Syrus Akbary
4aafa45a7a
Merge branch 'master' into capi-multiple-backends 2019-12-12 17:06:10 -08:00
Syrus
8a2a429a2d Added changes to the changelog 2019-12-12 17:05:36 -08:00
Syrus
39f5a79254 Test the capi with multiple backends 2019-12-12 16:38:58 -08:00
bors[bot]
22dcbcc074
Merge #1059
1059: Add doc comments for WASI FD associated constants r=MarkMcCaskey a=MarkMcCaskey

I want to try out something I'm going to call "daily docs" where I write documentation for one thing every day

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-12 23:57:35 +00:00
Mark McCaskey
c11d19e759 Add doc comments for WASI FD associated constants 2019-12-12 15:48:58 -08:00
bors[bot]
ba29483260
Merge #1058
1058: Fix issue 1057 + improve llvm/state.rs code r=syrusakbary a=pventuzelo

# Description

This pull request is doing:
- Fix issue https://github.com/wasmerio/wasmer/issues/1057 (subtraction overflow panic in State::peek1_extra) by using `checked_sub`
- replace other part of `state.rs` subject to potential substration overflow with `checked_sub`
- add more detail on the Errors messages in `state.rs`
- rename some variable for better understanding of the code.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-12 20:28:01 +00:00
Syrus Akbary
b84aff77f7
Merge branch 'master' into ventuzelo/fix-1057-substracte-overflow-peek1 2019-12-12 12:27:35 -08:00
Mark McCaskey
efaae9f12f Update folder path 2019-12-12 12:00:30 -08:00
Mark McCaskey
dd6c458720 Add KeyRelease, prevent key repeat, update minifb 2019-12-12 11:51:01 -08:00
bors[bot]
18318c2262
Merge #858
858: [fix 857] panic when target module don't have exported _start function r=syrusakbary a=pventuzelo

# Description

Fix #857 
* replace `expect` by `map_err` for `loader`
* replace `expect` by `map_err` in other part of `wasmer.rs`

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
2019-12-11 16:49:44 +00:00
Patrick Ventuzelo
aa13337dae add changelog entry 2019-12-11 15:34:01 +01:00
Patrick Ventuzelo
6189c9ae54 rename some variable, add more precise error message, use checked_sub everywhere needed in state.rs 2019-12-11 15:25:21 +01:00
Patrick Ventuzelo
3836b544b6
update changelog 2019-12-11 10:46:42 +01:00
Patrick Ventuzelo
c578150e1c
Merge branch 'master' into ventuzelo/fix-857-panic-loader-parameter 2019-12-11 10:45:55 +01:00
Syrus Akbary
ca03402207
Merge pull request #1047 from wasmerio/dependabot/cargo/serde_bytes-0.11.3
Bump serde_bytes from 0.11.2 to 0.11.3
2019-12-11 00:24:06 -08:00
Syrus Akbary
36b2dc417b
Merge pull request #1048 from wasmerio/dependabot/cargo/cc-1.0.48
Bump cc from 1.0.47 to 1.0.48
2019-12-11 00:23:54 -08:00
dependabot-preview[bot]
52cb3a18a4
Bump cc from 1.0.47 to 1.0.48
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.47 to 1.0.48.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.47...1.0.48)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 02:04:10 +00:00
dependabot-preview[bot]
499a408eff
Bump serde_bytes from 0.11.2 to 0.11.3
Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.2 to 0.11.3.
- [Release notes](https://github.com/serde-rs/bytes/releases)
- [Commits](https://github.com/serde-rs/bytes/compare/0.11.2...0.11.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 02:04:08 +00:00
bors[bot]
b9f8aace79
Merge #1056
1056: Integrate Ivan's arg parsing code into --invoke r=syrusakbary a=MarkMcCaskey

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>

Because #281 is on a branch on a fork, I made a new branch.

Does arg parsing when using `--invoke`


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-11 02:02:39 +00:00
Syrus Akbary
5aa70a8ae4
Update CHANGELOG.md 2019-12-10 17:57:26 -08:00
Syrus Akbary
92fcce2c21
Merge branch 'master' into feature/invoke-arg-parsing 2019-12-10 17:55:24 -08:00
Mark McCaskey
bc8d5a542c Return parse error strings rather than printing them in invoke parse 2019-12-10 17:37:22 -08:00
bors[bot]
3489001b79
Merge #1027
1027: Bump libc from 0.2.65 to 0.2.66 r=nlewycky a=dependabot-preview[bot]

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.65 to 0.2.66.
<details>
<summary>Commits</summary>

- [`4f11029`](4f11029a68) Bump patch version to 0.2.66
- [`bba019b`](bba019bff5) Auto merge of [#1610](https://github-redirect.dependabot.com/rust-lang/libc/issues/1610) - GrayJack:utmp_netbsd, r=gnzlbg
- [`ea0a54a`](ea0a54a661) Auto merge of [#1608](https://github-redirect.dependabot.com/rust-lang/libc/issues/1608) - lzutao:netbsd-mut-pthread_setname_np, r=gnzlbg
- [`42289eb`](42289eb64f) Implement utmp for NetBSD
- [`cfd561c`](cfd561c289) Auto merge of [#1605](https://github-redirect.dependabot.com/rust-lang/libc/issues/1605) - zvirja:fix-mipsel-unknown-linux-uclibc, r=gnzlbg
- [`51ae96a`](51ae96a5b0) Auto merge of [#1576](https://github-redirect.dependabot.com/rust-lang/libc/issues/1576) - GrayJack:utmpx_netbsd, r=gnzlbg
- [`096d868`](096d868a2f) Auto merge of [#1584](https://github-redirect.dependabot.com/rust-lang/libc/issues/1584) - psumbera:master, r=gnzlbg
- [`88f6587`](88f6587631) Auto merge of [#1607](https://github-redirect.dependabot.com/rust-lang/libc/issues/1607) - jclulow:futimens, r=gnzlbg
- [`5130285`](5130285ccd) Auto merge of [#1606](https://github-redirect.dependabot.com/rust-lang/libc/issues/1606) - msizanoen1:riscv, r=gnzlbg
- [`a06978b`](a06978b7c0) Fix breakage due to [rust-lang/cargo#7560](https://github-redirect.dependabot.com/rust-lang/cargo/pull/7560) and rust-lan...
- Additional commits viewable in [compare view](https://github.com/rust-lang/libc/compare/0.2.65...0.2.66)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.65&new-version=0.2.66)](https://dependabot.com/compatibility-score.html?dependency-name=libc&package-manager=cargo&previous-version=0.2.65&new-version=0.2.66)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-12-11 01:12:38 +00:00
Mark McCaskey
0a9c41b313 Integrate Ivan's arg parsing code into --invoke
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-12-10 17:12:35 -08:00
bors[bot]
19937ce154
Merge #1054
1054: Improve wasmer invoke function r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
Prior to this PR, when executing wasmer, we will have this in the stdout:
 
```bash
➜  wasmer fib32.wasm --invoke fib 30
main() returned: [I32(832040)]
```

Note that it says `main()` returned even if the function called is `fib`.
This PR fixes this and improves the messaging also for WASI invoked functions

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-11 00:22:57 +00:00
Syrus Akbary
55c7df2af6
Merge branch 'master' into invoke-print-result 2019-12-10 16:22:30 -08:00
Syrus Akbary
c783b7ce90
Merge pull request #1055 from wasmerio/fix/arm-ci-should-block-shipping
Add ARM CI to bors's list
2019-12-10 16:15:11 -08:00
Mark McCaskey
727ea3ba45 Add ARM CI to bors's list 2019-12-10 16:13:09 -08:00
Syrus Akbary
6364c56d63
Update CHANGELOG.md 2019-12-10 16:12:56 -08:00
Syrus Akbary
8e4fdcf5f1
Update src/bin/wasmer.rs 2019-12-10 16:10:33 -08:00
Syrus Akbary
a52fadf54e
Improve wasmer invoke function 2019-12-10 16:07:14 -08:00
bors[bot]
8a13917ec5
Merge #1053
1053: For RuntimeError and breakpoints, use Box<Any + Send> instead of Box<Any>. r=syrusakbary a=nlewycky

# Description
For RuntimeError and breakpoints, use Box<Any + Send> instead of Box\<Any\>.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file

Fixes #1049 

Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-12-10 22:00:02 +00:00
Syrus Akbary
298adfd338
Merge branch 'master' into feature/runtime-error-send 2019-12-10 13:59:12 -08:00
Nick Lewycky
5198c7ed50 Add changelog entry. 2019-12-10 13:24:59 -08:00
bors[bot]
7da70a3d34
Merge #1052
1052: Fix issue #1051 + replace assert, unreachable in singlepass codegen code r=syrusakbary a=pventuzelo

# Description

This pull request: 
- fix the issue #1051 
- replace `asserts` by Errors 
- replace `unreachable!` by Errors 
- Improve Error handling in singlepass codegen code

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
2019-12-10 20:24:42 +00:00
Mark McCaskey
2dcb37b4be Update key codes to be somewhat similar to deprecated web API 2019-12-10 11:14:59 -08:00
Patrick Ventuzelo
0cda11f632
Merge branch 'master' into ventuzelo/fix_unwrap_panic_singlepass 2019-12-10 09:12:17 +01:00
Nick Lewycky
0a278c55ee For error handling and breakpoints, use Box<Any + Send> instead of Box<Any>. 2019-12-09 21:00:01 -08:00
bors[bot]
12daaba3fd
Merge #1050
1050: feat(github) Attach C & C++ headers to releases r=syrusakbary a=Hywan

This patch copies the generated C and C++ headers of `wasmer-runtime-c-api` in the `artifacts` directory, so that they are attached to releases as assets.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-12-10 00:37:37 +00:00
Patrick Ventuzelo
ae568686cb add changelog entry 2019-12-09 15:48:43 +01:00
Patrick Ventuzelo
a0c628c063 fix unwrap bug + replace assert, unreachable in singlepass codegen 2019-12-09 15:18:08 +01:00
Ivan Enderlin
03082a6960 doc(changelog) Add #1050. 2019-12-09 13:41:35 +01:00
Ivan Enderlin
4a27dd34a2 feat(github) Attach C & C++ headers to releases. 2019-12-09 13:39:21 +01:00
bors[bot]
71b342e5b1
Merge #1045
1045: super:: in this case is just crate:: in disguise. r=MarkMcCaskey a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-07 04:48:32 +00:00
Nick Lewycky
f3ab59eace Don't try to initialize a target whose inkwell feature flag was not enabled. 2019-12-06 20:01:20 -08:00
Nick Lewycky
d227f19f8d super:: in this case is just crate:: in disguise. 2019-12-06 17:51:15 -08:00
Nick Lewycky
4f39102aab Fix 'make spectests' and 'make llvm' to use those backends when running the runtime-core-tests. 2019-12-06 17:23:42 -08:00
Nick Lewycky
7162906297 Initial commit of AArch64 support for the llvm backend. 2019-12-06 17:23:39 -08:00
bors[bot]
a180721eb9
Merge #1042
1042: Make regression test work in release builds too. r=nlewycky a=nlewycky

Fix this regression test to detect the bug it was looking for in release builds too.

This bug triggered an assertion failure in debug, and by examining the pre-opt IR, we can check for the bug in release mode too.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-06 23:36:48 +00:00
dependabot-preview[bot]
87ef0d6f25
Bump libc from 0.2.65 to 0.2.66
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.65 to 0.2.66.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.65...0.2.66)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-06 22:09:04 +00:00
bors[bot]
2139357021
Merge #709
709: new feature flag: `deterministic` r=MarkMcCaskey a=YaronWittenstein

The motivation for the PR is for introducing a new feature flag called `deterministic`.

When `deterministic` will be enabled (turned-off by default) it'll guarantee deterministic
execution of wasm programs across different hardware/circumstances.

This is critical for Blockchain projects that require execution to be deterministic
in order to reach a consensus of the state transition of each smart-contract transaction.

Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Yaron Wittenstein <yaronwittenstein@users.noreply.github.com>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-06 21:24:40 +00:00
Nick Lewycky
a221f1e570 Provide a default empty implementation for the LLVMCallbacks trait. 2019-12-06 12:09:34 -08:00
Yaron Wittenstein
6da3b22936
Merge pull request #1 from MarkMcCaskey/deterministic
Deterministic
2019-12-06 22:06:59 +02:00
bors[bot]
63a588780c
Merge #1033
1033: Improve default compiler story for wasmer cli r=MarkMcCaskey a=MarkMcCaskey

This PR needs the following to be ready to ship:

- [x] Verified make commands are still fine
- [x] Verified this doesn't do anything bad in CI

This PR adds:
- compile_error if no backend is specified in wasmer.rs
- readds clif as the default
- improves the error message saying "specified backend not found" to include the name of the backend that it couldn't find

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
2019-12-06 19:55:04 +00:00
Mark McCaskey
0580a117da
Improve compile error message when no backends set 2019-12-06 11:54:33 -08:00
bors[bot]
b336726177
Merge #1036
1036: Add experimental invoke support to WASI in wasmer cli r=MarkMcCaskey a=MarkMcCaskey

Resolves #1024 

This PR also does a bit of code clean up

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
2019-12-06 18:37:16 +00:00
Mark McCaskey
d2f5690cae
Improve warning message when invoking WASI functions 2019-12-06 10:36:45 -08:00
Mark McCaskey
448faafd0d Apply cargo fmt after GitHub merge 2019-12-06 10:28:20 -08:00
Mark McCaskey
d237bda463
Merge branch 'master' into fix/default-compiler-wasmer-cli 2019-12-06 10:27:53 -08:00
Mark McCaskey
e32a1a6378 Update from feedback; add changelog entry 2019-12-06 10:24:43 -08:00
bors[bot]
59d2b8b381
Merge #1030
1030: feat(runtime-c-api) Ability to generate `ImportObject` for a specific WASI version r=Hywan a=Hywan

⚠️ Contains #1028, must be merged before this one.

This patch introduces 2 new functions:

* `wasmer_wasi_generate_import_object_for_version` and
* `wasmer_wasi_get_version`.

It mimics the current API provided by `wasmer_wasi`, nothing fancy
here. It's just a regular port to C/C++.

Because `wasmer_wasi::get_wasi_version` returns an option, and in
order to simplify the C/C++ API, `wasmer_wasi_get_version` can return
`Version::Unknown` in case of an error. It's up to the user to check
the version is valid (i.e. not unknown).

To see only the changes provided by this PR (excluding #1028), check https://github.com/Hywan/wasmer/compare/fix-wasi-get-version...feat-runtime-c-api-wasi-version.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-12-06 14:09:39 +00:00
Ivan Enderlin
45e4081e4b doc(changelog) Remove a duplication. 2019-12-06 15:02:48 +01:00
Ivan Enderlin
dfd1253260 Merge branch 'master' into feat-runtime-c-api-wasi-version 2019-12-06 15:02:24 +01:00
bors[bot]
ee16823d5c
Merge #1028
1028: feat(wasi) Introduce strict/non-strict modes for `get_wasi_version` r=Hywan a=Hywan

Sequel of https://github.com/wasmerio/wasmer/pull/957.

If a module has multiple import namespaces, `get_wasi_version` is
broken because it assumes a module must only have a single namespace.

This patch updates `get_wasi_version` to introduce a `strict` flag:

* In strict mode, the previous behavior applies; only one namespace is expected to be found, and this namespace must be a WASI namespace to detect the version,
* In non-strict mode, at least one WASI namespace must be declared, and the first one is used to detect the version if any.

The non-strict mode is slower because it compares namespace strings.

2 new private constants have been declared: `SNAPSHOT0_NAMESPACE` and `SNAPSHOT1_NAMESPACE` to avoid repetition and bugs.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-12-06 13:06:19 +00:00
Ivan Enderlin
8aa49f540a test(wasi) Update get_wasi_version signature. 2019-12-06 14:04:30 +01:00
Ivan Enderlin
72c8b66a08 Merge branch 'fix-wasi-get-version' of github.com:Hywan/wasmer into fix-wasi-get-version 2019-12-06 14:02:49 +01:00
Ivan Enderlin
f8385e2757 feat(bin) wasmer requires a strict WASI version detection. 2019-12-06 14:02:02 +01:00
Ivan Enderlin
dc418a78da
Merge branch 'master' into fix-wasi-get-version 2019-12-06 13:37:34 +01:00
Nick Lewycky
27fe50ce9e Fix this regression test to detect the bug it was looking for in release builds too.
This bug triggered an assertion failure in debug, and by examining the pre-opt IR, we can check for the bug in release mode too.
2019-12-05 16:38:26 -08:00
bors[bot]
bf04864020
Merge #1040
1040: Add the ability to pass backend specific options through CompilerConfig. r=nlewycky a=nlewycky

# Description
Add the ability to pass backend specific options through CompilerConfig.

Use this to replace wasmer_llvm_backend::GLOBAL_OPTIONS.

This adds a new item to CompilerConfig which can be any struct defined by a backend for backend specific configuration options. So far, we only implement the options that were previously in GLOBAL_OPTIONS, these move to wasmer.rs. The plan is to use these same callbacks for testing in llvm-backend-tests.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-05 23:48:08 +00:00
Mark McCaskey
3ba355dda4 Remove deterministic flag setting default compiler; add auto logic 2019-12-05 15:04:05 -08:00
Nick Lewycky
8d3cf874cd Add the ability to pass backend specific options through CompilerConfig.
Use this to replace wasmer_llvm_backend::GLOBAL_OPTIONS.
2019-12-05 12:13:51 -08:00
Mark McCaskey
d144976da0
Manually apply formatting to cfg statement 2019-12-05 12:01:46 -08:00
Mark McCaskey
176b938cb6
Remove wasmparser dep from singlepass 2019-12-05 11:59:26 -08:00
Mark McCaskey
c7f3abd27e
Merge branch 'master' into deterministic 2019-12-05 11:50:16 -08:00
Mark McCaskey
5da98caf83 Merge branch 'master' into wat 2019-12-04 17:17:00 -08:00
Syrus Akbary
af7a368320
Added docs to Readme and removed WAPM usage 2019-12-04 13:11:11 -08:00
Ivan Enderlin
4ef799f23d feat(runtime-c-api) Support WasiVersion::Latest. 2019-12-04 15:34:56 +01:00
Ivan Enderlin
f0f0657264 doc(changelog) Resolve merge issues. 2019-12-04 15:28:38 +01:00
Ivan Enderlin
4fc6adf9c2 chore(runtime-c-api) Remove a useless format!. 2019-12-04 15:28:38 +01:00
Ivan Enderlin
345511a4f9 fix(runtime-c-api) Fix From<c_uchar> for Version.
0 matches to `Unknown`, 1 matches to `Snapshot0` and 2 matches to
`Snapshot1`.
2019-12-04 15:28:37 +01:00
Ivan Enderlin
90f3c894c1 doc(runtime-c-api) Improve documentation of wasmer_wasi_generate_import_object_for_version. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
0c5021484f fix(runtime-c-api) Use get_wasi_version in non-strict mode. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
4fe8286b81 feat(runtime-c-api) Avoid undefined behavior with user-given version.
When the version has type `Version`, we expect the user to give a
valid `Version` variant. Since the `Version` is basically a `uint8_t`,
the user is able to pass everything she wants, which can create an
undefined behavior on the Rust side.

To avoid such situation, the version has now type `c_uchar` (`unsigned
char` or `uint8_t` on C side —on most platforms). Then the `From`
trait is implemented on `Version`. In case the value is unbound,
`Version::Unknown` is returned.
2019-12-04 15:28:37 +01:00
Ivan Enderlin
b9851f26d4 doc(changelog) Add #1030. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
912713f88f test(runtime-c-api) Test the new WASI version API.
This patch updates `test-wasi-import-object` to test the new
`wasmer_wasi_get_version` &
`wasmer_wasi_generate_import_object_for_version` functions, and the
new `Version` type.
2019-12-04 15:28:37 +01:00
Ivan Enderlin
0391ade76f chore(git) Ignore the object file test-import-object. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
7fb934f5d0 chore(runtime-c-api) Fix CS in CMakeLists.txt. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
e2c353b926 chore(runtime-c-api) Update C/C++ headers. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
ca4a1b41a6 feat(runtime-c-api) Ability to generate ImportObject for a specific WASI version.
This patch introduces 2 new functions:

* `wasmer_wasi_generate_import_object_for_version` and
* `wasmer_wasi_get_version`.

It mimics the current API provided by `wasmer_wasi`, nothing fancy
here. It's just a regular port to C/C++.

Because `wasmer_wasi::get_wasi_version` returns an option, and in
order to simplify the C/C++ API, `wasmer_wasi_get_version` can return
`Version::Unknown` in case of an error. It's up to the user to check
the version is valid (i.e. not unknown).
2019-12-04 15:28:37 +01:00
Ivan Enderlin
fdc3d5107a doc(runtime-c-api) Suggest to test in release mode. 2019-12-04 15:28:37 +01:00
Ivan Enderlin
871db8547c
Merge branch 'master' into fix-wasi-get-version 2019-12-04 15:25:11 +01:00
bors[bot]
e7b39319f4
Merge #1029
1029: feat(wasi) Add the “floating” `WasiVersion::Latest` version. r=Hywan a=Hywan

In addition to `Snapshot0` and `Snapshot1`, I believe it is an
interesting API to provide the `Latest` version, so that the user can
write:

```rust
generate_import_object_for_version(WasiVersion::Latest, …);
```

This is a way to ensure that modules will run only if they come with
the latest WASI version (in case of security issues for instance), by
just updating the runtime.

Note that it can be dangerous if not used carefully, but we assume the
user knows what it does by sticking on a specific “floating” version.

Also note that the `Latest` version is never returned by any API. It
is provided only by the user.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-12-04 13:18:26 +00:00
Ivan Enderlin
9d42af8806 Merge branch 'master' into feat-wasi-version-latest 2019-12-04 14:16:33 +01:00
Ivan Enderlin
c12dd859bb doc(wasi) Improve documentation of WasiVersion::Latest. 2019-12-04 14:12:30 +01:00
Ivan Enderlin
0a24133aab doc(changelog) Update #1028 description. 2019-12-04 13:34:25 +01:00
Ivan Enderlin
2b7f0d19cb feat(wasi) Introduce a strict mode for get_wasi_version.
In strict mode, `get_wasi_version` uses the previous behavior, i.e. it
checks that there is only one namespace for all imports, and that this
namespace is a WASI namespace (and uses it to find the WASI version).

In non-strict mode, `get_wasi_version` checks that at least one WASI
namespace exists (and uses it to find the WASI version).

By default, `is_wasi_module` uses the non-strict mode.
2019-12-04 13:29:28 +01:00
Syrus Akbary
df1cf67167
Merge pull request #1038 from wasmerio/wat-aaron
Added support for indexed framebuffers in framebuffer files
2019-12-03 18:06:35 -08:00
Aaron Turner
d23ce04b1e Added support for indexed framebuffers in framebuffer files 2019-12-03 17:34:56 -08:00
bors[bot]
7aa044e7ba
Merge #1035
1035: Fix/quiet some rustc warnings. r=nlewycky a=nlewycky

No functionality change.

Remaining warnings are either dead code in examples/parallel-guest, or due to macros in typed_func.rs for which removing the "extra" parentheses breaks the build.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-03 01:01:51 +00:00
Nick Lewycky
3381e8867c Fix some assorted warnings. 2019-12-02 17:00:37 -08:00
Mark McCaskey
356720efd2 Add experimental invoke support to WASI in wasmer cli 2019-12-02 16:53:15 -08:00
bors[bot]
183beb769e
Merge #1034
1034: When modifying the value, also update its ExtraInfo. r=nlewycky a=nlewycky

Fixes a debug_assert! on python3.7 and rustpython in wapm.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-12-03 00:02:38 +00:00
Mark McCaskey
ab111443be Improve default compiler story for wasmer cli
This commit reenables the clif compiler as the default for wasmer cli,
updates an error message, and adds a compile_error if no backends are enabled.
2019-12-02 15:50:34 -08:00
Nick Lewycky
7c6d73d4d9 Add test for debug-crash.
This also was a wrong-code bug (I think), but we can't yet write tests for those.
2019-12-02 15:49:33 -08:00
Nick Lewycky
ad752d66a7 When modifying the value, also update its ExtraInfo.
Fixes a debug_assert! on python3.7 and rustpython in wapm.
2019-12-02 15:45:12 -08:00
Mark McCaskey
e8b162df06 Fix abort and _abort to be different 2019-12-02 15:32:14 -08:00
Mark McCaskey
cd946f1d27 Fix abort signature in emscripten ABI 2019-12-02 15:09:42 -08:00
bors[bot]
652433eb61
Merge #1031
1031: Improve portability of code by using c_char r=MarkMcCaskey a=MarkMcCaskey

This PR makes emscripten compile on ARM with an up to date nightly compiler

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-02 20:00:08 +00:00
Mark McCaskey
5234897989 Improve portability of code by using c_char 2019-12-02 11:30:30 -08:00
bors[bot]
d639748a20
Merge #1022
1022: Add caching support for Singlepass backend. r=losfair a=losfair

This PR adds caching support for the Singlepass backend.

- [x] Implementation
- [x] AArch64 test

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2019-12-02 17:56:37 +00:00
losfair
2eb11f5052 Update Cargo.lock 2019-12-03 01:46:13 +08:00
losfair
04d8df0a46 Add comments and remove unneeded statics. 2019-12-03 01:46:06 +08:00
Ivan Enderlin
c916f0edaa doc(changelog) Add #1029. 2019-12-02 15:55:38 +01:00
Ivan Enderlin
a79beede72 feat(wasi) Add the “volatile” WasiVersion::Latest version.
In addition to `Snapshot0` and `Snapshot1`, I believe it is an
interesting API to provide the `Latest` version, so that the user can
write:

```rust
generate_import_object_for_version(WasiVersion::Latest, …);
```

This is a way to ensure that modules will run only if they come with
the latest WASI version (in case of security issues for instance), by
just updating the runtime.

Note that it can be dangerous if not used carefully, but we assume the
user knows what it does by sticking on a specific “floating” version.

Also note that the `Latest` version is never returned by any API. It
is provided only by the user.
2019-12-02 15:53:40 +01:00
Ivan Enderlin
8df0591ee5 doc(changelog) Add #1028. 2019-12-02 15:41:46 +01:00
Ivan Enderlin
7f3680c27a fix(wasi) get_wasi_version is broken with multiple namespaces.
If a module has multiple import namespaces, `get_wasi_version` is
broken because it assumes a module must only have a single namespace.

This patch fixes it by a slower `get_wasi_version` function, but a
correct one. As soon as the `wasi_unstable` or
`wasi_snapshot_preview1` namespace is met, `get_wasi_version` maps it
to the respective `WasiVersion` variant. It assumes however that a
module must hold a unique WASI version.
2019-12-02 15:36:45 +01:00
losfair
063fa211a7 Merge remote-tracking branch 'origin/master' into feature/singlepass-cache 2019-11-29 01:33:29 +08:00
losfair
c3f2481ced Update feature matrix. 2019-11-29 01:32:08 +08:00
losfair
513427be93 Remove singlepass codegen dependence on runtime memory. 2019-11-29 01:30:08 +08:00
bors[bot]
19dfdec236
Merge #1004
1004: Adapt backend usage depending on wasm file executed r=MarkMcCaskey a=d0iasm

Adapt backend usage depending on wasm file executed in issue #998.
Close #998 

# Description
Add `auto` backend into a runtime-core and use it as a default backend.
The `auto` backend is equivalent to: 
* singlepass if singlepass is enabled and the wasm file size is larger than 10MiB, or singlepass is enable and the target architecture is aarch64.
* cranelift otherwise.


Co-authored-by: Asami Doi <doiasami1219@gmail.com>
2019-11-27 19:37:04 +00:00
Heyang Zhou
24ead779d6
Remove extra '.'.
Co-Authored-By: nlewycky <nick@wasmer.io>
2019-11-28 03:25:05 +08:00
losfair
c7f4ca5dd3 Enable cache tests for singlepass. 2019-11-28 03:01:09 +08:00
losfair
70bc382843 Add changelog entry. 2019-11-28 02:54:53 +08:00
losfair
cfa0635026 Add caching support for singlepass backend. 2019-11-28 02:49:52 +08:00
bors[bot]
b6d8fedced
Merge #1019
1019: Update llvm backend to work with latest inkwell. r=nlewycky a=nlewycky

cargo update to pick up latest inkwell branch commit.

Add lifetime annotations to Module which now takes a lifetime.

Add <'ctx> across CtxType and Intrinsics. Remove it from reference bindings.

Use ManuallyDrop to ensure that context's members are dropped before the Context.

Co-authored-by: Mark McCaskey <mark@wasmer.io>

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-27 18:49:36 +00:00
Asami Doi
fd0df9946b Add "auto" backend to change the backend depending on the wasm file size 2019-11-27 20:04:35 +09:00
Nick Lewycky
31a77b0eb7 Fix llvm backend to work with latest inkwell.
cargo update to pick up latest inkwell branch commit.

Add lifetime annotations to Module which now takes a lifetime, and more lifetime annotations across intrinsics.rs.

Add <'ctx> to missing places in CtxType and Intrinsics. Remove it from reference bindings.

Use ManuallyDrop to ensure that context's members are dropped before the Context.

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-26 19:59:03 -08:00
bors[bot]
dfc7163b71
Merge #1020
1020: Turn a few more assert!s that should never fire into debug_assert!s. r=nlewycky a=nlewycky

These are here to protect against errors when refactoring more than anything else.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-27 01:16:34 +00:00
Nick Lewycky
5a49fe76df Turn a few more assert!s that should never fire into debug_assert!s.
These are here to protect against errors when refactoring more than anything else.
2019-11-26 16:43:17 -08:00
bors[bot]
f6f8780934
Merge #1006
1006: fix 1005 panic sub overflow r=MarkMcCaskey a=pventuzelo

# Description

Fix issue https://github.com/wasmerio/wasmer/issues/1005

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
2019-11-27 00:36:29 +00:00
bors[bot]
53f0a9cecf
Merge #934
934: In LLVM backend, track which floats are guaranteed to be arithmetic, which makes the canonicalization a no-op. r=nlewycky a=nlewycky

# Description
This is a reimplementation of the patch in PR #651.

Extend state.rs ExtraInfo to track more information about floats. In addition to tracking whether the value has a pending canonicalization of NaNs, also track whether the value is known to be arithmetic (which includes infinities, regular values, and non-signalling NaNs (aka. "arithmetic NaNs" in the webassembly spec)). When the value is arithmetic, the correct sequence of operations to canonicalize the value is a no-op. Therefore, we create a lattice where pending+arithmetic=arithmetic.

Also, this extends the tracking to track all values, including non-SIMD integers. That's why there are more places where pending canonicalizations are applied.

Looking at c-wasm-simd128-example, this provides no performance change to the non-SIMD case (takes 58s on my noisy dev machine). The SIMD case drops from 46s to 29s.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-26 20:29:31 +00:00
Nick Lewycky
ff73c5d71b Address review feedback from Mark.
Fix a bug in Operator::Select and add a comment to explain the intention.

Use derived default for ExtraInfo.

Make ExtraInfo associated functions const.

Turn two asserts into debug_asserts.
2019-11-26 12:25:03 -08:00
Nick Lewycky
d3fabe576b Add changelog entry. 2019-11-26 12:20:44 -08:00
Nick Lewycky
d1ce8ee20d Give that panic! a message. Also, make it an unreachable!. 2019-11-26 12:20:44 -08:00
Nick Lewycky
fa576093c2 Fix ExtraInfo on F32Add and similar.
We want to ignore the incoming pending NaN state (since the pending will propagate to the output if there was one on the input), and we want to add a new pending NaN state if we can (that is to say, if it isn't cancelled out by both inputs having arithmetic state). Do this by discarding the pending states on the inputs, intersecting them (to keep only the arithmetic state), then union in a pending nan state (which might do nothing, if it's arithmetic).

If the above sounds confusing, keep in mind that when a value is arithmetic, the act of performing the "NaN canonicalization" is a no-op. Thus, being arithmetic cancels out pending NaN states.
2019-11-26 12:20:44 -08:00
Nick Lewycky
a06c858087 Make ExtraInfo bitand check for pending validity.
Unfortunately, this is quite buggy. For something as simple as F32Sub, to combine two ExtraInfos, we want to add a new pending_f32_nan(), unless both of the inputs are arithmetic_f32(). In this commit, we incorrectly calculate that we don't need a pending_f32_nan if either one of the inputs was arithmetic_f32().
2019-11-26 12:20:43 -08:00
Nick Lewycky
284948b6d4 Refactor so as to convert ExtraInfo when potentially canonicalizing.
It seemed like a good idea at the time, but in practice we discard the extra info all or almost all of the time.

This also introduces a new bug. In an operation like multiply, it's valid to multiply two values, one with a pending NaN and one without. As written, in the SIMD case (because of the two kinds of pending in play), we assert.
2019-11-26 12:20:43 -08:00
Nick Lewycky
26c8fd52c8 Initial implementation of "known to be arithmetic NaN / not NaN". 2019-11-26 12:20:43 -08:00
Nick Lewycky
fafc7ad38c Add "known to not contain non-arithmetic NaNs" to ExtraInfo in LLVM backend.
Not wired up yet.
2019-11-26 12:20:43 -08:00
Patrick Ventuzelo
bb16547567 Merge branch 'ventuzelo/fix-1005-panic-sub-overflow' of github.com:pventuzelo/wasmer into ventuzelo/fix-1005-panic-sub-overflow 2019-11-26 09:18:05 +01:00
Patrick Ventuzelo
49665d5797 use checked_sub for peekn_extra 2019-11-26 09:17:13 +01:00
bors[bot]
7715be9ccb
Merge #1017
1017: Add a 'clear' method to map. r=nlewycky a=nlewycky

# Description
Motivated by work on the `nlewycky/inkwell-lifetimes` branch. No callers yet on master, but we use it on the branch and I'd like to merge in pieces.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-25 22:54:12 +00:00
Nick Lewycky
4e2440daec Add a 'clear' method to map. 2019-11-25 14:53:25 -08:00
Syrus Akbary
95ccd99809
Added ARM reference 2019-11-25 11:25:05 -08:00
bors[bot]
a69c029c21
Merge #1016
1016: [fix 962] Activate pre_validation when llvm backend selected r=nlewycky a=pventuzelo

# Description

After analysis of issue https://github.com/wasmerio/wasmer/issues/962 by me and @nlewycky, it seems to be better to validate the wasm module before calling the llvm compiler.

This change will imply potential overhead in term of execution speed using llvm backend.

I will also suggest to set pre_validation to true for Singlepass by default:
5c1c786e35/lib/runtime-core/src/codegen.rs (L263-L269)

Additional improvement proposal for wasmer API & cli command options:
* add an API `compile_without_validation`.
* add a flag option in wasmer binary to deactivate `pre_validation` for all backend.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
2019-11-25 18:38:52 +00:00
Patrick Ventuzelo
7ca0430a40 activate pre_validation when llvm backend selected 2019-11-25 13:17:07 +01:00
Patrick Ventuzelo
d376b89ef0
Merge branch 'master' into ventuzelo/fix-1005-panic-sub-overflow 2019-11-25 12:05:33 +01:00
bors[bot]
5c1c786e35
Merge #1002
1002: Update the LLVM pass list. r=nlewycky a=nlewycky

# Description
Adds optimizations of loops, and inlinling and some simple interprocedural optimization.

Measured on the libsodium benchmarks, the new pass pipeline is a 2.35% geomean improvement. No major performance regressions known.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-23 05:11:44 +00:00
Syrus
9c0b6a01b2 Fixed Azure pipelines releases 2019-11-22 18:59:54 -08:00
bors[bot]
2f394c9f30
Merge #1009
1009: Fix LLVM crash on `return` with a float on the stack and a crash with gas metering. r=nlewycky a=nlewycky

# Description
This PR fixes some matters of testing. The return+float bug is caught by the LLVM verifier, which was accidentally unconditionally disabled even when running "make test check". Add a new cargo feature named "test" which is enabled by all the test crates. When the "test" feature is passed to the llvm-backend, run the LLVM verifier.

Add a new crate `llvm-backend-test` which has one test so far, to ensure that this bug with the return+float does not crash LLVM. Include this new crate in runs of `make llvm`.

Fix LLVM crash on `return` when there is a float with pending NaN canonicalization on the stack.

Now that we run the verifier in testing, we discover another bug where `internal_field()` incorrectly labels a GEP with a TBAA label instead of the intended load. Fix this by labeling the correct instruction. No new test is introduced since this is already caught with `make bench-llvm`.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-23 02:18:07 +00:00
Nick Lewycky
91671d5347 Add changelog entry. 2019-11-22 17:16:54 -08:00
Nick Lewycky
3ef9f769df Fix TBAA crash with LLVM + the gas middleware. 2019-11-22 17:03:31 -08:00
Nick Lewycky
681219b06c Fix bug in LLVM lowering of 'return' when the stack has a float on it. 2019-11-22 17:03:31 -08:00
Nick Lewycky
85666fc522 Add new llvm-backend-test crate. 2019-11-22 17:03:23 -08:00
Nick Lewycky
2433d365af Add new test feature, enabled in test crates.
When test feature is enabled, turn on LLVM verifier. This was previously never enabled.
2019-11-22 16:51:44 -08:00
Syrus
8f50dab0f2 Trying to improve release process 2019-11-22 12:23:23 -08:00
Syrus Akbary
2fdf39f7fe
Merge pull request #1008 from wasmerio/release-0.11.0
Prepare for 0.11.0 release
2019-11-22 11:23:47 -08:00
Mark McCaskey
bb1e7a8d78 Prepare for 0.11.0 release 2019-11-22 11:18:06 -08:00
bors[bot]
bcd7bb4918
Merge #713
713: Add AArch64 support for singlepass. r=syrusakbary a=losfair

This PR includes:

- Support for AArch64 (ARM64) in Singlepass backend. Implemented with a combination of x86_64 instruction translation and native code generation.
- State tracing and backtraces on AArch64/Singlepass. (Tiering is not implemented for this pair because there's no other backend supporting AArch64 yet)
- Debugging tools: `BlockTrace` middleware, and support for reading states of previous WebAssembly stack frames from middlewares.

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-11-22 18:24:57 +00:00
Syrus
183dd328d6 Make travis work only on test branches 2019-11-22 09:55:31 -08:00
Syrus
a691d3454c Skip serializing on singlepass 2019-11-22 09:49:17 -08:00
Patrick Ventuzelo
cd0da74b33 add changelog entry 2019-11-22 17:25:17 +01:00
Patrick Ventuzelo
2261f8b449 cargo fmt 2019-11-22 17:21:15 +01:00
Patrick Ventuzelo
508004088e check stack len before getting value 2019-11-22 17:10:54 +01:00
losfair
80fb5b4da8 Merge remote-tracking branch 'origin/feature/singlepass-aarch64' into feature/singlepass-aarch64 2019-11-22 23:39:07 +08:00
losfair
21e676667e Try pinning Rust version for arm64 build. 2019-11-22 23:37:06 +08:00
Nick Lewycky
9fe5e261ea Update the LLVM pass list.
Adds optimizations of loops, and inlinling and some simple interprocedural optimization.
2019-11-21 22:41:23 -08:00
Syrus
0834ccf661 Merge branch 'master' into feature/singlepass-aarch64
# Conflicts:
#	Makefile
2019-11-21 20:10:09 -08:00
bors[bot]
7bb570a7f9
Merge #997
997: Compiler tests r=MarkMcCaskey a=syrusakbary

# Description
This PR simplifies the testing part, making `wasmer_runtime_core` the one responsible for picking the default backend.

This makes tests much simpler, and reliable when trying to run in different backends (this PR solves an issue when trying to run wasitests on ARM machines).

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
2019-11-22 03:32:27 +00:00
Mark McCaskey
180528241d Fix merge issue in wasi tests 2019-11-21 19:31:17 -08:00
Syrus
499d42a759 Fixed tests 2019-11-21 19:08:48 -08:00
Syrus
27b6acdb16 Fixed typo 2019-11-21 18:55:38 -08:00
Syrus
9a146c57fc Make docs compilation happy 2019-11-21 18:35:19 -08:00
Syrus
7b9485320d Revert "Autodetect default backend, add features for architecture type"
This reverts commit 31437a1e749f8c0b2154ccbb3a5365c0ab7cdbab.
2019-11-21 18:26:31 -08:00
Syrus
bcdbdf4c23 Updated Changelog 2019-11-21 18:24:16 -08:00
Syrus Akbary
9fcfbb778a
Merge pull request #1001 from d0iasm/readme-fix-make
Fix no rule to make target 'wasi'
2019-11-21 18:19:29 -08:00
Asami Doi
2154ba2ce7 Fix no rule to make target 'wasi' 2019-11-22 11:15:26 +09:00
Mark McCaskey
44f2e926ac
Merge branch 'master' into compiler-tests 2019-11-21 17:24:08 -08:00
Mark McCaskey
31437a1e74 Autodetect default backend, add features for architecture type 2019-11-21 17:22:21 -08:00
losfair
87f4183440 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-22 09:09:01 +08:00
Syrus Akbary
b9138aaddd
Merge pull request #957 from wasmerio/feature/add-support-for-new-wasi
Add support for new WASI snapshot, backwards compat too
2019-11-21 16:17:30 -08:00
losfair
ee7b0d625a Skip push/pop code version on Windows. 2019-11-22 08:07:24 +08:00
losfair
5da44c3bf8 Add 'fault' placeholder for Windows. 2019-11-22 07:26:35 +08:00
Mark McCaskey
bdeec52152 Fix imports in test; copy manual implementations of Debug for wasi 2019-11-21 14:00:46 -08:00
Syrus
c3f93f1275 Fixed formatting 2019-11-21 13:38:22 -08:00
Syrus
aeb66ee48e Simplify compiler test options 2019-11-21 13:36:44 -08:00
Mark McCaskey
68fa9e2639 Merge branch 'feature/add-support-for-new-wasi' of github.com:wasmerio/wasmer into feature/add-support-for-new-wasi 2019-11-21 11:31:00 -08:00
Mark McCaskey
ddccdb92b8 More fixes for CI 2019-11-21 11:30:44 -08:00
losfair
daee31f885 Add changelog entry. 2019-11-22 03:30:05 +08:00
Mark McCaskey
36a26717c2
Merge branch 'master' into feature/add-support-for-new-wasi 2019-11-21 10:58:05 -08:00
Mark McCaskey
be217e8f8e Update from feedback, fix CI issues, update wasi-test 2019-11-21 10:57:04 -08:00
losfair
7626957203 Enable block_trace middleware only on unix. 2019-11-22 02:38:47 +08:00
losfair
4dd810bbac Ensure code version metadata is pushed properly. 2019-11-22 02:23:51 +08:00
losfair
8709708de7 Unwind if breakpoint handler returns error. 2019-11-22 01:57:04 +08:00
losfair
4ec4fcf28a Try fixing middleware failure. 2019-11-22 01:46:02 +08:00
losfair
6f3e6fab3b Try fixing compilation on Windows. 2019-11-22 00:51:20 +08:00
losfair
c0ff110ca9 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-22 00:38:02 +08:00
losfair
15e3a038ea Try fixing compilation on Windows. 2019-11-22 00:36:34 +08:00
bors[bot]
d5f25aa14e
Merge #995
995: fix(runtime-core) Remove a panic when generating globals with a corrupted module r=syrusakbary a=Hywan

Fix #979.

When we try to get a global that doesn't exist, a panic is
generated. This patch skips such panic and let a proper error be
generated.

Before this patch:

```
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: ExportNotFound { name: "main" }
```

With this patch:

```sh
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: Can't instantiate module: LinkError([Generic { message: "Trying to read the `0` global that isn\'t properly initialized." }])
```

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-21 15:48:16 +00:00
losfair
d1352554e3 Remove accidentally added test files. 2019-11-21 23:37:33 +08:00
losfair
73cc86de0c Fix compilation errors with cranelift. 2019-11-21 23:37:17 +08:00
losfair
d45076151e Merge remote-tracking branch 'origin/feature/singlepass-aarch64' into feature/singlepass-aarch64 2019-11-21 23:32:28 +08:00
losfair
5f26fcd633 Make cranelift optional and enable singlepass by default on aarch64. 2019-11-21 23:31:10 +08:00
losfair
df43759a67 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-21 23:12:37 +08:00
Ivan Enderlin
7313672d96 doc(changelog) Add #995. 2019-11-21 11:03:53 +01:00
Ivan Enderlin
1e6dbf9b86 Merge branch 'master' into fix-gh-979 2019-11-21 11:01:45 +01:00
Ivan Enderlin
b1f58bded0 fix(runtime-core) Improve error message when globals are corrupted.
Before this patch:

```
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: ExportNotFound { name: "main" }
```

With this patch:

```sh
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: Can't instantiate module: LinkError([Generic { message: "Trying to read the `0` global that isn\'t properly initialized." }])
```
2019-11-21 10:57:52 +01:00
Ivan Enderlin
a9e446b5cd fix(runtime-core) Fix a panic when generating globals.
Fix https://github.com/wasmerio/wasmer/issues/979.

When we try to get a global that doesn't exist, a panic is
generated. This patch just skip that path, and let a proper error be
generated later.

With this patch, we get:

```sh
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: ExportNotFound { name: "main" }
```

which is kind of the expected behavior in such situation.
2019-11-21 10:51:04 +01:00
Syrus Akbary
5e728ae893 Update install.sh 2019-11-20 22:37:23 -08:00
Syrus
4d973dad60 Don’t try to create a new tag 2019-11-20 22:16:58 -08:00
Syrus
10aa6c8f3a Allow deployment on branch 2019-11-20 21:24:11 -08:00
Syrus
43a99cda91 Trying to upload artifact to GH releases 2019-11-20 21:05:22 -08:00
Syrus
605fdc912b Trying to fix installation 2019-11-20 20:42:17 -08:00
Syrus
1e886e278d Trying to make cargo happy 2019-11-20 20:33:16 -08:00
Syrus
d0437db61d Iterating on Travis 2019-11-20 20:21:23 -08:00
Syrus
6a68ff76f4 Trying to fix sccache in arm 2019-11-20 20:12:48 -08:00
Syrus
a4b1b9ecf1 Trying to improve Travis build script 2019-11-20 20:04:47 -08:00
Syrus
46f43bf6ee Fix travis config 2019-11-20 19:43:02 -08:00
Syrus
c53199830f Try to generate an arm release on the travis script 2019-11-20 19:36:34 -08:00
Syrus
e5905c9b79 Added support for the aarch64/arm64 in the scripts 2019-11-20 19:34:27 -08:00
Syrus
27b17893d8 Move popcnt to examples 2019-11-20 19:14:29 -08:00
Syrus
cafad45175 Added make wapm command 2019-11-20 19:13:59 -08:00
Syrus
b3322a6c5c Move xxx.wat to the examples dir 2019-11-20 19:13:37 -08:00
Syrus
b8aee87d6e Skip atomic tests for now in singlepass Aarch64 2019-11-20 19:11:33 -08:00
Syrus
b77dffbbfe Merge branch 'master' into feature/singlepass-aarch64 2019-11-20 19:09:19 -08:00
Syrus Akbary
ef1713dd0b
Update install.sh 2019-11-20 18:28:58 -08:00
bors[bot]
9e144c623b
Merge #992
992: Update wapm-cli to latest version r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description

This PR:
* [x] Updates WAPM version to 0.4.1
* [x] Fixes arguments issue introduced in #990

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
2019-11-21 01:32:51 +00:00
Syrus
dc01afb3b5 Use structopt clap instead of global clap 2019-11-20 17:28:43 -08:00
Syrus
a71b9519c4 Fix lint issues 2019-11-20 17:19:42 -08:00
Syrus
8f62549819 Added changes in CHANGELOG 2019-11-20 17:18:52 -08:00
Syrus
f0fc15a4aa Updated WAPM CLI to to 0.4.1 2019-11-20 17:15:31 -08:00
Syrus
274367b152 Fixed CLI arguments issue 2019-11-20 17:15:20 -08:00
bors[bot]
518cd00f14
Merge #991
991: Run WASI C API tests based on feature; prevent cmake caching r=MarkMcCaskey a=MarkMcCaskey

Resolves #988 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-21 00:56:16 +00:00
Syrus
70197c2e07 Update wapm-cli to latest version 2019-11-20 16:38:50 -08:00
Mark McCaskey
fc733647ec Add info in c api readme in the testing section 2019-11-20 16:38:44 -08:00
bors[bot]
32a8da19d3
Merge #990
990: Allow to do wasmer execution without the `run` argument r=MarkMcCaskey a=syrusakbary


# Description
This PR allows Wasmer to run files directly without doing `wasmer run xyz.wasm`.
So you can do `wasmer xyz.wasm`

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-20 23:51:39 +00:00
Mark McCaskey
76e346b708 Clean up from feedback, update changelog 2019-11-20 15:50:46 -08:00
Mark McCaskey
b2d19e1f51 Merge branch 'master' into run-without-run 2019-11-20 15:47:40 -08:00
Mark McCaskey
4a84441ab0 Run WASI C API tests based on feature; prevent cmake caching 2019-11-20 15:41:33 -08:00
Mark McCaskey
cb7fcb9452 Simplify default run logic 2019-11-20 15:14:25 -08:00
Syrus
1685455eb6 Allow to do wasmer execution without the run argument 2019-11-20 14:50:37 -08:00
bors[bot]
6831a6d8c9
Merge #987
987: Fix runtime c api header preprocessor gcc r=syrusakbary a=Hywan

`ARCH_X86_64` is correctly defined for GCC or clang, but gnuc was
missing. This patch fixes that.

Address https://github.com/wasmerio/php-ext-wasm/issues/93
Fix https://github.com/wasmerio/wasmer/issues/984

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-20 16:09:09 +00:00
Syrus Akbary
e466e487dd
Merge pull request #985 from wasmerio/feature/update-spectest-excludes
Refactor spectests runner
2019-11-20 08:07:13 -08:00
Ivan Enderlin
6ba3d1c5bc doc(changelog) Add #987. 2019-11-20 13:32:31 +01:00
Ivan Enderlin
9468e229f4 chore(runtime-c-api) Update header files. 2019-11-20 13:30:02 +01:00
Ivan Enderlin
dfe7c0d764 fix(runtime-c-api) Add support for GNUC when defining ARCH_X86_64.
`ARCH_X86_64` is correctly defined for GCC or clang, but gnuc was
missing. This patch fixes that.
2019-11-20 13:27:18 +01:00
Brandon Fish
bd58842041 Refactor excludes and add target_arch option 2019-11-19 23:38:50 -06:00
Syrus Akbary
8efa8e299c
Improved README instructions 2019-11-19 13:53:36 -08:00
Syrus Akbary
f1946ccafc
Merge pull request #983 from wasmerio/MarkMcCaskey-patch-1
Fix github issue link in feature matrix
2019-11-19 11:11:34 -08:00
losfair
0c7545ded7 Tell dynasm we are generating x64 code in emitter_x64. 2019-11-20 02:09:32 +08:00
losfair
28ebe5f758 Rustfmt 2019-11-20 01:56:13 +08:00
losfair
d56fd96395 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-20 01:54:34 +08:00
losfair
93f096b726 Fix lint errors when singlepass is disabled. 2019-11-20 01:52:33 +08:00
Mark McCaskey
f9bef056ba
Fix github issue link in feature matrix 2019-11-19 09:48:51 -08:00
losfair
c9aa37fc99 Cleanup. 2019-11-20 01:48:20 +08:00
losfair
34bb321e66 Rename emit_host_redirection. 2019-11-20 01:34:45 +08:00
losfair
98052f82b9 Unmap stack after call. 2019-11-20 01:27:48 +08:00
losfair
85b1935366 Uncomment previously disabled test. 2019-11-20 01:22:56 +08:00
losfair
3d48115586 Allocate a big enough stack for invoke(). 2019-11-20 01:07:02 +08:00
losfair
a7577dfcef Try further reducing preallocated stack size. 2019-11-20 00:37:38 +08:00
bors[bot]
e8e460ec60
Merge #977
977: fix(runtime-core) Remove unnecessary implementation of `WasmTypeList` r=Hywan a=Hywan

The unit tests `test_func_arity_*` covers all possibilities, from 0 to
12. Removing this specific implementation of `WasmTypeList` for `(A,)`
doesn't break the test cases.

Also, the `impl_traits!` macro already implement `WasmTypeList` for
`(A,)` with `impl_traits!([transparent] S1, A)`. It's not clear why
`rustc` doesn't detect that though.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-19 14:07:37 +00:00
bors[bot]
ad65a1504c
Merge #978
978: test(runtime-core) Test closures in `Func::new` r=Hywan a=Hywan

This patch contains 2 commits:

1. Test closures in `Func::new`
2. Fix a warning about `unused_parens` (since Rust 1.39, the behavior of `unused_parens` has changed a little bit).

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-19 13:35:16 +00:00
Ivan Enderlin
dbefa165dc
Merge branch 'master' into fix-runtime-core-clean-up-typed_func 2019-11-19 14:35:11 +01:00
Ivan Enderlin
b856e111b6
Merge branch 'master' into test-runtime-core-typed_func 2019-11-19 14:34:53 +01:00
Syrus Akbary
41c1e071c8
Update CHANGELOG.md 2019-11-18 15:42:08 -08:00
bors[bot]
8ffd380006
Merge #973
973: Add sign extension spec tests; add sign extension to singlepass r=nlewycky a=MarkMcCaskey

Adds missing spectests from official repo, implements instructions for singlepass

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
2019-11-18 22:16:49 +00:00
Syrus Akbary
95368aa5dc
Trigger azure pipeline job on new tag 2019-11-18 13:19:05 -08:00
Mark McCaskey
8a096a09e4 Remove extra register use in sign extension instructions 2019-11-18 11:47:58 -08:00
bors[bot]
e568c4a374
Merge #972
972: Prepare for 0.10.2 release r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-18 19:44:33 +00:00
Mark McCaskey
344132cc89
Merge branch 'master' into feature/singlepass-sign-extension 2019-11-18 11:38:12 -08:00
Mark McCaskey
8b6a7b77fc Clean up from feedback 2019-11-18 11:36:49 -08:00
losfair
8ebf8986f0 Reduce stack size. 2019-11-19 03:15:12 +08:00
bors[bot]
8e82a06532
Merge #981
981: Revert "Update Rust version to 1.39.0." r=MarkMcCaskey a=MarkMcCaskey

As far as I know we still want to be 1 behind latest stable to minimize breakage and bug reports (the compiler says you should install nightly when encountering new features)

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-18 19:09:42 +00:00
losfair
2776daedfa Fix entry with more than 5/6 arguments. 2019-11-19 03:04:07 +08:00
losfair
ddbdb3e585 Ignore extra arguments. 2019-11-19 02:46:31 +08:00
losfair
06a7e5424b Inline entry trampolines. 2019-11-19 02:39:51 +08:00
Mark McCaskey
2cbc748188 Revert "Update Rust version to 1.39.0." 2019-11-18 09:59:07 -08:00
losfair
d7308c361d Fix call_indirect on imported functions. 2019-11-19 01:25:01 +08:00
losfair
23f03f555b Fix compilation failure in tiering.rs. 2019-11-18 23:10:49 +08:00
losfair
f7f91c34cc Merge remote-tracking branch 'origin-http/master' into feature/singlepass-aarch64 2019-11-18 22:58:26 +08:00
bors[bot]
647c6f8cbe
Merge #974
974: Update to Rust 1.39 r=losfair a=losfair

This PR updates the default Rust version to 1.39.

Necessary for code formatted with newer versions of `rustfmt` to pass the CI lint check.

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-11-18 14:07:12 +00:00
Ivan Enderlin
f6cb6ce286 fix(runtime-core) Remove a warning for unused_parens.
The behavior of `unused_parens` has changed since Rust 1.39. A warning
is then raised. This patch fixes that.
2019-11-18 12:44:40 +01:00
Ivan Enderlin
85a53e8e1f test(runtime-core) Test closures in Func::new. 2019-11-18 12:44:00 +01:00
Ivan Enderlin
4e42fa1e48 fix(runtime-core) Remove unnecessary implementation of WasmTypeList.
The unit tests `test_func_arity_*` covers all possibilities, from 0 to
12. Removing this specific implementation of `WasmTypeList` for `(A,)`
doesn't break the test cases.

Also, the `impl_traits!` macro already implement `WasmTypeList` for
`(A,)` with `impl_traits!([transparent] S1, A)`. It's not clear why
`rustc` doesn't detect that though.
2019-11-18 12:22:17 +01:00
losfair
1eed6ce8f8 Fix CONSTRUCT_STACK_AND_CALL_WASM for aarch64. 2019-11-18 02:06:31 +08:00
losfair
5d2ee4fcc8 Fix floating point comparision involving NaNs. 2019-11-18 01:39:44 +08:00
losfair
cbaa94a7fa Fix movsx(S32, S64). 2019-11-18 01:08:39 +08:00
losfair
08beb99baa Fix popcnt. 2019-11-17 05:15:10 +08:00
losfair
021a75244e Reformat code for rust 1.39. 2019-11-17 04:39:39 +08:00
losfair
b36bf01188 Update Rust version to 1.39.0. 2019-11-17 04:38:40 +08:00
losfair
1db6425cd5 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-17 04:36:22 +08:00
Mark McCaskey
7631aee4f4 Add sign extension spec tests; add sign extension to singlepass 2019-11-15 21:54:34 -08:00
bors[bot]
5582a89e6b
Merge #964
964: Enable compilation for specific target r=MarkMcCaskey a=xofyarg


<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->
By exposing the target information through `CompilerConfig`,
compiler(only LLVM at the moment) could create a machine with
different CPU feature flags other than current host, which makes it
capable to "cross compile" to some degree.

Update #959

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: anb <anb@dev.null>
2019-11-16 03:20:37 +00:00
anb
3b2d751c55 Enable compilation for specific target
By exposing the target information through `CompilerConfig`,
compiler(only LLVM at the moment) could create a machine with
different CPU feature flags other than current host, which makes it
capable to "cross compile" to some degree.

Update #959
2019-11-15 18:51:59 -08:00
Mark McCaskey
cebcb4c927 Prepare for 0.10.2 release 2019-11-15 14:55:53 -08:00
bors[bot]
ab59a418c3
Merge #971
971: When accessing memory, use byte aligned accesses. r=nlewycky a=nlewycky

# Description
When accessing memory, use byte aligned accesses.

LLVM's instcombine will attempt to bump the alignment when it can prove that it's safe to do so.

Fixes #969.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-15 22:50:39 +00:00
Nick Lewycky
ecc82a7cab Add changelog entry. 2019-11-15 14:47:53 -08:00
Nick Lewycky
ebe8da7bd3 When accessing memory, use byte aligned accesses.
LLVM's instcombine will attempt to bump the alignment when it can prove that it's safe to do so.

Fixes #969.
2019-11-15 14:47:53 -08:00
bors[bot]
182e53bf28
Merge #968
968: Added invoke option to the command r=syrusakbary a=syrusakbary

# Description 

This PR adds an `--invoke` to the Wasmer CLI

<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
2019-11-15 22:06:35 +00:00
Syrus
3d3636059a Revert "Improved wasmer invoke based on feedback"
This reverts commit f3b7c6b321b06dad25d9892b0c3c4b302843a6b0.
2019-11-15 14:04:48 -08:00
Syrus
f3b7c6b321 Improved wasmer invoke based on feedback 2019-11-15 10:41:18 -08:00
Syrus
be1f192df2 Merge branch 'master' into invoke 2019-11-15 10:36:19 -08:00
Syrus
c15b9fcdcd Add examples dir to Docker file. Fix #970 2019-11-15 09:47:38 -08:00
Syrus Akbary
3cb7a4bf76
Use Rust 1.38. Fixed #970 2019-11-14 19:23:20 -08:00
Syrus
d0960dc390 Added changes to changelog 2019-11-14 12:10:44 -08:00
Syrus
7b3093ff7f Added invoke option to the command 2019-11-14 12:07:53 -08:00
bors[bot]
4a2eaa4143
Merge #966
966: Add deny missing docs to runtime lib r=bjfish a=bjfish

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->


Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-11-14 18:16:03 +00:00
bors[bot]
69f8badc20
Merge #960
960: feat(runtime-c-api) Add support for clang in `WASMER_H_MACROS` r=MarkMcCaskey a=Hywan

In #952, the `WASMER_H_MACROS` constant has been defined. The `ARCH_X86_64` constant is defined under 2 conditions: If the compiler is MSVC + `_M_AMD64` is defined, or if the compiler is GCC + `__x86_64__` is defined.

Clang is missing. And it breaks some projects (like https://github.com/wasmerio/php-ext-wasm or https://github.com/wasmerio/go-ext-wasm for instance).

This patch supports Clang.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-14 17:42:42 +00:00
losfair
342974effd Comment out failing test. 2019-11-15 00:23:10 +08:00
losfair
a9c89eb1a8 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-14 23:46:15 +08:00
Ivan Enderlin
074a8f9747 Merge branch 'fix-runtime-c-api-header-preprocessor-clang' of github.com:Hywan/wasmer into fix-runtime-c-api-header-preprocessor-clang 2019-11-14 14:46:09 +01:00
Ivan Enderlin
c43a7c78d0
Merge branch 'master' into fix-runtime-c-api-header-preprocessor-clang 2019-11-14 14:45:27 +01:00
Ivan Enderlin
987b0765c0 chore(runtime-c-api) Update header files. 2019-11-14 14:37:55 +01:00
Ivan Enderlin
42b02bee71 fix(runtime-c-api) Write macros at column 0. 2019-11-14 14:37:06 +01:00
Brandon Fish
929bff9df8 Add deny missing docs to runtime lib 2019-11-13 22:59:21 -06:00
bors[bot]
fff16c08d0
Merge #965
965: Add categories and keywords to `Cargo.toml`s r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-13 23:47:56 +00:00
Mark McCaskey
9127eaf825 Add categories and keywords to Cargo.tomls 2019-11-13 15:46:09 -08:00
Syrus Akbary
b71ba82edb
Merge pull request #961 from Hywan/feat-runtime-core-func-macro-with-closures
feat(runtime-core) `func!` supports closures
2019-11-13 14:12:47 -08:00
Ivan Enderlin
c4dffd6f59 doc(runtime-core) Fix typos. 2019-11-13 15:55:45 +01:00
Ivan Enderlin
7b809a765f doc(runtime-core) Improve documentation of func!.
This patch explains that `func!` can consume closures.
2019-11-13 15:54:41 +01:00
Ivan Enderlin
82e4d8e6cc feat(runtime-core) func! supports closures.
This patch allows to write:

```rs
func!(|…| -> … { … })
```
2019-11-13 15:54:09 +01:00
Ivan Enderlin
4e4663cc98
Merge branch 'master' into fix-runtime-c-api-header-preprocessor-clang 2019-11-13 15:53:01 +01:00
Ivan Enderlin
938dedbbce doc(changelog) Add #960. 2019-11-13 15:35:37 +01:00
Ivan Enderlin
be9d7f2e6e chore(runtime-c-api) Update header files. 2019-11-13 15:29:33 +01:00
Ivan Enderlin
b081d17ab0 feat(runtime-c-api) Add support for clang in WASMER_H_MACROS. 2019-11-13 15:28:57 +01:00
Ivan Enderlin
645519c29c fix(runtime-c-api) Use #if defined instead of #ifdef. 2019-11-13 15:28:04 +01:00
bors[bot]
72864934f9
Merge #955
955: feat(runtime-core) Replace the `field-offset` crate by a custom `offset_of!` macro r=Hywan a=Hywan

The `field-offset` crate is unmaintained. When using its `offset_of!`
macro on a struct with a field of type `std::ptr::NonNull`, in release
mode, it generates a sigill.

This patch removes the `field-offset` crate, and implements a custom
`offset_of!` macro.

See #925 last commits to see an illustration of this bug.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-13 13:15:48 +00:00
Ivan Enderlin
8f20a28ab1
Merge branch 'master' into feat-runtime-core-field-offset 2019-11-13 13:22:41 +01:00
losfair
66e9184226 Specify test-threads=1 for singlepass spectests. 2019-11-13 15:06:42 +08:00
losfair
605ada7ad7 Run cargo fmt. 2019-11-13 14:53:34 +08:00
losfair
ccc474bd5d Remove debug files. 2019-11-13 14:53:11 +08:00
losfair
08a1dd3e8c Merge master and add documentation. 2019-11-13 14:52:22 +08:00
losfair
e2956e7b1a Run cargo fmt 2019-11-13 14:34:04 +08:00
losfair
47f1e2a4ef Fix parameter loading. 2019-11-13 14:18:21 +08:00
losfair
c552514fd2 Disable NaN canonicalizing on aarch64. 2019-11-13 11:35:44 +08:00
Mark McCaskey
064ffd3938
Merge branch 'master' into feature/add-support-for-new-wasi 2019-11-12 17:04:55 -08:00
Mark McCaskey
2b2a0628f7 Update from feedback, improve docs on new wasi fns 2019-11-12 17:02:07 -08:00
Mark McCaskey
f1e5cd39d8 Add support for new WASI snapshot, backwards compat too 2019-11-12 13:01:03 -08:00
bors[bot]
d64d070c9f
Merge #954
954: Deny missing docs in the clif backend crate r=bjfish a=bjfish

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
Deny missing docs in the clif backend crate
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->




Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-11-12 18:46:08 +00:00
Brandon Fish
af12bf4f68
Merge branch 'master' into feature/deny-missing-docs-clif-backend 2019-11-12 11:43:54 -06:00
losfair
f1339b4033 Fix known_registers size. 2019-11-13 01:00:27 +08:00
bors[bot]
8e32c9b3c6
Merge #925
925: feat(runtime-core) Support closures with a captured environment as host functions r=Hywan a=Hywan

Reboot of #882 and #219.

For the moment, host functions (aka imported functions) can be regular function pointers, or (as a side-effect) closures without a captured environment. This PR extends the support of host functions to closures with a captured environment. This is required for many other features (incl. the Python integration, the Ruby integration, WebAssembly Interface Types [see #787], and so on).

This PR is the culmination of previous ones, notably #915, #916 and #917. 

### General idea

The user-defined host function is wrapped inside a `wrap` function. This wrapper function initially receives a `vm::Ctx` as its first argument, which is passed to the host function when necessary. The patch keeps this behavior but it comes from `vm::FuncCtx`, which is a new structure. A `vm::FuncCtx` is held by `vm::ImportedFunc` such as:

```rust
#[repr(C)]
pub struct ImportedFunc {
    pub(crate) func: *const Func,
    pub(crate) func_ctx: NonNull<FuncCtx>,
}
```

where `vm::FuncCtx` is:

```rust
#[repr(C)]
pub struct FuncCtx {
    pub(crate) vmctx: NonNull<Ctx>,
    pub(crate) func_env: Option<NonNull<FuncEnv>>,
}
```

where `vm::FuncEnv` is:

```rust
#[repr(transparent)]
pub struct FuncEnv(pub(self) *mut c_void);
```

i.e. a raw opaque pointer.

So the wrapper function of a host function receives a `vm::Ctx`, which is used to find out the associated `FuncCtx` (by using the import backing), which holds `vm::FuncEnv`. It holds a pointer to the closure captured environment.

### Implementation details

#### How to get a pointer to a closure captured environment

A closure with a captured environment has a memory size greater than zero. This is how we detect it:

```rust
if mem::size_of::<Self>() != 0 { … }
```

To get a pointer to its captured environment, we use this statement:

```rust
NonNull::new(Box::into_raw(Box::new(self))).map(NonNull::cast)
```

(in `typed_func.rs`, in the `wrap` functions).

To reconstruct the closure based on the pointer, we use this statement:

```rust
let func: &FN = {
    let func: NonNull<FN> = func_env.cast();
    &*func.as_ptr()
};
```

That's basically how it works. And that's the core idea of this patch.

As a side effect, we have removed an undefined behavior (UB) in 2 places: The `mem::transmute(&())` has been removed (it was used to get the function pointer of `FN`). The transmute is replaced by `FuncEnv`, which provides a unified API, erasing the difference between host functions as closures with a captured environment, and host functions as function pointer. For a reason I ignore, the UB wasn't showing himself until this PR and a modification in the Singlepass backend. But now it's fixed.

#### Impact on `Backing`

After the modification on the `typed_func` and the `vm` modules, this is the other core idea of this patch: Updating the `backing` module so that `vm::ImportedFunc` replaces `vm::Ctx` by `vm::FuncCtx`.

When creating `vm::ImportedFunc`, a new `vm::FuncCtx` is created and its pointer is used. We are purposely leaking `vm::FuncCtx` so that the pointer is always valid. Hence the specific `Drop` implementation on `ImportBacking` to dereference the pointer, and to drop it properly.

#### Impact on the backends

Since the structure of `vm::ImportedFunc` has changed, backends must be updated. We must deref `FuncCtx` to reach its `vmctx` field.

#### Impact on `Instance`

Because `vm::ImportedFunc` has changed, it has a minor impact on the `instance` module, nothing crazy though.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-12 14:18:46 +00:00
Ivan Enderlin
a1e8a8f0db fix(runtime-core) Same bug with field-offset as before.
It will be fixed in a following PR.
2019-11-12 15:17:36 +01:00
Ivan Enderlin
0775d496d3 feat(runtime-core) Replace the field-offset crate by a custom offset_of! macro.
The `field-offset` crate is unmaintained. When using its `offset_of!`
macro on a struct with a field of type `std::ptr::NonNull`, in release
mode, it generates a sigill.

This patch removes the `field-offset` crate, and implements a custom
`offset_of!` macro.
2019-11-12 15:12:31 +01:00
Ivan Enderlin
5d6c74bfaa doc(changelog) Fix last release number, and fix CS. 2019-11-12 14:37:18 +01:00
Ivan Enderlin
89859a9ab5 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 14:36:33 +01:00
Ivan Enderlin
0de7f4fd0b test(runtime-core) offset_of! fails with a struct containing NonNull types.
It fails only in release mode. That's a bug from the `field-offset`
crate. This patch is a temporary fix.
2019-11-12 14:34:55 +01:00
Heyang Zhou
8db67e452e
Merge pull request #943 from bjfish/singlepass-aarch64-travis
Singlepass Travis CI build
2019-11-12 21:24:15 +08:00
Brandon Fish
91b5059506 Deny missing docs in the clif backend crate 2019-11-11 20:05:04 -06:00
Syrus Akbary
3991db5b78
Merge pull request #953 from wasmerio/release-0.10.1
Prepare for 0.10.1 release
2019-11-11 16:24:13 -08:00
Mark McCaskey
69950d9e5f Prepare for 0.10.1 release 2019-11-11 16:22:37 -08:00
Ivan Enderlin
22abd8efdc doc(runtime-core) Add missing doc on vm::FuncCtx. 2019-11-12 01:10:32 +01:00
Ivan Enderlin
cf33bf8b20
Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 00:58:24 +01:00
Ivan Enderlin
f002f03e5d chore(changelog) Fix CS. 2019-11-12 00:56:34 +01:00
Ivan Enderlin
95706160ee Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 00:55:40 +01:00
Ivan Enderlin
bb81614be4 feat(llvm-backend) Update ImportedFunc structure.
`vm::ImportedFunc` in `runtime-core` has changed. Update LLVM accordingly.
2019-11-12 00:52:14 +01:00
Ivan Enderlin
06c6b3c8e8 feat(runtime-core) More ABI compatible definition of Func and FuncEnv. 2019-11-12 00:52:14 +01:00
Ivan Enderlin
11f34a9285 feat(clif-backend,singlepass-backend) Feed imported functions with FuncCtx.vmctx. 2019-11-12 00:51:57 +01:00
Ivan Enderlin
98e4ef066a feat(runtime-core) Feed imported functions with vm::Ctx again.
… and look for the associated `vm::FuncCtx`. This way, we don't break
the rule: “all functions receive a vmctx pointer as first argument.”.
2019-11-12 00:50:25 +01:00
bors[bot]
4c14ab0b8b
Merge #952
952: Generate C preprocessor code to hide things not on Windows r=MarkMcCaskey a=MarkMcCaskey

resolves #804 

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-11-11 23:19:19 +00:00
nlewycky
08c66d6b77
Fix typo. 2019-11-11 14:52:17 -08:00
Mark McCaskey
e121c47f18 Generate C preprocessor code to hide things not on Windows 2019-11-11 14:47:25 -08:00
Syrus Akbary
2343075bd9
Update azure-pipelines.yml 2019-11-11 14:14:09 -08:00
Syrus Akbary
239e1e0544
Update azure-pipelines.yml 2019-11-11 13:31:38 -08:00
Syrus Akbary
26472d634c
Merge pull request #951 from wasmerio/release-0.10.0
Prepare for 0.10.0 release
2019-11-11 12:18:45 -08:00
Mark McCaskey
cd6ff0a34a
Add links to contributors
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2019-11-11 12:18:16 -08:00
Mark McCaskey
0a216c0779 Prepare for 0.10.0 release 2019-11-11 12:13:53 -08:00
Syrus Akbary
114ae21d63
Merge pull request #949 from wasmerio/fix/release-pipeline
Update release pipeline
2019-11-11 12:00:27 -08:00
Mark McCaskey
40b1955d99 Update release pipeline 2019-11-11 11:51:49 -08:00
bors[bot]
25ebbaae3d
Merge #923
923: Add probable fix of memory leak in trampoline code r=MarkMcCaskey a=MarkMcCaskey

might be what's needed for #810 ; but despite my best efforts I could not get asan working on osx, so I did not test it.

By my count this accounts for 40 bytes, so there may be another issue

edit: unless Rust is optimizing out turning a zero-sized type into a Box, in which case, this should account for 48 bytes

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-11 18:57:12 +00:00
bors[bot]
8233f4cae4
Merge #941
941: Emit direct calls for local functions. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-11 17:52:10 +00:00
bors[bot]
5e71a8f094
Merge #942
942: Deny missing docs in runtime core and add missing docs r=bjfish a=bjfish

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
Deny missing docs in runtime core and add missing docs
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-11-10 22:29:44 +00:00
Brandon Fish
a74acb7a8a Add missing rustdoc for macro debug 2019-11-10 16:28:33 -06:00
Brandon Fish
ea3b6fa6d7 Add missing rustdocs for Windows code 2019-11-10 16:03:43 -06:00
Brandon Fish
82ec5e970a Add additional rustdocs for missing docs found during CI 2019-11-10 15:16:07 -06:00
Brandon Fish
9828a37196 Whitelist specific branches to run 2019-11-10 14:58:55 -06:00
Brandon Fish
2f699a369b Add cmake to CI 2019-11-10 14:51:06 -06:00
Brandon Fish
41d207d296 Trigger a build 2019-11-10 14:43:23 -06:00
Brandon Fish
2d00b2589e Update with PR review suggestions 2019-11-10 14:37:36 -06:00
Brandon Fish
1f9316b5ae Update Protect enum with suggestions 2019-11-10 14:31:36 -06:00
Brandon Fish
07ca48a34f Try initial travis arm64 setup 2019-11-10 14:26:11 -06:00
Brandon Fish
328ab0a93b Remove macro identifiers which don't work in rustdoc comments 2019-11-10 13:43:39 -06:00
Brandon Fish
ff4c157285 Add runtime core deny missing docs description to changelog 2019-11-10 13:15:32 -06:00
Brandon Fish
aad390d09d Deny missing docs in runtime core and add missing docs 2019-11-10 13:13:18 -06:00
losfair
03c5614203 Rerun cargo fmt 2019-11-11 02:00:16 +08:00
losfair
03a9d1ad60 Cargo fmt 2019-11-11 01:43:16 +08:00
losfair
7d5699c19d Add missing instructions for aarch64. 2019-11-11 01:43:01 +08:00
losfair
899fbed35d Merge master. 2019-11-11 01:42:43 +08:00
bors[bot]
0d644a53db
Merge #939
939: Fix WASI append bug, add test r=MarkMcCaskey a=MarkMcCaskey

resolves #936 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-11-09 00:34:07 +00:00
Mark McCaskey
adc9f3d479 Explicitly delete temp file in fd_append test 2019-11-08 16:33:08 -08:00
bors[bot]
23c9dbd9f3
Merge #938
938: Fuzz all the backends. r=nlewycky a=nlewycky

![](https://i.imgflip.com/3fq2bw.jpg)


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-08 23:54:53 +00:00
Nick Lewycky
ed6ce4b9b4 Don't create functions for imports, we still call those indirectly. 2019-11-08 14:44:59 -08:00
Nick Lewycky
2957b6abd8 Emit direct calls for local functions, but not for imports. 2019-11-08 14:44:50 -08:00
Syrus Akbary
3341528f71
Merge branch 'master' into fix/wasi-append 2019-11-08 14:21:24 -08:00
Nick Lewycky
674a70fa05 Create function declarations before starting the body of the first function. 2019-11-08 13:13:58 -08:00
bors[bot]
5fee189e30
Merge #940
940: Update supported Rust version to 1.38 r=MarkMcCaskey a=MarkMcCaskey

Bump stable version to latest release - 1

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-08 21:06:48 +00:00
Syrus Akbary
e80ffed109
Merge pull request #937 from wasmerio/nlewycky/fuzzer-spectests-extensions
Pass --enable-all to wasm2json when building corpus out of spectests.
2019-11-08 11:43:45 -08:00
Mark McCaskey
a94fabf56e Update supported Rust version to 1.38 2019-11-08 11:40:53 -08:00
Mark McCaskey
64783423ea Fix WASI append bug, add test 2019-11-08 11:17:04 -08:00
Nick Lewycky
6370e11034 Fuzz all the backends. 2019-11-08 11:10:44 -08:00
Nick Lewycky
37268b2f46 Pass --enable-all to wasm2json when building corpus out of spectests. 2019-11-08 10:41:42 -08:00
bors[bot]
38f4fdb195
Merge #935
935: Apply TBAA to the correct instruction. r=nlewycky a=nlewycky

Another instance of the bug in PR #933.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-07 20:57:19 +00:00
Nick Lewycky
dccaa3a285 Apply TBAA to the correct instruction.
Another instance of the bug in PR #933.
2019-11-07 12:42:29 -08:00
Ivan Enderlin
ba87af5b1a feat(runtime-core) Ability for an export function to get a func env. 2019-11-07 20:44:17 +01:00
bors[bot]
374fd5b393
Merge #933
933: Apply TBAA to the correct instruction. r=syrusakbary a=nlewycky

Caught by LLVM verifier complaining about !tbaa on a getelementptr.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-07 14:09:57 +00:00
Ivan Enderlin
2e05104d45 fix(runtime-core) Introduce Context::ExternalWithEnv.
Host functions use `Context::External` with a `*mut vm::FuncCtx`
pointer, casted to `*mut vm::Ctx`. It creates a conflict with exports
that also use `Context::External`.

This patch introduces `Context::ExternalWithEnv` to create a specific
path in the code for an external context with `*mut vm::FuncEnv`.

This patch fixes all the `linking.wast` tests in the spectests.
2019-11-07 14:32:19 +01:00
Ivan Enderlin
dfaad35f8d fix(spectests) Remove a warning. 2019-11-07 14:31:43 +01:00
Nick Lewycky
203efd0c06 Apply TBAA to the correct instruction.
Caught by LLVM verifier complaining about !tbaa on a getelementptr.
2019-11-06 23:25:39 -08:00
losfair
50c30ab212 runtime-core: Support cross-compilation. 2019-11-07 01:30:45 +08:00
losfair
001213716e Add fneg. 2019-11-07 01:30:27 +08:00
losfair
6135a004a4 Add itruncf/fconverti fast path. 2019-11-07 01:11:25 +08:00
Ivan Enderlin
ac8aece380 doc(changelog) Add #915, #917 and #925. 2019-11-06 14:57:10 +01:00
Ivan Enderlin
cf74b68c37 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-06 14:48:47 +01:00
Ivan Enderlin
6f84a6f15b test(runtime-core) Remove a warning in tests. 2019-11-06 14:48:47 +01:00
Ivan Enderlin
5ccaf12b2a doc(runtime-core) Fix inline documentations. 2019-11-06 14:48:47 +01:00
Ivan Enderlin
c4c88f8af5 fix(runtime-core) Remove undefined behavior with mem::transmute.
In the `wrap` functions, we use `std::mem::transmute(&())` to get the
pointer to the value “around” `wrap` (`Fn` has a method `to_raw` which
declares a `wrap` function, which uses `transmute` to retrieve
`Fn`). This is an undefined behavior. It was working until the
`FuncCtx` is introduced. Since then, the undefined behavior was
causing an error with the Singlepass backend.

This patch stores the pointer to `Fn` in `func_env`, so that the
pointer to the user-defined host function is always predictable.
2019-11-06 14:48:46 +01:00
Ivan Enderlin
a4ba429ed0 feat(singlepass-backend) Inject FuncCtx to the function pointer of an host function. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
215e4458f0 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-06 14:48:46 +01:00
Ivan Enderlin
a9e0e9baeb test(runtime-core) Write more documentation. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
293b71ac54 doc(runtime-core) Write more documentation. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
0f82cd3c40 doc(runtime-core) Write more documentation. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
81326cee13 doc(runtime-core) Write more documentation. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
3435ce436b test(runtime-core) Extract assert as tests. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
a52b4b2280 test(runtime-core) Test closures with a captured environment. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
3b34a9187a chore(runtime-core) Remove dbg!. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
2a041f898e !temp 2019-11-06 14:48:46 +01:00
Ivan Enderlin
0e27f2fa72 test(runtime-core) Test more host functions as closures. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
6035bd2d9b feat(runtime-core,clif-backend,llvm-backend) Rename an ImportFunc offset.
`ImportedFunc::offset_vmctx` becomes `ImportedFunc::offset_func_ctx`.
2019-11-06 14:48:46 +01:00
Ivan Enderlin
e002c377ef feat(runtime-core) vm::ImportedFunc and vm::FuncCtx have NonNull pointers. 2019-11-06 14:48:46 +01:00
Ivan Enderlin
177c507a4e feat(runtime-core) Introduce vm::FuncCtx.
`vm::FuncCtx` replaces `vm::Ctx` as first argument passed to host
functions (aka imported functions).
2019-11-06 14:48:46 +01:00
bors[bot]
07a6fde420
Merge #932
932: Fix typo in comment. r=nlewycky a=nlewycky



Co-authored-by: nlewycky <nick@wasmer.io>
2019-11-05 19:32:26 +00:00
nlewycky
dc437bb4e7
Fix typo in comment. 2019-11-05 11:31:14 -08:00
bors[bot]
c07e6058f9
Merge #929
929: Update __wasi_rights_t and __wasi_signal_t with published changes r=MarkMcCaskey a=MarkMcCaskey

Follow up to #926 ; fixes everything else listed at https://github.com/WebAssembly/WASI/pull/135

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-05 18:24:43 +00:00
losfair
015491ea77 Add floating point instructions. 2019-11-06 01:43:41 +08:00
Patrick Ventuzelo
006bce0ca1
Merge branch 'master' into ventuzelo/fix-857-panic-loader-parameter 2019-11-05 10:06:00 +01:00
bors[bot]
5f9670fc19
Merge #931
931: Build Metadata using the current Context. r=nlewycky a=nlewycky

Fixes #927. Reverts #928.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-05 00:27:52 +00:00
Nick Lewycky
1d8f2b767d Build Metadata using the current Context.
Fixes #927. Reverts #928.
2019-11-04 15:27:38 -08:00
Mark McCaskey
ef5faccb76 Update __wasi_rights_t and __wasi_signal_t with published changes 2019-11-04 13:45:19 -08:00
bors[bot]
bbcccafc54
Merge #926 #928
926: Fix values of __wasi_advice_t r=nlewycky a=MarkMcCaskey

Issue identified in https://github.com/WebAssembly/WASI/issues/132 ; 

928: Add workaround for #927. r=MarkMcCaskey a=nlewycky

# Description

Add `--test-threads 1` to workaround #927.

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-04 19:20:34 +00:00
Nick Lewycky
efbb53a91e Add workaround for #927. 2019-11-04 11:04:50 -08:00
Mark McCaskey
aaa0160c95 Fix values of __wasi_advice_t 2019-11-04 10:48:42 -08:00
bors[bot]
69cc2f60bb
Merge #920
920: Export WasmPtr from wasmer_runtime r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-04 18:46:13 +00:00
bors[bot]
b9a9949281
Merge #921
921: Apply TBAA metadata in the LLVM backend. r=nlewycky a=nlewycky

# Description
Inform LLVM that the pointers to memory, globals, locals, etc., are distinct.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-11-02 01:05:20 +00:00
Nick Lewycky
c0c7661c65 Merge branch 'master' of github.com:wasmerio/wasmer into feature/llvm-tbaa 2019-11-01 17:53:52 -07:00
Nick Lewycky
132757ee9d Fix leak. Only create one NamedMDNode for each name. 2019-11-01 17:49:45 -07:00
Mark McCaskey
8d95e637f2 Add probable fix of memory leak in trampoline code 2019-11-01 17:38:43 -07:00
bors[bot]
d8888c9459
Merge #911
911: Don't emit bounds checks when the offset is known at compile time to be less than the minimum memory size. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-01 19:53:17 +00:00
Nick Lewycky
20270411d9 When the const memory access is not larger than the minimum, use a runtime check.
The memory may have grown.
2019-11-01 12:49:54 -07:00
Nick Lewycky
bc521a2837 Add changelog entry. 2019-10-31 12:43:38 -07:00
Nick Lewycky
ef4b3c3428 Improve some TBAA label names, particular for memory.
Memory can't change between static and dynamic, so use that in the TBAA label
name.

Distinguish between local and imported memory, table and globals.
2019-10-31 12:40:32 -07:00
Syrus Akbary
e115d356a7
Update feature_matrix.md 2019-10-31 12:14:16 -07:00
Syrus Akbary
efc7385855
Merge pull request #922 from wasmerio/add-os-section-to-fetaure-matrix
Add OS compatibility section to feature matrix
2019-10-31 12:13:11 -07:00
Syrus Akbary
2b236be941
Update docs/feature_matrix.md 2019-10-31 12:12:56 -07:00
nlewycky
0e665c4001
Merge branch 'master' into feature/llvm-tbaa 2019-10-31 11:55:31 -07:00
Nick Lewycky
0ba686ffc6 Improve wording a little. 2019-10-31 11:50:33 -07:00
Nick Lewycky
88427c9696 Add some comments. 2019-10-31 11:48:52 -07:00
Mark McCaskey
16124672a3 Add OS compatibility section to feature matrix 2019-10-31 09:55:55 -07:00
bors[bot]
656491a337
Merge #917
917: feat(runtime-core) Host function without a `vm::Ctx` argument r=Hywan a=Hywan

Extracted from https://github.com/wasmerio/wasmer/pull/882.
~Includes https://github.com/wasmerio/wasmer/pull/916. Must not be merged until #916 lands in `master`.~
~If you want to compare only the different commits, see https://github.com/Hywan/wasmer/compare/feat-runtime-core-tests...Hywan:feat-runtime-core-host-function-without-vmctx?expand=1.~

This patch updates the `ExternalFunction` implementation to support host functions (aka imported functions) without having an explicit `vm::Ctx` argument.

It is thus possible to write:

```rust
fn add_one(x: i32) -> i32 {
    x + 1
}

let import_object = imports! {
    "env" => {
        "add_one" => func!(add_one);
    },
};
```

The previous form is still working though:

```rust
fn add_one(_: &mut vm::Ctx, x: i32) -> i32 {
    x + 1
}
```

The backends aren't modified. It means that the pointer to `vm::Ctx` is still inserted in the stack, but it is not used when the function doesn't need it.

We thought this is an acceptable trade-off.

About the C API. It has not check to ensure the type signature. Since the pointer to `vm::Ctx` is always inserted, the C API can digest host functions with or without a `vm::Ctx` argument. The C API uses [the `Export` + `FuncPointer` API](cf5b3cc09e/lib/runtime-c-api/src/import/mod.rs (L630-L653)) instead of going through the `Func` API (which is modified by this API), which is only possible since the C API only receives an opaque function pointer. Conclusion is: We can't ensure anything on the C side, but it will work with or without the `vm::Ctx` argument in theory.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-10-31 10:00:48 +00:00
Ivan Enderlin
912eb32be8 chore(cargo) Update Cargo.lock. 2019-10-31 11:00:07 +01:00
Ivan Enderlin
2703d48098 Merge branch 'master' into feat-runtime-core-host-function-without-vmctx 2019-10-31 10:59:16 +01:00
bors[bot]
fb0615dc02
Merge #915
915: fix(runtime-core) Share the definition of `Trampoline` across all the backends r=Hywan a=Hywan

Extracted from https://github.com/wasmerio/wasmer/pull/882.

This patch updates all the backends to use the definition of
`Trampoline` as defined in the `wasmer_runtime_core::typed_func`
module. That way, there is no copy of that type, and as such, it is
easier to avoid regression (a simple `cargo check` does the job).

This patch also formats the `use` statements in the updated files.


Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-10-31 09:13:42 +00:00
Nick Lewycky
d10d54a416 Add TBAA to atomic ops. 2019-10-30 16:39:39 -07:00
Nick Lewycky
15ce8bfda7 Label the loads in intrinsics.rs, most of which are the initial accesses off the context.
Move tbaa_label to intrinsics.rs. Move TBAA pass to first in the list, it doesn't get invalidated. Add TBAA labels for internal fields.
2019-10-30 16:18:36 -07:00
Mark McCaskey
25bcadbf74 Export WasmPtr from wasmer_runtime 2019-10-30 16:09:48 -07:00
bors[bot]
36d1c6a638
Merge #919
919: Add start of language intergrations table to feature matrix r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-10-30 22:00:37 +00:00
Nick Lewycky
74eaec968e Remove all *_tbaa fields from LLVMModuleCodeGenerator and LLVMFunctionCodeGenerator. 2019-10-30 14:05:11 -07:00
Mark McCaskey
ea08431ab8 Add start of language intergrations table to feature matrix 2019-10-30 13:51:05 -07:00
Nick Lewycky
e7d1742c63 Update module to be held by Rc<RefCell<>> so that we can pass it to LLVMFunctionCodeGenerator.
Use that to generate distinct TBAA labels for distinct local variables.
2019-10-30 13:11:29 -07:00
Ivan Enderlin
6a1d490a30 doc(runtimecore) Explain ExternalFunctionKind with more details. 2019-10-30 19:34:04 +01:00
Ivan Enderlin
7eef49be12 test(runtime-core) Test host functions without a vm::Ctx argument. 2019-10-30 19:34:04 +01:00
Ivan Enderlin
95e1b85c56 feat(runtime-core) Allow host functions without an explicit vm::Ctx argument.
This patch allows host functions to get a signature without an
explicit `vm::Ctx` argument.

It is for Rust only. The C API receives a function pointer and has no
clue whether a `vm::Ctx` argument is present or not, so it assumes it
is always declared.

From the backend point of view, the pointer to `vm::Ctx` is always
inserted in the stack, but it is not used by the function when the
argument is absent.
2019-10-30 19:34:04 +01:00
Ivan Enderlin
bd9d4d9cc8 test(runtime-core) Add tests for the Func structure. 2019-10-30 19:34:04 +01:00
Ivan Enderlin
77e01f01bd chore(runtime-core) Use vm::Ctx to access it.
Just to be consistent with the rest of the code.
2019-10-30 19:34:04 +01:00
Nick Lewycky
f77d9bfe32 Initial implementation of TBAA for the LLVM backend. 2019-10-30 10:29:51 -07:00
bors[bot]
46cb83738e
Merge #916
916: feat(runtime-core-tests) Introduce the new `wasmer-runtime-core-tests` crate r=Hywan a=Hywan

Extracted from https://github.com/wasmerio/wasmer/pull/882.

This non-publishable new crate contains a test suite for the
`wasmer-runtime-core` crate. So far, the test suite is rather small,
but it aims to be extended in a close future.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-10-30 17:00:18 +00:00
Ivan Enderlin
4e83e1b8e0 chore(runtime-core-tests) Update crate version. 2019-10-30 17:59:07 +01:00
Ivan Enderlin
12a05ca280 chore(makefile) Remove the +nightly flag. 2019-10-30 15:00:31 +01:00
Ivan Enderlin
bdc1ab3412 feat(runtime-core-tests) Introduce the new wasmer-runtime-core-tests crate.
This non-publishable new crate contains a test suite for the
`wasmer-runtime-core` crate. So far, the test suite is rather small,
but it aims to be extended in a close future.
2019-10-30 13:28:01 +01:00
Ivan Enderlin
edb6cbefca fix(runtime-core) Share the definition of Trampoline across all the backends.
This patch updates all the backends to use the definition of
`Trampoline` as defined in the `wasmer_runtime_core::typed_func`
module. That way, there is no copy of that type, and as such, it is
easier to avoid regression (a simple `cargo check` does the job).

This patch also formats the `use` statements in the updated files.
2019-10-30 13:10:34 +01:00
bors[bot]
cf5b3cc09e
Merge #914
914: Fix bug in getting a Memory from export in C API r=Hywan a=MarkMcCaskey

I believe this fixes the non-deterministic crashing on OSX in `go-ext-wasm`

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-10-30 11:34:20 +00:00
Nick Lewycky
7fd20e3355 NFC: Fold variable into initializer. 2019-10-29 22:23:46 -07:00
Mark McCaskey
1e4fa78e11 Fix bug in getting a Memory from export in C API 2019-10-29 15:52:42 -07:00
bors[bot]
2dbe80ad34
Merge #856
856: Add WASI support to C API r=MarkMcCaskey a=MarkMcCaskey

This is an additive change (with one unrelated clean up of `*mut ptr -> *const ptr`).  It exposes the functions to get a WASI import object.  It also implements a function on import object to get an `import` with namespace and name.

These changes should be okay to ship now, we can follow up to finish adding methods to ImportObject on the C API side and start migrating away from  `*imports`.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-10-29 22:39:51 +00:00
Mark McCaskey
d87e81cf62
Merge pull request #912 from wasmerio/nlewycky-patch-1
Use printf portably.
2019-10-29 15:34:40 -07:00
Mark McCaskey
6d6b8779d4
Merge pull request #913 from wasmerio/nlewycky-patch-2
Move the linkage before the type.
2019-10-29 15:34:33 -07:00
nlewycky
44f026adfb
Move the linkage before the type.
Though both orders work, this is customary.
2019-10-29 15:30:59 -07:00
nlewycky
ae07620818
Use printf portably.
PRId64 is defined to the right printf format string to print a int64_t on the current system.
2019-10-29 15:28:59 -07:00
Mark McCaskey
bc9b92c323 Add null checks to new destructors in C API 2019-10-29 15:18:45 -07:00
Mark McCaskey
a104d08c04 Update ImportObject C API to use iterators 2019-10-29 14:55:14 -07:00
Nick Lewycky
9224db6d1e Don't emit bounds checks when the offset is less than the minimum memory size. 2019-10-28 15:57:16 -07:00
bors[bot]
d46e5d499c
Merge #910
910: Use getrandom instead of rand r=MarkMcCaskey a=newpavlov

Closes #909

Note: I am reusing `__WASI_EIO` as an error code to denote a potential OS RNG failure.

Co-authored-by: newpavlov <newpavlov@gmail.com>
Co-authored-by: Artyom Pavlov <newpavlov@gmail.com>
2019-10-28 18:07:18 +00:00
Artyom Pavlov
56475594e9
compilation error fix 2019-10-28 17:57:29 +00:00
newpavlov
8e6f4c448b reuse __WASI_EIO error code 2019-10-28 18:37:14 +03:00
newpavlov
b67f2c9f18 use getrandom instead of rand 2019-10-28 18:33:15 +03:00
Mark McCaskey
aa82df7bc5 Fix github merge
move entry in changelog due to release
2019-10-25 14:52:09 -07:00
Mark McCaskey
c2d3f29cb4
Merge branch 'master' into feature/wasi-in-c-api 2019-10-25 14:38:14 -07:00
Mark McCaskey
2a532b8ce5 Add tests for C API import_object and WASI updates 2019-10-25 14:24:22 -07:00
bors[bot]
8653216b1a
Merge #883
883: For floating point operations, allow inputs to be arbitrary, including SNaNs. r=nlewycky a=nlewycky

# Description
For floating point operations, allow inputs to be arbitrary, including SNaNs.

Instead of ensuring inputs are canonical NaNs on every operation, we tag outputs as pending such a canonicalization check, so that a sequence of computations can have a single canonicalization step at the end.

There's an extra wriggle for SIMD. The Wasm type system only indicates them as V128, so it's possible that we might do computations as F32x4Add, I8x16Add, F64x2Add in a row with no other computations in between. Since a canonicalization may change the bit patterns in a way that transforms one non-NaN to another non-NaN in the next subsequent instructions interpretation, most SIMD functions apply pending canonicalizations to their inputs, even the integer SIMD operations.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-10-25 20:16:19 +00:00
Nick Lewycky
dae99497ee Add changelog entry. 2019-10-25 13:15:32 -07:00
Syrus Akbary
1a91f0e9ca
Merge branch 'master' into feature/llvm-nan-but-fast 2019-10-25 12:52:47 -07:00
bors[bot]
03a5b1fbf4
Merge #901
901: Set target triple and datalayout when creating the LLVM module. r=nlewycky a=nlewycky

We were giving LLVM a triple and datalayout only when producing native code from the LLVM IR. With this change, we tell LLVM as early as possible so that the entire optimization stack knows that it's safe to use target-specific constructs (including target intrinsics `@llvm.x86.sse2.ucomieq.sd`) as well as cost models (for autovectorization) and knowing the bitwidth of the registers so that we can know it's profitable to eliminate redundant extend/truncate casts.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-25 17:57:11 +00:00
bors[bot]
83c63d0b27
Merge #904
904: Use getelementptr instruction instead of int_to_ptr and ptr_to_int. r=nlewycky a=nlewycky

The main part of this change is that we no longer turn pointers into integers to do arithmetic on them, then turn them back into pointers. Doing so is a signal to LLVM that it should not attempt to analyze the provenance of the pointers, disabling some optimizations. Using getelementptr allows us to perform arithmetic on pointers while keeping them in pointer types, which LLVM can then analyze.

Most of the textual change is a refactoring to reorder the operations. Previously the bounds checking and determining of the base and bounds were combined because you could put both into the same match, since both actions are performed differently depending on whether the memory is static or dynamic. In this case, we simply check the type twice and do two different things, with comments labelling the steps.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-25 17:22:25 +00:00
Syrus Akbary
1fee31b525
Merge pull request #905 from Maxgy/master
fix README grammar
2019-10-25 01:03:15 -07:00
Maxwell Anderson
a52246bb9d
fix README grammar 2019-10-24 21:54:30 -04:00
Nick Lewycky
f3d4fde7ef Run cargo update to pick up new commit to wasmerio/inkwell llvm8-0 branch. 2019-10-24 18:15:39 -07:00
Nick Lewycky
9c71561927 Rewrite resolve_memory_ptr to use GEPs as much as possible.
ptr_to_int and int_to_ptr are not treated the same as type-safe pointer operations. LLVM intentionally performs fewer optimizations to code using the former as compared with the latter. We don't need that in our code, standard pointer optimizations are safe for us.
2019-10-24 18:15:32 -07:00
bors[bot]
56f9651a90
Merge #902
902: Insert allocas as a contiguous block at the top of the entry block. r=syrusakbary a=nlewycky

This minimizes the chance we accidentally get categorized as having a dynamic alloca.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-24 21:06:51 +00:00
Mark McCaskey
80cfeb590e Clean up comments
add headers too
2019-10-24 11:51:35 -07:00
Nick Lewycky
894c5084f3 Insert allocas as a contiguous block at the top of the entry block.
This minimizes the chance we accidentally get categorized as having a dynamic alloca.
2019-10-23 19:21:12 -07:00
Nick Lewycky
bc64b4ce6c Set target triple and datalayout when creating the LLVM module. 2019-10-23 16:04:29 -07:00
bors[bot]
aa8b968d40
Merge #900
900: Prepare for 0.9.0 release r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-10-23 20:43:47 +00:00
Mark McCaskey
82f258b888 Prepare for 0.9.0 release 2019-10-23 13:40:35 -07:00
bors[bot]
9ccbe2da9b
Merge #861
861: [fix issue #679] add details when calling unimplemented! r=MarkMcCaskey a=pventuzelo

# Description

As discuss in issue #679, `unimplemented!` should provide a string to explain at least where the issue occurs. This pull request only add messages on existing `unimplemented!` and don't change any previous logics/behaviors in the code.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-10-23 19:30:44 +00:00
Mark McCaskey
0fd0ab6e58
Merge branch 'master' into ventuzelo/add-detail-unimplemented-calls-runtime 2019-10-23 12:30:14 -07:00
bors[bot]
c2c03172df
Merge #894
894: Bump indexmap from 1.2.0 to 1.3.0 r=nlewycky a=dependabot-preview[bot]

Bumps [indexmap](https://github.com/bluss/indexmap) from 1.2.0 to 1.3.0.
<details>
<summary>Commits</summary>

- [`c820451`](c8204515dc) 1.3.0
- [`4868359`](4868359456) DOC: Edit README and release notes for 1.3. Clean up a bit in the readme.
- [`899fc93`](899fc93a0b) DOC: Add a doc section drawing attention to some extra features
- [`aef602a`](aef602a139) Merge pull request [#106](https://github-redirect.dependabot.com/bluss/indexmap/issues/106) from bluss/auto-nostd
- [`c7d07f1`](c7d07f1b59) FIX: Use repr(transparent) on &str wrapper in benchmark
- [`634c503`](634c5031a0) Merge pull request [#107](https://github-redirect.dependabot.com/bluss/indexmap/issues/107) from bluss/take-back-deprecation-warnings
- [`6bd5fb6`](6bd5fb67af) MAINT: Update crate keywords and categories
- [`3e8d9b5`](3e8d9b5c80) DOC: Add docs for nostd
- [`268665b`](268665b0aa) API: Remove deprecation warnings on the removal methods again
- [`aa0778a`](aa0778a59c) FEAT: indexmap!() macros require std
- Additional commits viewable in [compare view](https://github.com/bluss/indexmap/compare/1.2.0...1.3.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=indexmap&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)](https://dependabot.com/compatibility-score.html?dependency-name=indexmap&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-10-23 18:48:26 +00:00
dependabot-preview[bot]
0818a0434b
Bump indexmap from 1.2.0 to 1.3.0
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.2.0...1.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-23 18:45:38 +00:00
bors[bot]
2954b6fee4
Merge #895
895: Bump libc from 0.2.62 to 0.2.65 r=nlewycky a=dependabot-preview[bot]

Bumps [libc](https://github.com/rust-lang/libc) from 0.2.62 to 0.2.65.
<details>
<summary>Commits</summary>

- [`53bdffc`](53bdffc028) Auto merge of [#1557](https://github-redirect.dependabot.com/rust-lang/libc/issues/1557) - gnzlbg:dupe, r=gnzlbg
- [`8823376`](8823376ffa) Remove duplicate target
- [`07d1f7a`](07d1f7a495) Remove broken link
- [`5041053`](504105347a) Do not run style checks on master
- [`39decff`](39decff1f6) Add job on master that publishes the website
- [`bf877ba`](bf877ba712) Auto merge of [#1549](https://github-redirect.dependabot.com/rust-lang/libc/issues/1549) - GrayJack:solaris-settime, r=gnzlbg
- [`bc5c15e`](bc5c15efd0) Auto merge of [#1556](https://github-redirect.dependabot.com/rust-lang/libc/issues/1556) - senden9:patch-1, r=gnzlbg
- [`5747422`](5747422855) Sort targets in documentation. Fixes [#1524](https://github-redirect.dependabot.com/rust-lang/libc/issues/1524).
- [`6dae870`](6dae870ecd) Auto merge of [#1554](https://github-redirect.dependabot.com/rust-lang/libc/issues/1554) - nmattia:nm-mcontext, r=gnzlbg
- [`e691d94`](e691d9490e) Ensure comments are no longer than 80 chars
- Additional commits viewable in [compare view](https://github.com/rust-lang/libc/compare/0.2.62...0.2.65)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=libc&package-manager=cargo&previous-version=0.2.62&new-version=0.2.65)](https://dependabot.com/compatibility-score.html?dependency-name=libc&package-manager=cargo&previous-version=0.2.62&new-version=0.2.65)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-10-23 18:06:35 +00:00
dependabot-preview[bot]
efce780807
Bump libc from 0.2.62 to 0.2.65
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.62 to 0.2.65.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.62...0.2.65)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-23 17:45:10 +00:00
bors[bot]
f1bb385751
Merge #893
893: Bump cc from 1.0.45 to 1.0.46 r=nlewycky a=dependabot-preview[bot]

Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.45 to 1.0.46.
<details>
<summary>Commits</summary>

- [`e83150e`](e83150ecd0) Bump to 1.0.46
- [`0eeafcc`](0eeafcc903) Added public function to add flags to archiver
- [`047bf5b`](047bf5b128) Fix typo in lib.rs doc
- [`02ed9e6`](02ed9e6895) add mechanism for forcing frame pointer.
- [`0ed1d0a`](0ed1d0a146) Fix Windows CI for now
- See full diff in [compare view](https://github.com/alexcrichton/cc-rs/compare/1.0.45...1.0.46)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.0.45&new-version=1.0.46)](https://dependabot.com/compatibility-score.html?dependency-name=cc&package-manager=cargo&previous-version=1.0.45&new-version=1.0.46)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-10-23 17:09:05 +00:00
bors[bot]
d2f9047952
Merge #899
899: Remove dead intrinsics. r=Hywan a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-23 12:32:09 +00:00
Nick Lewycky
6410da9c24 Remove dead intrinsics. 2019-10-22 23:36:18 -07:00
bors[bot]
912beff1fe
Merge #898
898: Disable track-state by default, disable @llvm.experimental.stackmap emission in the LLVM backend when it's disabled. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-23 06:24:55 +00:00
Nick Lewycky
92f0b1b2e3 Thread whether state tracking is enabled into the LLVM backend. 2019-10-22 23:15:05 -07:00
Nick Lewycky
93dc713330 Flip the default for 'track-state' from on to off. The flag is --track-state. 2019-10-22 23:14:42 -07:00
bors[bot]
6e69374a07
Merge #897
897: Remove special casing of stdin, stdout, and stderr in WASI FS r=MarkMcCaskey a=MarkMcCaskey


# Description
Properly fixes closing stdin, stdout, stderr.  Cleans up this part of the code while it's at it.

This PR introduces breaking changes to the pubic WASI API

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-10-23 00:30:14 +00:00
Mark McCaskey
5353af79ad Improve fd_close wasi test: explicitly close file 2019-10-22 17:29:19 -07:00
Mark McCaskey
3a87edc0c1 Remove special casing of stdin, stdout, and stderr in WASI FS 2019-10-22 16:40:01 -07:00
Mark McCaskey
5327a8b686
Merge pull request #873 from Hywan/feature/wasi-in-c-api
Update feature/wasi-in-c-api
2019-10-22 12:14:37 -07:00
dependabot-preview[bot]
85ddbe38da
Bump cc from 1.0.45 to 1.0.46
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.45 to 1.0.46.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.45...1.0.46)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-22 18:16:36 +00:00
bors[bot]
77527c23ce
Merge #877
877: Reimplement F32Min, F32Max, F64Min and F64Max. r=nlewycky a=nlewycky

# Description
Reimplement F32Min, F32Max, F64Min and F64Max.

Adds XMM8--15 registers. Adds VMOVA, VBLEND and VXORP, and the VCMPUNORD and VCMPORD comparisons.

Fixes 419 test failures.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-22 17:33:44 +00:00
Nick Lewycky
88dc613385 Save and restore the additional XMM registers in OSR too. 2019-10-21 19:44:16 -07:00
Syrus Akbary
fe158d0ce9
Merge pull request #886 from Hywan/fix-win-exception-handler-cargo-build-deps
fix(win-exception-handler) Remove `bindgen` and `regex` from cargo build deps
2019-10-21 17:02:11 -07:00
bors[bot]
cf1f4c781e
Merge #887
887: Get aggressive about running cargo check over all packages with all features. r=nlewycky a=nlewycky

Fixes the one issue uncovered. The capstone disassembling support in the LLVM backend was broken. Fixed by removing it. Instead, use the `--llvm-object-file` flag to get a finished object file to disassemble with any disassembler.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-10-21 22:43:09 +00:00
Mark McCaskey
b3e8202138 Clean up Makefile after talking with Nick 2019-10-21 15:15:11 -07:00
Nick Lewycky
3d3aef6df3 Merge branch 'master' of github.com:wasmerio/wasmer into feature/llvm-nan-but-fast 2019-10-21 12:33:35 -07:00
bors[bot]
209a8fa08c
Merge #889
889: fix(singlepass-backend) Use wasmparser from `runtime-core` r=Hywan a=Hywan

The `wasmer-runtime-core` crate re-exports the `wasmparser`
crate. This patch updates the `singlepass-backend` crate to use
`wasmparser` through the `wasmer-runtime-core` crate, which removes a
direct dependency for this crate.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-10-21 19:29:46 +00:00
Syrus
33a2b361b0 Added JavaScript to the list of supported implementations 2019-10-21 12:09:10 -07:00
Nick Lewycky
813f6414e0 Remove dead functions, don't leave them commented out. 2019-10-21 11:16:51 -07:00
bors[bot]
da38cb85b4
Merge #892
892: Fix a few typos I've spotted. r=Hywan a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-19 13:22:56 +00:00
Nick Lewycky
10dddf9904 Fix repeated typo in comment. 2019-10-18 16:34:45 -07:00
Nick Lewycky
961684a8e0 Adjust comment rulers. 2019-10-18 16:33:49 -07:00
Nick Lewycky
8424b61444 Fix typo in comment. 2019-10-18 16:33:49 -07:00
Nick Lewycky
dde31076a8 Grammer in comment. 2019-10-18 13:00:40 -07:00
Ivan Enderlin
e559b54309 fix(singlepass-backend) Use wasmparser from runtime-core.
The `wasmer-runtime-core` crate re-exports the `wasmparser`
crate. This patch updates the `singlepass-backend` crate to use
`wasmparser` through the `wasmer-runtime-core` crate, which removes a
direct dependency for this crate.
2019-10-18 11:22:40 +02:00
bors[bot]
33f6c0278d
Merge #867
867: Initial implementation of `assert_uninstantiable`. r=nlewycky a=nlewycky

# Description
Add a basic implementation of `assert_uninstantiable` in the spectest runner. Fixes one line of spectests in all three backends.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-18 02:24:14 +00:00
Nick Lewycky
fbe2701a93 I meant 'skip' not 'fail'. 2019-10-17 19:23:36 -07:00
Nick Lewycky
675399909a Skip this test on windows + cranelift. It crashes the whole spectest runner.
This exclusion is no worse than before where this test was silently ignored.
2019-10-17 18:38:11 -07:00
Nick Lewycky
87d272e31e Initial implementation of AssertUninstantiable. Fixes linking.wast:387. 2019-10-17 18:37:49 -07:00
Nick Lewycky
b180a2e14c Get aggressive about running cargo check over all packages with all features.
Fixes the one issue uncovered. The capstone disassembling support in the LLVM backend was broken. Fixed by removing it. Instead, use the `--llvm-object-file` flag to get a finished object file to disassemble with any disassembler.
2019-10-17 15:37:35 -07:00
Ivan Enderlin
a257995f8d fix(win-exception-handler) Remove bindgen and regex from cargo build deps.
Those crates are not used.
2019-10-17 23:53:53 +02:00
bors[bot]
5ca6fc4aaa
Merge #885
885: fix(cranelift-backend) Remove broken (and useless?) debug code r=nlewycky a=Hywan

This debug code is broken (it doesn't compile). It can be assumed
nobody uses it, and can be considered as dead code. As such, this PR
removes it.

The `debug` feature is kept in `Cargo.toml` to activate `wasmer-runtime-core/debug`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-10-17 21:25:46 +00:00
Ivan Enderlin
f101775380 fix(cranelift-backend) Remove broken (and useless?) debug code.
This debug code is broken (it doesn't compile). It can be assumed
nobody uses it, and can be considered as dead code. As such, this PR
removes it.
2019-10-17 22:55:30 +02:00
bors[bot]
62b2cdc5e9
Merge #884
884: Show the full hex value of a float that fails assert returns arithmetic nan or assert returns canonical nan. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-17 19:29:22 +00:00
nlewycky
eaf16f61bf
Merge branch 'master' into feature/llvm-nan-but-fast 2019-10-17 12:24:56 -07:00
Nick Lewycky
c0acd5be11 Show the full hex value of a float that fails assert returns arithmetic nan or assert returns canonical nan. 2019-10-17 12:20:34 -07:00
Nick Lewycky
2c5c1b1c2c For floating point operations, allow inputs to be arbitrary, including SNaNs.
Instead of ensuring outputs are arithmetic NaNs on every function, we tag them as pending such a check, so that a sequence of computation can have a single canonicalization step at the end.

There's an extra wriggle for SIMD. The Wasm type system only indicates them as V128, so it's possible that we might do computations as F32x4Add, I8x16Add, F64x2Add in a row with no other computations in between. Thus, most SIMD functions apply pending canonicalizations to their inputs, even integer SIMD operations.
2019-10-17 11:55:01 -07:00
losfair
cd0b49e661 popcnt for aarch64. 2019-10-18 00:18:15 +08:00
losfair
a057296618 (S32, Imm64, GPR) 2019-10-17 23:45:58 +08:00
losfair
3f35a74b84 Two more mov variants. 2019-10-17 23:40:44 +08:00
losfair
4df7973639 Add mov variants. 2019-10-17 23:34:24 +08:00
losfair
00242cdd7f Fix LEA simulation on aarch64. 2019-10-17 23:00:50 +08:00
losfair
d325635629 Increment aarch64 virtual stack size to 1MB. 2019-10-17 23:00:32 +08:00
bors[bot]
8c308d055b
Merge #880
880: Remove usage of LZCNT and TZCNT from singlepass. r=nlewycky a=nlewycky

# Description
This PR removes usage of LZCNT and TZCNT in singlepass to work on machines that don't support them. Unlike other instructions that fail loudly when not supported, LZCNT and TZCNT silently change behaviour by falling back to BSR and BSF which may produce different answers. They were used in the I32Clz, I32Ctz, I64Clz and I64Ctz instructions. Fixes i32.wast and i64.wast test failures on our Mac buildbot.

As an alternative, we could detect presence of LZCNT and TZCNT at runtime, either by running them directly or by querying CPUID to detect whether the CPU claims support for these instructions. I decided against that because having multiple paths is more complicated, and we aren't concerned with runtime of singlepass code, as a rule.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-10-17 00:13:02 +00:00
nlewycky
01e81ee809
Merge branch 'master' into feature/singlepass-mac-int 2019-10-16 17:12:36 -07:00
Syrus Akbary
eafb1237a8
Merge pull request #881 from Hywan/feat-runtime-core-imported-closure
feat(runtime-core) Add documentation and make macros more readable.
2019-10-16 16:20:29 -07:00
Nick Lewycky
f99d0360d2 Add registers XMM8--15 to from_dwarf_regnum and invoke_call_return_on_stack. 2019-10-16 10:34:37 -07:00
Ivan Enderlin
81be25d970 feat(runtime-core) Add documentation and make macros more readable.
After a long time, the macros are easy to read, but not at first
glance. I hope this PR will improve the situation: Same syntax used
everywhere, more spaces…
2019-10-16 16:07:50 +02:00
Nick Lewycky
5ee311adab These were both calling i32.clz. They should be fixed. 2019-10-15 14:10:26 -07:00
Nick Lewycky
4e5d559ab5 Remove dead functions LZCNT and TZCNT. 2019-10-15 13:44:18 -07:00
Nick Lewycky
99f7499a05 Reimplement I32Ctz, I64Clz and I64Ctz without LZCNT or TZCNT. 2019-10-15 13:42:05 -07:00
Nick Lewycky
3e854c4a3b Remove the exclusions for I32Clz. 2019-10-15 13:21:07 -07:00
Nick Lewycky
cafcfd3b50 cargo fmt 2019-10-15 13:07:44 -07:00
Nick Lewycky
cf3d2a830d Reimplement I32Clz without relying on LZCNT. 2019-10-15 12:50:59 -07:00
bors[bot]
caae21c065
Merge #879
879: Add extended system information for Mac. Enough to see CPUID flags. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-15 19:08:28 +00:00
Nick Lewycky
761a5e843c Indentation for syntax. 2019-10-15 11:08:10 -07:00
Nick Lewycky
169665db8c Add extended system information for Mac. Enough to see CPUID flags. 2019-10-15 11:03:55 -07:00
losfair
3de0c7763f Skip inline non-instruction data. 2019-10-15 22:12:08 +08:00
losfair
81d538ade2 Fix disp < 0 case. 2019-10-15 22:00:33 +08:00
losfair
ee88c459e5 Allow arbitrary size of disp. 2019-10-15 21:55:04 +08:00
Nick Lewycky
feeb9cd8f9 These tests failed on mac on bors. Put them back. 2019-10-14 15:02:51 -07:00
Nick Lewycky
26a4f073f0 Implement F64Min and F64Max. 2019-10-14 14:15:18 -07:00
Nick Lewycky
06ffb00deb Reimplement F32Max. 2019-10-14 14:07:30 -07:00
Nick Lewycky
b886a41a85 Use temp_gprs instead of hard-coding RAX/RDX. 2019-10-14 13:53:30 -07:00
Nick Lewycky
5cee23455d Release the registers we acquire. Reformat. 2019-10-14 13:51:03 -07:00
Nick Lewycky
336dab7fd9 Don't use utility functions in F32Min implementation. 2019-10-14 13:46:55 -07:00
Nick Lewycky
765e1d3b9e Add XMM8--XMM15. These were added in x64. 2019-10-14 13:46:55 -07:00
Nick Lewycky
4b89e01806 Remove commented-out code that I added so as to not lose its history in git. Apply trivial cleanups and reformat.
Remove expected test failure entries that are fixed so far.
2019-10-14 13:46:55 -07:00
Nick Lewycky
963148fdce Fix F32Min for all cases including NaNs. 2019-10-14 13:46:55 -07:00
Nick Lewycky
8b937afc1f Add comments to indicate the implemention we'd like to have, but can't right now. 2019-10-14 13:46:55 -07:00
Nick Lewycky
0f712c90ab Don't allocate another register when it's safe to reuse dst. 2019-10-14 13:46:55 -07:00
Nick Lewycky
b75e5c0c7c When we know RDX is unavailable, use RAX instead. Should be fine here. 2019-10-14 13:46:55 -07:00
Nick Lewycky
d6eba03a2f Remove loc1/loc2. That intended refactoring didn't work out. 2019-10-14 13:46:55 -07:00
Nick Lewycky
555d933057 Initial commit, reimplementation of F32Min. Fixes F32Min(negative_zero, zero) issue.
Also removes some previously-fixed i32 and i64 exclusions from the tests.
2019-10-14 13:46:55 -07:00
bors[bot]
852fbced5c
Merge #876
876: Bump structopt from 0.3.2 to 0.3.3 r=Hywan a=dependabot-preview[bot]

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.2 to 0.3.3.
<details>
<summary>Changelog</summary>

*Sourced from [structopt's changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md).*

> # v0.3.3 (2019-10-10)
> 
> * Add `from_flag` custom parser to create flags from non-bool types.
>   Fixes [#185](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/185)
</details>
<details>
<summary>Commits</summary>

- [`2cb1fbf`](2cb1fbf679) v0.3.3
- [`fd2cc62`](fd2cc62b63) Add from_flag parser ([#271](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/271))
- [`6a3fc8b`](6a3fc8bc79) Run ui tests only on stable
- [`8d86616`](8d86616957) Fix code formatting
- [`cf61ff1`](cf61ff1eaf) Fix nightly tests
- [`0c888e9`](0c888e962d) Fix clippy warnings
- [`1cae9fa`](1cae9fab4b) Suppress all clippy warnings
- [`c228c23`](c228c2399b) Fix version in docs (AGAIN)
- See full diff in [compare view](https://github.com/TeXitoi/structopt/compare/v0.3.2...v0.3.3)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=structopt&package-manager=cargo&previous-version=0.3.2&new-version=0.3.3)](https://dependabot.com/compatibility-score.html?dependency-name=structopt&package-manager=cargo&previous-version=0.3.2&new-version=0.3.3)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-10-14 15:24:19 +00:00
dependabot-preview[bot]
4e7ba405b8
Bump structopt from 0.3.2 to 0.3.3
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.2...v0.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-14 14:10:50 +00:00
losfair
e5f7dc8274 Print the last frame in block trace output. 2019-10-14 20:23:43 +08:00
losfair
2e532fa66d Preserve fault.ip when calling middleware. 2019-10-14 20:23:27 +08:00
losfair
a525907c60 Emit state information for internal breakpoints. 2019-10-14 20:23:10 +08:00
Syrus Akbary
5611bec3eb
Update README.md 2019-10-13 21:52:10 -07:00
Syrus Akbary
416f03917c
Merge pull request #875 from alocquet/doc/link-to-so-in-c-api-example
doc: add link to SO in C api example
2019-10-13 21:35:37 -07:00
losfair
ba7e2b70ed Add block-trace flag to CLI. 2019-10-13 20:51:48 +08:00
losfair
b0b0983eb8 Allow accessing execution state in middleware breakpoint handlers. 2019-10-13 20:51:39 +08:00
losfair
128b006bf7 Add a BlockTrace middleware. 2019-10-13 20:51:03 +08:00
losfair
5499a69ddc Run cargo fmt on everything. 2019-10-13 20:02:47 +08:00
losfair
c18bdd52cc Fix inline breakpoints on macOS. 2019-10-13 20:02:28 +08:00
Arnaud
e9f476c93b
doc: add link to SO in C api example 2019-10-13 10:30:02 +02:00
losfair
ad3faa0ba0 Add CallTrace CLI option. 2019-10-11 21:05:59 +08:00
losfair
36f95fc660 Support emitting inline breakpoints in singlepass. 2019-10-11 21:05:42 +08:00
losfair
94f97109ff Include backend metadata in tiering module. 2019-10-11 21:05:17 +08:00
losfair
db59127f71 Inline breakpoint support in core. 2019-10-11 21:04:53 +08:00
losfair
2e1fb7abca Update call_trace middleware to include a counter. 2019-10-11 21:04:09 +08:00
Ivan Enderlin
c3ff8eb540 fix(runtime-c-api) Replace unsafe code by safe code. 2019-10-11 09:26:05 +02:00
Ivan Enderlin
01c209fe96 feat(runtime-c-api) Move the wasi module into its own file. 2019-10-11 09:19:46 +02:00
Mark McCaskey
bd8e864656 Add functions import object to get import fns and free them 2019-10-10 16:07:56 -07:00
Mark McCaskey
51f619a132 Change pointer that's not modified to be const in C API 2019-10-10 11:22:45 -07:00
losfair
8ee4b7f7b0 Replace brk with undefined instruction. 2019-10-10 22:08:52 +08:00
Yaron Wittenstein
420bfa570e
Merge branch 'master' into deterministic 2019-10-10 15:55:35 +03:00
Mark McCaskey
913354adb3 Add function to get export from ns/name via ImportObject to C API 2019-10-09 17:29:27 -07:00
bors[bot]
2695093a03
Merge #863
863: Rewrite Min/Max to handle all cases correctly. Fixes 545 spectest failures. r=nlewycky a=nlewycky

# Description
The llvm backend was not quite following the Wasm spec for {F32,F64,F32x4xF64x2}{Min,Max}. We used the `@llvm.minnum` and `@llvm.maxnum` intrinsics which don't handle the corner cases the same. When we tried to use `@llvm.minimum` and `@llvm.maximum` which do, we get an internal error from the x86 backend. I was hoping that crash would go away with the upgrade to LLVM 9, but it does not.

Reimplement these operations using plain LLVM instructions.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-09 22:24:07 +00:00
bors[bot]
88f126a00b
Merge #870
870: Fix unused value warning due to inkwell API change. NFC. r=nlewycky a=nlewycky

# Description
Fix unused value warning due to inkwell API change. No functionality change.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-08 23:56:10 +00:00
bors[bot]
e6693612f8
Merge #872
872: Pass llvm debug flags to the llvm backend. r=nlewycky a=nlewycky

This was accidentally removed in 124ad73e8ae2c6864bad3ebe5572d79736cfd688 .

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-08 19:30:46 +00:00
Nick Lewycky
0567845ead cargo fmt 2019-10-08 11:29:03 -07:00
Nick Lewycky
c61cbf6c0b Add a comment. 2019-10-08 11:25:10 -07:00
Nick Lewycky
ebd71672e0 Pass llvm debug flags to the llvm backend.
This was accidentally removed in 124ad73e8ae2c6864bad3ebe5572d79736cfd688 .
2019-10-08 11:23:18 -07:00
losfair
3778352d39 Update a few examples. 2019-10-08 23:01:03 +08:00
losfair
bd06aa02ba x 2019-10-08 19:07:38 +08:00
losfair
c337999c5c x 2019-10-08 18:43:39 +08:00
losfair
b5bb3fa764 Move {push,pop}_code_version to caller side for non-mananged execution. 2019-10-08 18:41:22 +08:00
Nick Lewycky
afddbb2b2a Remove unused value warning due to inkwell API change. NFC. 2019-10-07 17:16:52 -07:00
bors[bot]
8f734c5b04
Merge #869
869: Remove exclusions for tests that appear to be passing right now. r=nlewycky a=nlewycky

# Description
Remove exclusions for tests that appear to be passing right now.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-08 00:13:56 +00:00
Nick Lewycky
9cdfb48d0c The i1 argument is actually named "is_zero_undef" which we want to be false.
Fixes the test failures that showed up on mac.
2019-10-07 17:11:59 -07:00
Nick Lewycky
158db4cee1 Remove exclusions for tests that appear to be passing right now. 2019-10-07 15:11:45 -07:00
bors[bot]
f6df1e577a
Merge #868
868: Replace "be the i32 type" with "be an i32" in error messages. r=nlewycky a=nlewycky

# Description
Adjust wording in error messages.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-10-07 20:33:27 +00:00
Yaron Wittenstein
3489bfb9b9 renamed feature flag deterministic to deterministic-execution 2019-10-07 23:07:20 +03:00
Yaron Wittenstein
899099f325 Cargo.toml - removing deterministic feature flag 2019-10-07 22:58:46 +03:00
Yaron Wittenstein
7ce5ec4df9 fixes to PR comments 2019-10-07 22:34:32 +03:00
Nick Lewycky
4d99963640 Replace "be the i32 type" with "be an i32" in error messages. 2019-10-07 12:11:10 -07:00
losfair
e0e7d58313 Make state mapping work on non-x86 architectures. 2019-10-07 23:00:37 +08:00
Yaron Wittenstein
6ca5812798 When deterministic feature will be enabled (turned-off by default) it'll guarantee deterministic
execution of wasm programs across different hardware/circumstances.
This is very useful for Blockchain projects having wasm smart-contracts

This is critical for Blockchain projects that require execution to be deterministic
in order to reach a consensus of the state transition of each smart-contract transaction.
2019-10-07 16:58:58 +03:00
Patrick Ventuzelo
ed615c4878 fix build error docs 2019-10-07 12:56:55 +02:00
losfair
80d6c4cbc0 Implement get_fault_info for aarch64. 2019-10-06 18:27:35 +08:00
Nick Lewycky
749691ca2a Add a comment explaining why we don't use the intrinsics for these. 2019-10-04 11:50:11 -07:00
Nick Lewycky
da0cfb8fc2 Add changelog entry. 2019-10-04 11:36:38 -07:00
Nick Lewycky
1a7f00f0af Rewrite Min/Max to handle all cases correctly.
Fixes 545 spectest failures.
2019-10-03 18:19:12 -07:00
Mark McCaskey
bfb9d3849c Fix merge 2019-10-03 11:58:06 -07:00
Mark McCaskey
689bdd08a1 Merge branch 'master' into feature/wasi-in-c-api 2019-10-03 11:56:37 -07:00
Mark McCaskey
70b55b801d Check argument pointers for null to WASI calls 2019-10-03 10:50:07 -07:00
Patrick Ventuzelo
ba1b55d6c8 add changelog entry 2019-10-03 11:34:40 +02:00
Patrick Ventuzelo
4b3880c88b add details when calling unimplemented! 2019-10-03 11:26:54 +02:00
Patrick Ventuzelo
0fd5a37150
Merge branch 'master' into ventuzelo/fix-857-panic-loader-parameter 2019-10-03 09:20:02 +02:00
Patrick Ventuzelo
6b09abb2fd make changelog more clear 2019-10-03 09:18:27 +02:00
Syrus Akbary
c8e9530805
Merge pull request #860 from wasmerio/MarkMcCaskey-patch-1
Remove incorrect duplicate entry
2019-10-02 19:29:56 -07:00
bors[bot]
1a4206605c
Merge #831
831: Add support for atomic operations, excluding wait and notify, to singlepass. r=nlewycky a=nlewycky

# Description
Adds support for atomic operations, excluding wait and notify, to singlepass. Enable with `--enable-threads`.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-10-03 00:36:56 +00:00
nlewycky
f63c706abc
Merge branch 'master' into feature/singlepass-atomicops 2019-10-02 16:46:59 -07:00
Mark McCaskey
5859074597
Remove incorrect duplicate entry 2019-10-02 16:36:57 -07:00
Nick Lewycky
ab76c2357f Delete dead (commented out) code. NFC. 2019-10-02 16:31:11 -07:00
Nick Lewycky
8e63d54fdb cargo fmt 2019-10-02 16:31:11 -07:00
Nick Lewycky
83b678bc36 Give this function a better name. 2019-10-02 16:31:11 -07:00
Nick Lewycky
11c5e0d71d Make the panics a bit more descriptive. 2019-10-02 16:31:11 -07:00
Nick Lewycky
e401f8ebe0 Add changelog entry. 2019-10-02 16:31:11 -07:00
Nick Lewycky
ba68cfc2c6 Finish atomic operations for singlepass, excluding wait and notify. 2019-10-02 16:31:11 -07:00
Nick Lewycky
bc7e017188 Add atomic.rmw operations, excluding xchg and cmpxchg.
Sizes are now ordered, to facilitate an assertion that one size is less (smaller) than another.

panic! error messages are provided for remaining emitter functions.
2019-10-02 16:31:11 -07:00
Nick Lewycky
f021d59a0b Refactor out a compare-and-swap loop function. 2019-10-02 16:31:11 -07:00
Nick Lewycky
cd1d06f5a5 Initial working implementation of I32AtomicRmwAnd!
Adds the ability to reserve a specific temp-gpr register. Needed for CMPXCHG which always uses RAX.
2019-10-02 16:31:11 -07:00
Nick Lewycky
6937019b65 Use a compare-and-swap loop for AND.
BUG: This might allocate RAX twice.
2019-10-02 16:31:10 -07:00
Nick Lewycky
81895830f0 Add emitter for LOCK CMPXCHG so that we can emit compare-and-swap loops. 2019-10-02 16:31:10 -07:00
Nick Lewycky
efc89e829d Add i32 rmw add and sub. 2019-10-02 16:31:10 -07:00
Nick Lewycky
98f35ef84a Initial implementation of atomic load/store and i32 atomic rmw add. 2019-10-02 16:31:10 -07:00
bors[bot]
65637bec70
Merge #859
859: Prepare for 0.8.0 release r=MarkMcCaskey a=MarkMcCaskey

Releasing 0.8.0!


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-10-02 22:53:46 +00:00
Mark McCaskey
e5b5f11fc0 Add contributor shoutout section to 0.8.0 release 2019-10-02 15:44:07 -07:00
Mark McCaskey
c77cbc1f40 Prepare for 0.8.0 release 2019-10-02 15:40:35 -07:00
bors[bot]
38078173d3
Merge #850
850: Add builder API for WasiState r=MarkMcCaskey a=MarkMcCaskey

Nicer to use and it checks for errors!

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-10-02 20:17:29 +00:00
Mark McCaskey
afbde49d1f Update stub wasi generate import object fn
Fix typo

Fix debug issue
2019-10-02 13:16:47 -07:00
Mark McCaskey
b45b1c12f1 Add WASI support to runtime-c-api 2019-10-02 12:06:17 -07:00
Mark McCaskey
5185f120f4 Update some from feedback, fix tests
format with 1.37
2019-10-02 11:25:55 -07:00
Patrick Ventuzelo
e1c26b1932 update changelog 2019-10-02 17:32:35 +02:00
Patrick Ventuzelo
a304cdac03 replace expect with map_err 2019-10-02 17:23:11 +02:00
Syrus Akbary
fed80fcd3e
Merge pull request #855 from wasmerio/fix/example-in-runtime-readme
Fix example in runtime readme
2019-10-01 13:54:38 -07:00
Mark McCaskey
0d997c332f Fix example in runtime readme 2019-10-01 13:45:44 -07:00
Mark McCaskey
75286b580b
Merge branch 'master' into feature/builder-api-for-wasi-state 2019-10-01 09:32:25 -07:00
Syrus Akbary
b74e62af3d
Merge pull request #845 from wasmerio/dependabot/cargo/generational-arena-0.2.3
Bump generational-arena from 0.2.2 to 0.2.3
2019-09-30 23:55:31 -07:00
Syrus Akbary
f474e9722e
Merge pull request #846 from wasmerio/dependabot/cargo/bindgen-0.51.1
Bump bindgen from 0.51.0 to 0.51.1
2019-09-30 23:55:03 -07:00
Syrus Akbary
82f3956e2c
Merge pull request #852 from jdanford/minor-readme-fixes
Make minor fixes to README.md
2019-09-30 23:08:12 -07:00
Jordan Danford
9be72e6808 Fix some other files too 2019-09-30 22:50:04 -07:00
Jordan Danford
5a92e6b450 Make minor fixes to README.md 2019-09-30 19:47:10 -07:00
Mark McCaskey
4660bc6652 Update API to be more cleann 2019-09-30 17:52:53 -07:00
Syrus Akbary
863b86eae6
Merge pull request #851 from wasmerio/feature/update-emoji-in-feature-matrix
Update emoji in feature matrix
2019-09-30 17:13:46 -07:00
Mark McCaskey
00715e160f Use the large white square emoji instead of the white square emoji 2019-09-30 17:05:40 -07:00
Mark McCaskey
acf40ed9ce Update emoji again! 2019-09-30 17:02:58 -07:00
Mark McCaskey
bd0e275c6c Update emoji in feature matrix 2019-09-30 16:55:41 -07:00
Mark McCaskey
38602b257b Move validation to end of Builder 2019-09-30 16:32:18 -07:00
Mark McCaskey
2e860e589a Add builder API for WasiState 2019-09-30 15:26:04 -07:00
dependabot-preview[bot]
5585cce714
Bump bindgen from 0.51.0 to 0.51.1
Bumps [bindgen](https://github.com/rust-lang/rust-bindgen) from 0.51.0 to 0.51.1.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.51.0...v0.51.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-30 11:12:21 +00:00
dependabot-preview[bot]
5c5a498e4e
Bump generational-arena from 0.2.2 to 0.2.3
Bumps [generational-arena](https://github.com/fitzgen/generational-arena) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/fitzgen/generational-arena/releases)
- [Changelog](https://github.com/fitzgen/generational-arena/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/generational-arena/compare/0.2.2...0.2.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-30 11:11:54 +00:00
losfair
b304317682 More mov variants. 2019-09-30 01:01:15 +08:00
bors[bot]
8a2052bb90
Merge #828
828: No need to emit add of constant zero. r=losfair a=nlewycky

# Description
While debugging singlepass generated code, I noticed unnecessary adds of zero. Removing them made the resulting assembly shorter and easier to analyze.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2019-09-29 04:53:33 +00:00
Heyang Zhou
dfb8989280
Merge branch 'master' into nlewycky/singlepass-add-zero 2019-09-29 12:52:26 +08:00
losfair
89d8b5a41c Fixes for aarch64. 2019-09-28 17:31:10 +08:00
bors[bot]
67ae86bdbd
Merge #841
841: Add lots of rustdocs and clean up one line of code r=MarkMcCaskey a=MarkMcCaskey



- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-27 17:17:45 +00:00
Mark McCaskey
dad43dd990 Merge branch 'master' into docs/improved-rust-docs 2019-09-27 10:17:11 -07:00
Mark McCaskey
871310a851 Improve docs from feedback 2019-09-27 10:15:40 -07:00
bors[bot]
73137140fa
Merge #835
835: Add parallel execution example r=Hywan a=MarkMcCaskey

A bit wip

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-27 11:39:43 +00:00
Mark McCaskey
dc1744560c Add lots of rustdocs and clean up one line of code 2019-09-26 17:17:50 -07:00
Mark McCaskey
1083e7cd2a Add parallel execution example 2019-09-26 16:25:31 -07:00
bors[bot]
287b42579c
Merge #836
836: Update cranelift backend to fork version 0.44.0 r=bjfish a=bjfish

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
Update cranelift dependency to updated fork version 0.44.0
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-09-26 22:35:22 +00:00
Brandon Fish
6c361853db Merge branch 'master' into feature/merge-cranelift-0-44-0 2019-09-26 17:34:23 -05:00
bors[bot]
44e908698c
Merge #839
839: Update CI to use Rust 1.37 r=MarkMcCaskey a=MarkMcCaskey


# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-26 19:38:21 +00:00
Mark McCaskey
4083b5f1d1 Update CI to use Rust 1.37 2019-09-26 12:35:19 -07:00
Brandon Fish
008a1d7369 Update to published cranelift fork version 0.44.0 2019-09-26 08:43:12 -05:00
Ivan Enderlin
9fdaf0cd4f chore(cargo) Remove patches from version contraints. 2019-09-26 15:05:22 +02:00
Ivan Enderlin
87f61ab226 feat(interface-types) Add attributes. 2019-09-26 15:02:20 +02:00
Ivan Enderlin
63b13914c3 feat(interface-types) Let the type inference engine do the work. 2019-09-26 14:37:29 +02:00
Ivan Enderlin
7e18be191d chore(cargo) Update Cargo.lock. 2019-09-26 14:36:31 +02:00
Ivan Enderlin
a047e68ad0 Merge branch 'master' into feat-interface-types 2019-09-26 14:28:00 +02:00
Ivan Enderlin
c35395bd94 feat(interface-types) Rename a variable. 2019-09-26 14:18:30 +02:00
Ivan Enderlin
f537b4dfa3 chore(interface-types) Simplify the executable_instruction macro. 2019-09-26 14:17:43 +02:00
Ivan Enderlin
fce270a8e7 feat(interface-types) Split the interpreter into multiple modules/files. 2019-09-26 14:14:46 +02:00
Brandon Fish
cfbaf4458f Add changelog entry for cranelift fork version update 0.44.0 2019-09-25 23:44:10 -05:00
Brandon Fish
c69cdeca9b Update cranelift backend to fork version 0.44.0 2019-09-25 23:37:39 -05:00
Ivan Enderlin
ade098b815 fix(interface-types) Fix typos in error messages. 2019-09-26 01:02:29 +02:00
Ivan Enderlin
5ce18fc447 feat(interface-types) Create vectors with specific capacity when possible. 2019-09-26 01:00:17 +02:00
Ivan Enderlin
49a7587f33 feat(interface-types) Implement the write-utf8 executable instruction. 2019-09-26 00:55:26 +02:00
Ivan Enderlin
981692ec15 chore(interface-types) Re-order match arms. 2019-09-25 23:30:41 +02:00
Ivan Enderlin
ef568ca8c4 feat(interface-types) Update Instruction. 2019-09-25 23:29:08 +02:00
Syrus Akbary
c52c44a6e5
Merge pull request #834 from pventuzelo/ventuzelo/fix-830-panic-unwrap-wasmer-args
Fix 830 panic unwrap wasmer args
2019-09-25 14:21:54 -07:00
Ivan Enderlin
8d75db9018 test(interface-types) Use macros to reduce test boilerplate. 2019-09-25 23:13:26 +02:00
Syrus
8a92e52f96 Don’t create unexisting dir 2019-09-25 13:46:32 -07:00
Syrus
d9f2cded26 Trying to improve cache time 2019-09-25 13:35:11 -07:00
Patrick Ventuzelo
de533af2cc
Merge branch 'master' into ventuzelo/fix-830-panic-unwrap-wasmer-args 2019-09-25 22:01:19 +02:00
Syrus Akbary
accedf1139
Merge pull request #833 from wasmerio/doc/import-object-ns-new-method-docs
Add ImportObject `maybe_with_namespace` example
2019-09-25 12:53:55 -07:00
Ivan Enderlin
4d9dacb482 feat(interface-types) Implement the call executable instruction.
The patch requires to implement the `wasm::TypedIndex`,
`wasm::LocalImportIndex`, and the `wasm::LocalImport` traits.
2019-09-25 21:53:23 +02:00
Patrick Ventuzelo
4b8d008f14 add changelog entry 2019-09-25 21:53:18 +02:00
Patrick Ventuzelo
5b3333c6f5 fix unwrap by handling parse error 2019-09-25 21:52:45 +02:00
Mark McCaskey
4266926e90 Add ImportObject maybe_with_namespace example 2019-09-25 12:37:27 -07:00
bors[bot]
cda35afce0
Merge #832
832: Delete unused runtime-abi r=syrusakbary a=syrusakbary

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
Delete unused runtime-abi
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-09-25 17:22:02 +00:00
Syrus Akbary
fdc486c53d
Merge branch 'master' into feature/runtime-abi-delete 2019-09-25 10:21:20 -07:00
bors[bot]
231b1c20bf
Merge #809
809: Fix issue 800 - check index before accessing imports.globals r=syrusakbary a=pventuzelo

# Description

Fix issue #800 

* Check if `import_global_index` is valid i.e inside imports.globals range. 
* Related functions: 
  * validate_memories
  * validate_tables
  * finalize_memories
  * finalize_tables

# After the fix

``` sh
$ ./target/release/wasmer run index_oob_LocalBacking_validate_memories_152.wasm
execute_wasm: "Can\'t instantiate module: LinkError([Generic { message: \"incorrect global index for initializer\" }])"
--------------------------------------------------------------------------------------------------------
$ ./target/release/wasmer run index_oob_LocalBacking_validate_tables_276.wasm 
execute_wasm: "Can\'t instantiate module: LinkError([Generic { message: \"incorrect global index for initializer\" }])"
```

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
2019-09-25 09:50:51 +00:00
Patrick Ventuzelo
b45a228e84
Merge branch 'master' into ventuzelo/fix-800-index-oob-backing 2019-09-25 09:30:33 +02:00
Patrick Ventuzelo
08665f7085 change changelog 2019-09-25 09:28:47 +02:00
Syrus
1efeabb787 Updated changelog 2019-09-24 22:12:51 -07:00
Syrus
fec90b570b Delete unused runtime-abi 2019-09-24 22:10:03 -07:00
nlewycky
392a61ff12
Merge branch 'master' into nlewycky/singlepass-add-zero 2019-09-24 13:58:27 -07:00
Syrus
7bf306eb27 Use flat-square style in downloads button 2019-09-24 13:42:17 -07:00
Syrus
621ef56ab6 lmproved READMEs to use Azure Pipelines badges and better lgo 2019-09-24 13:36:31 -07:00
bors[bot]
961328e9ab
Merge #822
822: Cranelift backend update to fork of clif version 0.43.1 r=bjfish a=bjfish

The corresponding update to fork is here (which should merge first):
https://github.com/wasmerio/cranelift/pull/4

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-09-24 19:37:40 +00:00
Syrus Akbary
588a77d2af
Merge branch 'master' into feature/merge-cranelift-0-43-1 2019-09-24 11:41:14 -07:00
Brandon Fish
b6d55b0b85 Update to published fork version 2019-09-24 13:30:52 -05:00
nlewycky
d7562c17ef
Merge branch 'master' into nlewycky/singlepass-add-zero 2019-09-24 10:57:57 -07:00
Nick Lewycky
be181f9119 Correct this test and simplify. 2019-09-24 10:54:23 -07:00
bors[bot]
42e4871266
Merge #806
806: Fix issue 653 (panic in MemoryDescriptor) + remove panic in UnsharedMemory r=syrusakbary a=pventuzelo

#Description

Based on comment from @syrusakbary [here](https://github.com/wasmerio/wasmer/pull/654#issuecomment-520908172) and previous pull request from @bjfish.
* Reformat MemoryDescriptor (new structure field, function new, function memory_type)
* Remove panic for MemoryDescriptor
* Remove panic for UnsharedMemory

# Review

- [ ] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
2019-09-24 12:48:16 +00:00
Patrick Ventuzelo
ac321846e3
Merge branch 'master' into ventuzelo/fix-653-panic-memorydescriptor 2019-09-24 09:10:45 +02:00
Patrick Ventuzelo
79ff3709cc fix cargo check fail build 2019-09-24 09:08:55 +02:00
bors[bot]
6792db988f
Merge #829
829: Fix bench targets in makefile r=MarkMcCaskey a=MarkMcCaskey


# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-24 00:03:58 +00:00
Mark McCaskey
57b8947d6a Add bench fix to changelog 2019-09-23 16:53:53 -07:00
bors[bot]
7d33b19418
Merge #824
824: Bump structopt from 0.3.1 to 0.3.2 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.1 to 0.3.2.
<details>
<summary>Changelog</summary>

*Sourced from [structopt's changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md).*

> # v0.3.2 (2019-09-18)
> 
> * `structopt` does not replace `:` with `, ` inside "author" strings while inside `<...>`.
>   Fixes [#156](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/156)
> * Introduced [`#[structopt(skip = expr)]` syntax](https://docs.rs/structopt/0.3.2/structopt/#skipping-fields).
</details>
<details>
<summary>Commits</summary>

- [`80a55c0`](80a55c0f35) v0.3.2
- [`5005c47`](5005c47d6d) Support `skip = value` syntax
- [`c3c6273`](c3c6273bb9) Update version in the documentation
- [`fe9e049`](fe9e049596) Do not mangle `author` string inside `\<...>`
- [`52fa726`](52fa726208) Propagate span info from origin code to generated code
- [`af8a4b8`](af8a4b8ff6) Fix nightly tests
- See full diff in [compare view](https://github.com/TeXitoi/structopt/compare/v0.3.1...v0.3.2)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=structopt&package-manager=cargo&previous-version=0.3.1&new-version=0.3.2)](https://dependabot.com/compatibility-score.html?dependency-name=structopt&package-manager=cargo&previous-version=0.3.1&new-version=0.3.2)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-09-23 23:35:08 +00:00
Mark McCaskey
91cd88fde6 Fix bench targets in makefile 2019-09-23 16:33:29 -07:00
dependabot-preview[bot]
5fde93dcbd
Bump structopt from 0.3.1 to 0.3.2
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.1...v0.3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-23 22:32:22 +00:00
Syrus Akbary
1776b20b31
Merge pull request #795 from wasmerio/dependabot/cargo/serde-1.0.101
Bump serde from 1.0.100 to 1.0.101
2019-09-23 15:30:32 -07:00
dependabot-preview[bot]
2af0311487
Bump serde from 1.0.100 to 1.0.101
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.100 to 1.0.101.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.100...v1.0.101)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-23 22:13:04 +00:00
Syrus Akbary
7376e651ff
Merge pull request #793 from wasmerio/dependabot/cargo/serde_derive-1.0.101
Bump serde_derive from 1.0.100 to 1.0.101
2019-09-23 15:11:06 -07:00
Nick Lewycky
07b5991080 No need to emit add of constant zero. 2019-09-23 15:01:19 -07:00
dependabot-preview[bot]
ebb7618341
Bump serde_derive from 1.0.100 to 1.0.101
Bumps [serde_derive](https://github.com/serde-rs/serde) from 1.0.100 to 1.0.101.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.100...v1.0.101)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-23 21:48:18 +00:00
bors[bot]
8c5ccdb497
Merge #807
807: Implement Send for Instance r=MarkMcCaskey a=MarkMcCaskey

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file

Resolves #748 

WIP

## List of changes
### Commit 1
- `Global`s use Arc instead of RC
- Export `Context` and `FuncPointer` manually implement Send
- `ImportObject` uses `Arc<Mutex<HashMap<...>>>` Instead of `Rc<RefCell<HashMap<...>>>`; removed `get_namespace` method in favor of continuation style to deal with locking the Mutex
- `Func` manually implements `Send` (TODO: this change needs to be checked in depth)
### Commit 2
- `unsafe impl Send for Export {}` (temporary to allow Memory to be not Send)
- RefCell -> Mutex in Global and Table
- Rc -> Arc in Table
- Namespace's `IsExport`s must be `Send` (Done to avoid touching much more of the code (i.e. `trait IsExport: Send` requires a lot -- maybe this is what we should do though)
- Make `Host` and `Wasm` `Func`s Send (manual implementation)
- Manual implementation for `LocalTable` and `AnyFunc`
### Commit 3
- rm placeholder `unsafe impl Send for Export {}`
- Manual implementation for `LocalBacking` and `ImportBacking` (both seemed to be not Send due to direct ownership of mutable pointers in their containers)
- ImportObject's state creator Fn trait object is now ` + Send + Sync + 'static` (required because it's in an Arc)
- Manually implement Send for `InstanceInner` because it holds a raw pointer, `LocalBacking` and `ImportBacking` are marked Send separately 
- Memory: All Rc -> Arc (including unshared memory); All RefCell -> Mutex (including unshared memory)
- Manual implementation of Send and Sync on `UnsharedMemoryInternal`
- Manual implementation of Send and Sync on `SharedMemoryInternal`
- Change `runtime-core::unix::memory::Memory.fd` from `Option<Rc<Rawfd>>` to `Option<Arc<Rawfd>>` (not strictly required for this change because Memory has manual implementations of Send and Sync, but Arc seems more correct here and there's no comment justifying the use of Rc)
- Manual implementation of Send for `ImportedFunc`

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-09-23 21:20:01 +00:00
Mark McCaskey
9cab6d721f Merge branch 'feature/make-instance-send' of github.com:wasmerio/wasmer into feature/make-instance-send 2019-09-23 13:43:48 -07:00
Mark McCaskey
c4818f12dc Update spectests to work with new Instance; use Arc<Mutex<>> 2019-09-23 13:43:01 -07:00
Syrus Akbary
eed033021b
Merge pull request #825 from Hywan/doc-runtime-core-memory-view
doc(runtime-core) Replace `map(|cell| cell.get())` by `map(Cell::get)`.
2019-09-23 11:34:00 -07:00
Mark McCaskey
705287c317
Merge branch 'master' into feature/make-instance-send 2019-09-23 11:06:00 -07:00
Mark McCaskey
1e637badc4 Merge remote-tracking branch 'origin/master' into feature/make-instance-send 2019-09-23 11:05:00 -07:00
Mark McCaskey
05ad1aaea4 Add test for Instance, fix tests for ImportObject 2019-09-23 11:04:31 -07:00
bors[bot]
23c7b201dd
Merge #817
817: Add feature matrix document r=MarkMcCaskey a=MarkMcCaskey

[rendered](https://github.com/wasmerio/wasmer/blob/docs/add-feature-matrix/docs/feature_matrix.md)

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-09-23 17:21:30 +00:00
Mark McCaskey
2ef64b0a19 Update feature matrix with input from Brandon and Nick 2019-09-23 10:20:46 -07:00
Mark McCaskey
a5d4b9f730
Merge branch 'master' into docs/add-feature-matrix 2019-09-23 10:13:12 -07:00
Syrus Akbary
b41913ea1c
Merge pull request #823 from wasmerio/feature/emscripten-fixes-2
Various emscripten fixes
2019-09-23 10:08:09 -07:00
losfair
3dadbc15c9 Integer subset done. 2019-09-23 22:30:08 +08:00
Ivan Enderlin
be5624e28b feat(interface-types) Implement the read-utf8 instruction.
It implies to create the `wasm::Memory` trait.

Also, the patch updates `wasm::Type` and `wasm::Value` to
`wasm::InterfaceType` and `wasm::InterfaceValue`. It enforces a new
rule that is: All values in the stack must be owned by the stack. Any
value going in or out must be cloned.
2019-09-23 16:29:01 +02:00
Ivan Enderlin
f289cb2ba9 doc(runtime-core) Replace map(|cell| cell.get()) by map(Cell::get).
Because it's simpler :-p.
2019-09-23 15:15:06 +02:00
Patrick Ventuzelo
5ace7a0af3 fix failing test 2019-09-23 11:17:02 +02:00
Syrus
62f76b1d5e Simplified error message 2019-09-22 18:35:26 -07:00
Syrus
e99119ace6 Added changes in CHANGELOG 2019-09-22 18:32:39 -07:00
Syrus
88b2bbc44f Improved error message 2019-09-22 18:29:13 -07:00
Syrus
9942d3ae98 Improved Emscripten / WASI autodetection 2019-09-22 18:23:22 -07:00
Syrus
bafd318284 Improved generate emtests and generate spectests 2019-09-22 17:46:16 -07:00
Azure Pipelines
8e2f526f73 Added cpp example 2019-09-22 17:42:19 -07:00
Azure Pipelines
009c123332 Fixed emscripten main functions 2019-09-22 17:29:12 -07:00
Azure Pipelines
cc189160da Only build docs on master/staging/trying 2019-09-22 17:07:09 -07:00
Brandon Fish
0671311bd7 Add cranelift update to changelog 2019-09-21 14:35:29 -05:00
Brandon Fish
a1a88c6eb8 Use the default features for wasmparser 2019-09-21 13:59:08 -05:00
Brandon Fish
f48d6f6690 Cranelift backend update to fork of clif version 0.43.1 2019-09-21 13:06:54 -05:00
Mark McCaskey
5e1e99cbfb
Merge branch 'master' into docs/add-feature-matrix 2019-09-20 17:03:17 -07:00
Mark McCaskey
c09e0e06df Update feature matrix 2019-09-20 17:01:41 -07:00
bors[bot]
7d9e6d8caa
Merge #821
821: Remove patch version in deps when not necessary r=MarkMcCaskey a=MarkMcCaskey

This allows wasmer library users to have more control over the exact versions of deps that Wasmer uses.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-20 23:44:37 +00:00
Syrus Akbary
862a4c5448
Merge pull request #814 from confio/fix-linux-image-link-error
Fix issues with testing/linking singlepass in runtime-c-api
2019-09-20 16:33:30 -07:00
Mark McCaskey
bf396ec76d Remove patch version in deps when not necessary 2019-09-20 16:11:09 -07:00
bors[bot]
977f3a6406
Merge #820
820: Remove null pointer checks generally, re-add them in Emscripten r=MarkMcCaskey a=MarkMcCaskey

Resolves #818 

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-20 20:22:32 +00:00
Mark McCaskey
7f2c532594 Allow dead code in emscripten WasmPtr 2019-09-20 13:19:31 -07:00
Mark McCaskey
882a77ccf9 Remove null pointer checks generally, re-add them in Emscripten 2019-09-20 12:02:12 -07:00
Patrick Ventuzelo
7deed3160b cargo fmt 2019-09-20 18:59:36 +02:00
Patrick Ventuzelo
ca409f78c5 fix spectest 2019-09-20 18:54:05 +02:00
Ivan Enderlin
aea18f6250 test(interface-types) Test calling a void exported function. 2019-09-20 14:59:18 +02:00
Ivan Enderlin
8557e83ce6 feat(interface-types) Better error message when calling an exported function failed. 2019-09-20 14:55:37 +02:00
Ivan Enderlin
56afb4da63 feat(interface-types) Check signature of the exported function to call. 2019-09-20 14:31:15 +02:00
Ivan Enderlin
b7b37d2e99 feat(interface-types) The interpreter stack contains Wasm values. 2019-09-20 14:07:56 +02:00
Ivan Enderlin
2237e628ab chore(interface-types) Fix clippy warnings. 2019-09-20 12:02:11 +02:00
Ivan Enderlin
39a817817b feat(interface-types) Stack supports Default. 2019-09-20 11:55:19 +02:00
Ivan Enderlin
9d4c983206 feat(interface-types) Implement CallExport executable instruction.
It requires to create the `wasm::Export` trait, plus the `wasm::Type`
and the `wasm::Value` enums.
2019-09-20 11:37:38 +02:00
Ivan Enderlin
62e1f7867b feat(interface-types) Add an abstract Wasm instance and a runtime to the interpreter. 2019-09-20 00:06:15 +02:00
Ivan Enderlin
c63345029e feat(interface-types) Continue. 2019-09-19 23:05:17 +02:00
bors[bot]
0790ebff0c
Merge #803
803: Add method to call function at index on Ctx r=MarkMcCaskey a=MarkMcCaskey

For #638 and #670

```Rust
fn call_guest_fn(ctx: &mut Ctx, guest_fn: u32) -> u32 {
    println!("{}", guest_fn);

    let guest_fn_typed = unsafe { std::mem::transmute(guest_fn) };

    let result = ctx.call_with_table_index(guest_fn_typed, &[]).unwrap();
    println!("  -> {:?}", result);

    0
}
```
is what this looks like from the Host side

See `examples/callback.rs` for an example that doesn't require `transmute`


# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-09-19 20:55:09 +00:00
Mark McCaskey
3b200fa4d3 Move callback guest out of direct examples dir 2019-09-19 13:53:07 -07:00
bors[bot]
aa67dbee90
Merge #813
813: Fix test printf typo r=Hywan a=ethanfrey

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

Fixes #812 

`%lld -> %ld fixes cargo test compile error`

# Review

- [ ] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-09-19 20:15:55 +00:00
Ivan Enderlin
9a49fb59e0
Merge branch 'master' into fix-test-typo 2019-09-19 22:15:32 +02:00
bors[bot]
dd1a4a6c10
Merge #805
805: Replace panic! & unimplemented! in runtime-code and llvm-backend r=nlewycky a=pventuzelo

# Description

Replace `unimplemented!` by already used `CodegenError` in `lib/llvm-backend/src/code.rs`
Replace `unimplemented!` by `Err` in `lib/llvm-backend/src/trampolines.rs`
Replace `panic!` by already used `BinaryReaderError` in `lib/runtime-core/src/parse.rs`

# Review

- [ ] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
2019-09-19 19:20:04 +00:00
Mark McCaskey
451b458fc3 Add feature matrix document 2019-09-19 10:39:47 -07:00
bors[bot]
299fac9c62
Merge #792
792: Remove colored CLI output from wasmer-runtime-core lib r=syrusakbary a=repi

When the colored output was originally added in https://github.com/wasmerio/wasmer/pull/489 and there was a discussion then about that it should ideally be in a higher-level crate rather than in the runtime-core library crate.

I agree with that, users of the library shouldn't be required to bring in the `colored` crate dependency and ideally also not have stdout/stderr output either, that should be controlled by the application that uses wasmer-runtime-core, not the library.

Disabling stdout/stderr output would be more intrusive but I wanted to at least not have colored output and another crate dependency so this change removes the colored output and the `colored` crate.

`colored` also had quite a few dependencies and, while well used, is not super actively maintained. So this change also removes 6 transitive dependencies of the `colored` crate which is great.

This could potentially be a feature flag instead also, but would be a bit messier.

Co-authored-by: Johan Andersson <repi@repi.se>
2019-09-19 14:47:07 +00:00
Johan Andersson
8d0edc61df Merge master 2019-09-19 11:16:14 +02:00
Mark McCaskey
f709122444 Merge branch 'feature/call-function-at-index-on-just-ctx' of github.com:wasmerio/wasmer into feature/call-function-at-index-on-just-ctx 2019-09-18 17:13:26 -07:00
Mark McCaskey
a090bec490 Add examples step in Makefile and add it to integration-tests 2019-09-18 17:12:48 -07:00
Mark McCaskey
a9d8b22fe7
Merge branch 'master' into feature/call-function-at-index-on-just-ctx 2019-09-18 16:46:08 -07:00
Mark McCaskey
ccd369ff0c Add example, rename Ctx fn, make things pub(crate), misc changes 2019-09-18 16:43:47 -07:00
Mark McCaskey
5741a2cf70 Implement function lookups using the table 2019-09-18 16:06:46 -07:00
Ivan Enderlin
2f3c37fbd5 feat(interface-types) Continue. 2019-09-19 00:25:28 +02:00
Ethan Frey
8ae255b51a Fix issues with testing/linking singlepass in runtime-c-api 2019-09-19 00:19:17 +02:00
Ivan Enderlin
dc3c72ea19 feat(interface-types) Draft instruction interpreter. 2019-09-19 00:18:36 +02:00
Ethan Frey
e8a918e2e5 %lld -> %ld fixes cargo test compile error 2019-09-18 23:25:35 +02:00
losfair
a124d87d0f Fix Operator::MemorySize. 2019-09-19 01:10:23 +08:00
losfair
5f8b289751 movzx/movsx 2019-09-19 01:04:20 +08:00
bors[bot]
0ea5b1b2bd
Merge #808
808: Bump rand from 0.7.0 to 0.7.2 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [rand](https://github.com/rust-random/rand) from 0.7.0 to 0.7.2.
<details>
<summary>Changelog</summary>

*Sourced from [rand's changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md).*

> ## [0.7.2] - 2019-09-16
> ### Fixes
> - Fix dependency on `rand_core` 0.5.1 ([#890](https://github-redirect.dependabot.com/rust-random/rand/issues/890))
> 
> ### Additions
> - Unit tests for value stability of distributions added ([#888](https://github-redirect.dependabot.com/rust-random/rand/issues/888))
> 
> ## [0.7.1] - 2019-09-13
> ### Fixes
> - Fix `no_std` behaviour, appropriately enable c2-chacha's `std` feature ([#844](https://github-redirect.dependabot.com/rust-random/rand/issues/844))
> - `alloc` feature in `no_std` is available since Rust 1.36 ([#856](https://github-redirect.dependabot.com/rust-random/rand/issues/856))
> - Fix or squelch issues from Clippy lints ([#840](https://github-redirect.dependabot.com/rust-random/rand/issues/840))
> 
> ### Additions
> - Add a `no_std` target to CI to continously evaluate `no_std` status ([#844](https://github-redirect.dependabot.com/rust-random/rand/issues/844))
> - `WeightedIndex`: allow adjusting a sub-set of weights ([#866](https://github-redirect.dependabot.com/rust-random/rand/issues/866))
</details>
<details>
<summary>Commits</summary>

- [`249ebfc`](249ebfc435) Merge pull request [#888](https://github-redirect.dependabot.com/rust-random/rand/issues/888) from dhardy/master
- [`5ac4cbd`](5ac4cbd38c) Prepare rand 0.7.2
- [`f39915a`](f39915a496) rand_distr: work around tan func issue
- [`802ba8f`](802ba8f7f5) rand_distr: add missing value_stability tests
- [`a43d7f1`](a43d7f1166) Fix tests
- [`2ef2e66`](2ef2e669b6) Add value_stability tests for uniform
- [`096a5dd`](096a5dd5d6) UniformSampler: add doc on usage of sample_single
- [`f78781a`](f78781aa84) Uniform: replace inner field with struct tuple
- [`856fdfb`](856fdfb433) Distribution: add doc of portability
- [`72af6f8`](72af6f84f2) Add value_stability tests for bernoulli, int, float and other distrs
- Additional commits viewable in [compare view](https://github.com/rust-random/rand/compare/0.7.0...0.7.2)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=rand&package-manager=cargo&previous-version=0.7.0&new-version=0.7.2)](https://dependabot.com/compatibility-score.html?dependency-name=rand&package-manager=cargo&previous-version=0.7.0&new-version=0.7.2)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-09-18 16:59:37 +00:00
Ivan Enderlin
fc9389d932 feat(interface-types) Encode Interfaces to WAT. 2019-09-18 18:02:05 +02:00
Ivan Enderlin
6ec35c8bdc chore(interface-types) Bump to 0.7.0. 2019-09-18 17:14:57 +02:00
Ivan Enderlin
480fe0fb9b chore(interface-types) Update to Wasmer 0.7.0. 2019-09-18 17:14:12 +02:00
Ivan Enderlin
bd3a888452 feat(interface-types) Add new instructions. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
6279b3e915 feat(interface-types) Continue the WAT encoder. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
40613d3d48 feat(interface-types) Draft the WAT encoder. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
4ba9aace64 fix(interface-types) get-field #1 argument is of type InterfaceType. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
a7ffffc8b4 feat(interface-types) Move TryFrom from the ast to the binary module. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
5a8a2b90ed fix(interface-types) Fix visibility of various symbols. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
24ac7a6c41 test(interface-types) Add test cases for higher-level parsers. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
dc254e0845 test(interface-types) Add test case for “unit” parsers. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
1c1b74baa1 feat(interface-types) Split into multiple files. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
45ba77c5e3 feat(interface-types) Continue. 2019-09-18 17:12:42 +02:00
Ivan Enderlin
7ca546e5c5 feat(interface-types) Continue. 2019-09-18 17:12:41 +02:00
Ivan Enderlin
b3af77c92d feat(wasmer-interface-types) Draft. 2019-09-18 17:12:41 +02:00
losfair
8a91f801b9 Fix return from homomorphic host redirection trampoline. 2019-09-18 21:47:31 +08:00
Patrick Ventuzelo
315b87c718 check index before accessing imports.globals 2019-09-18 10:28:49 +02:00
Mark McCaskey
9c205e05a2 Add comments explaining the unsafe impls and simplify the code, too 2019-09-17 18:35:12 -07:00
dependabot-preview[bot]
71b865aa11
Bump rand from 0.7.0 to 0.7.2
Bumps [rand](https://github.com/rust-random/rand) from 0.7.0 to 0.7.2.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.7.0...0.7.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-17 22:16:38 +00:00
Mark McCaskey
83c3909b00 Implement it for memory and make Instance Send 2019-09-17 14:58:26 -07:00
bors[bot]
174cc9f0ec
Merge #802
802: This is no longer referring to the correct line. r=nlewycky a=nlewycky

It's supposed to be 352 which is already there. Three lines were deleted in #785.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-09-17 21:48:18 +00:00
Mark McCaskey
9e9343878d Implement Send for everything except Memory 2019-09-17 11:45:13 -07:00
losfair
72b6123def Fix memory grow 2019-09-18 02:38:35 +08:00
losfair
e40600533e Add missing emit_mov variants. 2019-09-18 02:30:45 +08:00
losfair
97b75d0124 Ensure callee-saved registers are properly preserved. 2019-09-18 02:21:35 +08:00
losfair
b57aba4ae7 Add homomorphic host redirection abstraction for vm->host calls. 2019-09-18 02:14:13 +08:00
Mark McCaskey
17a0e78cef Implement Send for Instance 2019-09-17 10:37:37 -07:00
Patrick Ventuzelo
374f81972a remove panic from UnsharedMemory 2019-09-17 17:46:36 +02:00
Patrick Ventuzelo
c660aa9fce fix 653 panic in memoryDescriptor 2019-09-17 17:42:06 +02:00
Patrick Ventuzelo
726269a52c fix missing info error 2019-09-17 12:05:00 +02:00
Patrick Ventuzelo
4190f01195 remove panic and unimplemented in llvm-backend and runtime-core 2019-09-17 12:03:03 +02:00
Azure Pipelines
37f0e36996 Trying to fix remote 2019-09-16 16:32:37 -07:00
Azure Pipelines
5de75150ab Trying to fix token 2019-09-16 16:15:30 -07:00
Azure Pipelines
8b6f9d0f7f Add index.html 2019-09-16 15:57:26 -07:00
Syrus
f39dd10d41 Trying to improve publish docs 2019-09-16 15:53:13 -07:00
Mark McCaskey
b35a522d28 Add method to call function at index on Ctx 2019-09-16 15:01:18 -07:00
Johan Andersson
ba488adb8f
Merge branch 'master' into remove-colored 2019-09-16 22:17:34 +02:00
Nick Lewycky
05816e3221 This is no longer referring to the correct line.
It's supposed to be 352 which is already there.
2019-09-16 13:13:21 -07:00
Syrus Akbary
90dfb0f7a7
Merge pull request #801 from wasmerio/feature/osr-exclude
Depending on the micro-arch, this function may trigger emission of a stack realignment. If it does, OSR can't statically prove that it's safe to insert a function call and asserts.
2019-09-16 12:16:18 -07:00
Nick Lewycky
2108c908a4 Depending on the micro-arch, this function may trigger emission of a stack realignment. If it does, OSR can't statically prove that it's safe to insert a function call and asserts. 2019-09-16 12:14:10 -07:00
Syrus
298a2f8534 Added system info to tests 2019-09-16 12:14:09 -07:00
bors[bot]
de7c5dc578
Merge #790
790: Switch llvm-backend from PIC+Default (small) to Static+Large. r=nlewycky a=nlewycky

# Description

Should fix flaky test failure:
```
spectest-a277b7d051ac0dde: /home/nick/llvm-8.0.1.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:304: void llvm::RuntimeDyldELF::resolveX86_64Relocation(const llvm::SectionEntry&, uint64_t, uint64_t, uint32_t, int64_t, uint64_t): Assertion `isInt<32>(RealOffset)' failed.
```
(with assertions-enabled LLVM). The relocation in question is a `R_X86_64_PC32` with small offset against `.rodata`.

The switch from Default (small, JITDefault is a different default that we weren't using which is medium) to Large should fix the bug. Once we're using large code model, I think we can switch from PIC to static as either an optimization or a no-op.

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-09-16 17:55:13 +00:00
Nick Lewycky
53db1d44fa Add changelog entry. 2019-09-16 10:49:39 -07:00
Nick Lewycky
59597b9e83 Switch from PIC+Default (small) to Static+Large. Should fix flaky test failures. 2019-09-16 10:49:39 -07:00
bors[bot]
56c571465e
Merge #798
798: Replace panics in codegen_x64 by CodegenError r=nlewycky a=pventuzelo

Replace panics! inside `lib/singlepass-backend/src/codegen_x64.rs` by CodegenError

Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
2019-09-16 17:10:03 +00:00
losfair
574e4c477f Print return value from pure WASM binary. 2019-09-17 00:54:34 +08:00
losfair
d8b313e3fd Fix emit_lea. 2019-09-17 00:49:21 +08:00
losfair
05557fc9ad Bump dynasm to v0.5.1 2019-09-16 23:46:10 +08:00
Patrick Ventuzelo
00c2e09f43 fix CodeGen message type 2019-09-16 11:00:03 +02:00
Patrick Ventuzelo
33ba6768bc replace panics by CodeGen Error in codegen_x64 2019-09-16 09:56:41 +02:00
losfair
96163a07a6 Temporarily disable all lints in runtime-core. 2019-09-15 18:33:53 +08:00
losfair
2af69f6710 Fixed compilation on aarch64. 2019-09-15 18:32:02 +08:00
losfair
9b77677e4b Relax constraints a bit to compile on aarch64. 2019-09-15 18:23:42 +08:00
losfair
d3227f830c More instructions & aarch64 trampolines. 2019-09-15 17:57:40 +08:00
Johan Andersson
21bcac2159 Rustfmt 2019-09-15 03:31:05 +02:00
Johan Andersson
ad70caff83 Remove colored CLI output from runtime-core lib.
When the colored output was originally added in https://github.com/wasmerio/wasmer/pull/489 and there was a discussion then about that it should ideally be in a higher-level crate rather than in the runtime-core library crate.

I agree with that, users of the library shouldn't be required to bring in the colored crate dependency and ideally also not have stdout/stderr output either, that should be controlled by the application that uses wasmer-runtime-core, not the library.

Disabling stdout/stderr output would be more intrusive but I wanted to at least not have colored output and another crate dependency so this change removes the colored output and the "colored" crate.
2019-09-15 03:21:04 +02:00
bors[bot]
9068777aaf
Merge #782
782: Turn this unreachable into a panic with an error message. r=nlewycky a=nlewycky

# Description
All errors with messages in this file are `panic!`s. Give this `unreachable!` a message (so I can debug when I hit it, only possible due to local changes) and turn it into a `panic!`.

# Review

- [ ] Create a short description of the the change in the CHANGELOG.md file

Too minor for changelog.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-09-14 01:10:46 +00:00
nlewycky
e0baf68e25
Merge branch 'master' into nlewycky/panic 2019-09-13 17:07:36 -07:00
bors[bot]
991cbfb6b5
Merge #788
788: Use union merge on the changelog file. r=MarkMcCaskey a=nlewycky

# Description
This keeps both sides of a conflict. It's essentially the same as removing the
conflict markers.

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-09-13 22:15:59 +00:00
Nick Lewycky
abd71aa129 Add changelog entry. 2019-09-13 14:47:02 -07:00
Nick Lewycky
d6e3138a3d Use union merge on the changelog file.
This keeps both sides of a conflict. It's essentially the same as removing the
conflict markers.
2019-09-13 14:46:37 -07:00
Nick Lewycky
0387c3ff93 Turn this unreachable into a panic with an error message. 2019-09-13 14:44:54 -07:00
bors[bot]
ec94d366b0
Merge #785
785: Copy the spectest repository license from the official WebAssembly testsuite. These tests are under that license. r=nlewycky a=nlewycky

Remove our own license statements on a few files since they're now redundant. They were all referencing this license.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-09-13 20:38:57 +00:00
Nick Lewycky
fd1b154014 Add changelog entry. 2019-09-13 13:38:11 -07:00
Nick Lewycky
afe22dfafc Copy the spectest repository license from the official WebAssembly testsuite. These tests are under that license.
Remove our own license statements on a few files since they're now redundant. They were all referencing this license.
2019-09-13 13:37:48 -07:00
bors[bot]
8e17399979
Merge #786
786: Implement atomic load and store instructions with actual atomics in the LLVM backend. r=nlewycky a=nlewycky

Includes a run of `cargo update` to pick up the newer inkwell required.

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-09-13 19:29:12 +00:00
Nick Lewycky
2eac9accd2 Add changelog entry. 2019-09-13 12:06:14 -07:00
Nick Lewycky
8dd82c05e6 Implement atomic load and store instructions with actual atomics in the LLVM backend.
Includes a run of `cargo update` to pick up the newer inkwell required.
2019-09-13 12:05:55 -07:00
bors[bot]
fa760f44dd
Merge #784
784: Wasmer run can run text wat files, not webassembly spectest files. r=nlewycky a=nlewycky

# Description
Correct an incorrect description of the `wasmer run` subcommand. It can't run webassembly spectest files (`.wast`), it can run webassembly text files (`.wat`).

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file

n/a


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-09-13 18:29:41 +00:00
Nick Lewycky
c02f0ccba2 Add changelog. 2019-09-13 11:29:00 -07:00
Nick Lewycky
ecf39f814a Wasmer run can run text wat files, not webassembly spectest files. 2019-09-12 20:56:11 -07:00
bors[bot]
793fd60f6a
Merge #766
766: Bump indexmap from 1.1.0 to 1.2.0 r=Hywan a=dependabot-preview[bot]

Bumps [indexmap](https://github.com/bluss/indexmap) from 1.1.0 to 1.2.0.
<details>
<summary>Commits</summary>

- [`45dad09`](45dad09a97) 1.2.0
- [`0cfdf7d`](0cfdf7d284) MAINT: Fix cargo-release setting for tag name
- [`380e55c`](380e55c6a3) Merge pull request [#102](https://github-redirect.dependabot.com/bluss/indexmap/issues/102) from cuviper/lints
- [`042e1b4`](042e1b4a93) Avoid scoped lints for Rust 1.30
- [`f799d95`](f799d9558e) Allow clippy::eq_op in tests
- [`75850ce`](75850ce359) Fix clippy::writeln_empty_string
- [`6b19c0e`](6b19c0e95d) Fix clippy::transmute_ptr_to_ptr
- [`0206d91`](0206d91a33) Fix clippy::single_match
- [`abfffac`](abfffac4a7) Fix clippy::redundant_static_lifetimes
- [`d5acca7`](d5acca76be) Fix clippy::redundant_pattern_matching
- Additional commits viewable in [compare view](https://github.com/bluss/indexmap/compare/1.1.0...1.2.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=indexmap&package-manager=cargo&previous-version=1.1.0&new-version=1.2.0)](https://dependabot.com/compatibility-score.html?dependency-name=indexmap&package-manager=cargo&previous-version=1.1.0&new-version=1.2.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-09-12 20:56:23 +00:00
dependabot-preview[bot]
0e96c35998
Bump indexmap from 1.1.0 to 1.2.0
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.1.0...1.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-12 20:39:52 +00:00
bors[bot]
43509e5547
Merge #781
781: Prepare for 0.7.0 release r=MarkMcCaskey a=MarkMcCaskey

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-12 20:05:47 +00:00
Mark McCaskey
35bb3879a4 Add required-by-cargo version pinning in manifest for middleware-common 2019-09-12 12:51:39 -07:00
Mark McCaskey
33811cde37 Fix mistake in version update; generate lock file 2019-09-12 12:49:11 -07:00
Mark McCaskey
0f4d266e4e Prepare for 0.7.0 release 2019-09-12 12:44:38 -07:00
bors[bot]
38048b6acf
Merge #774
774: Introduce some breaking changes to WasiFS API for next release r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-12 18:55:29 +00:00
bors[bot]
9016cb166c
Merge #720 #765
720: Bump lazy_static from 1.3.0 to 1.4.0 r=Hywan a=dependabot-preview[bot]

Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.3.0 to 1.4.0.
<details>
<summary>Release notes</summary>

*Sourced from [lazy_static's releases](https://github.com/rust-lang-nursery/lazy-static.rs/releases).*

> ## 1.4.0
> **Bumps the minimum supported version of `rustc` to `1.27.2`**
> 
> - [Fix typo in lib.rs](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/pull/144) (thanks [@&#8203;fbruetting](https://github.com/fbruetting))
> - [Automatically check if README.md examples are working when running "cargo test"](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/pull/145) (thanks [@&#8203;GuillaumeGomez](https://github.com/GuillaumeGomez))
> - [Allow deprecated to remove warnings in nightly](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/pull/152) (thanks [@&#8203;Schaeff](https://github.com/Schaeff))
> - [bump MSRV to 1.27.2](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/pull/155) (thanks [@&#8203;matklad](https://github.com/matklad))
</details>
<details>
<summary>Commits</summary>

- [`4216696`](421669662b) Merge pull request [#156](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/issues/156) from rust-lang-nursery/cargo/1.4.0
- [`1651fde`](1651fdeee8) prepare for 1.4.0 release
- [`d9c9689`](d9c96890da) Merge pull request [#155](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/issues/155) from matklad/hints
- [`d59c784`](d59c7848d4) adjust FIXME comment
- [`90baadd`](90baaddd61) comment typo
- [`42fa58e`](42fa58ea68) bump MSRV to 1.27.2
- [`8a5f404`](8a5f404fc8) Merge pull request [#152](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/issues/152) from Schaeff/allow-deprecated
- [`1dbd5ae`](1dbd5ae6cc) allow deprecated to remove warning in nightly
- [`65d58f1`](65d58f1a60) Merge pull request [#145](https://github-redirect.dependabot.com/rust-lang-nursery/lazy-static.rs/issues/145) from GuillaumeGomez/doc-tests
- [`e519fd4`](e519fd42c3) Automatically check if README.md examples are working when running "cargo test"
- Additional commits viewable in [compare view](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.3.0...1.4.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=lazy_static&package-manager=cargo&previous-version=1.3.0&new-version=1.4.0)](https://dependabot.com/compatibility-score.html?dependency-name=lazy_static&package-manager=cargo&previous-version=1.3.0&new-version=1.4.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

765: Bump blake2b_simd from 0.5.7 to 0.5.8 r=Hywan a=dependabot-preview[bot]

Bumps [blake2b_simd](https://github.com/oconnor663/blake2_simd) from 0.5.7 to 0.5.8.
<details>
<summary>Commits</summary>

- [`296d75e`](296d75e502) version 0.5.8
- [`3706393`](3706393fd9) Merge pull request [#12](https://github-redirect.dependabot.com/oconnor663/blake2_simd/issues/12) from kobigurk/master
- [`1ee274d`](1ee274d775) Addresses Jack's comments
- [`ec7c0fc`](ec7c0fc1d3) Adds test vectors for blake2x
- [`2bcd7bf`](2bcd7bfa12) Adds support for max depth 0 for blake2b and fixes tests
- [`0ce1995`](0ce1995ff0) adds support for max depth 0
- See full diff in [compare view](https://github.com/oconnor663/blake2_simd/compare/0.5.7...0.5.8)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=blake2b_simd&package-manager=cargo&previous-version=0.5.7&new-version=0.5.8)](https://dependabot.com/compatibility-score.html?dependency-name=blake2b_simd&package-manager=cargo&previous-version=0.5.7&new-version=0.5.8)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-09-12 13:47:43 +00:00
Syrus Akbary
033279fb0b
Merge pull request #778 from wasmerio/create-pr-template
Create pull_request_template.md
2019-09-11 22:40:32 -03:00
Syrus Akbary
7c2e5e3d8a
Merge pull request #777 from wasmerio/update-issue-template
Update ---bug-report.md
2019-09-11 22:39:55 -03:00
Brandon Fish
609058af33
Update pull_request_template.md 2019-09-11 20:10:28 -05:00
bors[bot]
98939cf34c
Merge #779
779: Add comment to generated code saying that it's generated code for wasi r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-12 00:59:46 +00:00
Mark McCaskey
f5803f04e1 Add comment to generated code saying that it's generated code for wasi 2019-09-11 17:41:25 -07:00
Brandon Fish
e8c558b0df
Merge branch 'master' into update-issue-template 2019-09-11 19:36:37 -05:00
Brandon Fish
8e58ce4ebd
Merge branch 'master' into create-pr-template 2019-09-11 19:36:08 -05:00
bors[bot]
2a5a647192
Merge #776
776: Add test for closing wasi preopen fd r=MarkMcCaskey a=MarkMcCaskey

As discussed in WASI, we should be able to close preopen fds

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-11 23:32:20 +00:00
Mark McCaskey
35ee83d5ca og -> original 2019-09-11 16:31:43 -07:00
Brandon Fish
d77a09bfb3
Update pull_request_template.md 2019-09-11 18:17:13 -05:00
Brandon Fish
1119c3ff03
Create pull_request_template.md 2019-09-11 18:10:20 -05:00
Brandon Fish
3373680fed
Update ---bug-report.md
Try to make improvements to issue template.
2019-09-11 17:57:14 -05:00
Mark McCaskey
6fe3719e8e Add test for closing wasi preopen fd 2019-09-11 14:25:53 -07:00
Mark McCaskey
7e640c0dfb Introduce some breaking changes to WasiFS API for next release 2019-09-10 13:52:02 -07:00
losfair
ce7c903c23 Add impl for more instructions for aarch64 translator. 2019-09-11 01:13:52 +08:00
dependabot-preview[bot]
009bb67686
Bump lazy_static from 1.3.0 to 1.4.0
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.3.0...1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-09 23:02:16 +00:00
dependabot-preview[bot]
301d7a313e
Bump blake2b_simd from 0.5.7 to 0.5.8
Bumps [blake2b_simd](https://github.com/oconnor663/blake2_simd) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/oconnor663/blake2_simd/releases)
- [Commits](https://github.com/oconnor663/blake2_simd/compare/0.5.7...0.5.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-09 23:02:16 +00:00
bors[bot]
eec1225aab
Merge #772
772: fix issue 725, remove panics in runtime-core/src/backing.rs r=syrusakbary a=pventuzelo



Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-09-09 23:00:19 +00:00
Syrus Akbary
d3a9c5edb7
Merge branch 'master' into ventuzelo/fix-panics-backing 2019-09-09 19:29:08 -03:00
bors[bot]
342cc85edd
Merge #768
768: [new fuzzer] wasmer compile method r=syrusakbary a=pventuzelo

Useful to fuzz wasmer compile method and cranelift library

Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-09-09 22:28:12 +00:00
Syrus Akbary
3a9f7fc0d1
Merge branch 'master' into ventuzelo/compile-wasm-fuzzer 2019-09-09 19:27:55 -03:00
bors[bot]
656b7b36e9
Merge #770
770: Replace unimplemented! by Err in clif-backend/src/resolver.rs r=nlewycky a=pventuzelo



Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-09-09 18:33:23 +00:00
nlewycky
ea3d7272d9
The VM callbacks for shared static are the same as those for unshared static memory. 2019-09-09 08:34:47 -07:00
Patrick Ventuzelo
ba5c43e09d fix issue 725, remove panics 2019-09-09 16:58:26 +02:00
Patrick Ventuzelo
3a54111988 replace unimplemented by Err 2019-09-09 13:50:30 +02:00
Patrick Ventuzelo
c6f8ab37f1 fix typo 2019-09-09 11:50:30 +02:00
Patrick Ventuzelo
c7b9dab690 add return line Cargo.toml 2019-09-09 11:49:27 +02:00
Patrick Ventuzelo
599ecb7ae6 add new fuzzer for compile method 2019-09-09 11:45:24 +02:00
Nick Lewycky
1c37244279 Add a run of git remote -v so we learn what "checkout: self" really does. Add echo lines between each command to confirm which command is failing. 2019-09-06 17:44:58 -07:00
Nick Lewycky
ca44d4f9f0 Change how we download the rustdocs artifact. 2019-09-06 17:15:54 -07:00
bors[bot]
30d80c3956
Merge #742
742: Bump structopt from 0.2.18 to 0.3.0 r=MarkMcCaskey a=dependabot-preview[bot]

Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.2.18 to 0.3.0.
<details>
<summary>Changelog</summary>

*Sourced from [structopt's changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md).*

> # v0.3.0 (2019-08-30)
> 
> ## Breaking changes
> 
> ### Bump minimum rustc version to 1.36 by [@&#8203;TeXitoi](https://github.com/TeXitoi)
> Now `rustc` 1.36 is the minimum compiler version supported by `structopt`,
> it likely won't work with older compilers.
> 
> ### Remove "nightly" feature
> Once upon a time this feature had been used to enable some of improvements
> in `proc-macro2` crate that were available only on nightly. Nowadays this feature doesn't
> mean anything so it's now removed.
> 
> ### Support optional vectors of arguments for distinguishing between `-o 1 2`, `-o` and no option provided at all by [@&#8203;sphynx](https://github.com/sphynx) ([#180](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/188)).
> 
> ```rust
> #[derive(StructOpt)]
> struct Opt {
>   #[structopt(long)]
>   fruit: Option<Vec<String>>,
> }
> 
> fn main() {
>   assert_eq!(Opt::from_args(&["test"]), None);
>   assert_eq!(Opt::from_args(&["test", "--fruit"]), Some(vec![]));
>   assert_eq!(Opt::from_args(&["test", "--fruit=apple orange"]), Some(vec!["apple", "orange"]));
> }
> ```
> 
> If you need to fall back to the old behavior you can use a type alias:
> ```rust
> type Something = Vec<String>;
> 
> #[derive(StructOpt)]
> struct Opt {
>   #[structopt(long)]
>   fruit: Option<Vec<String>>,
> }
> ```
> 
> ### Change default case from 'Verbatim' into 'Kebab' by [@&#8203;0ndorio](https://github.com/0ndorio) ([#202](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/202)).
> `structopt` 0.3 uses field renaming to deduce a name for long options and subcommands.
> 
> ```rust
> #[derive(StructOpt)]
> struct Opt {
>   #[structopt(long)]
>   http_addr: String, // will be renamed to `--http-addr`
> 
>   #[structopt(subcommand)]
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`673dbcc`](673dbcc910) Bump minimum rustc version to 1.36
- [`b57dde1`](b57dde1923) Update dependencies ([#227](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/227))
- [`8830771`](8830771a60) Update documentation and changelog ([#236](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/236))
- [`6bd1a69`](6bd1a69bbc) Update keyvalue example ([#234](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/234))
- [`73db781`](73db7813de) Update raw_bool_literal.rs ([#231](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/231))
- [`2363815`](236381545d) Update changelog
- [`dc5ec7a`](dc5ec7aeec) Emit error about `raw` removal
- [`a91109c`](a91109c3db) Change behavior of `about/author/version` and ad `no_version`
- [`5dfa606`](5dfa60660d) Now error messages highlight the error location ([#225](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/225))
- [`94946c3`](94946c3b5f) Add documentation for `env` ([#221](https://github-redirect.dependabot.com/TeXitoi/structopt/issues/221))
- Additional commits viewable in [compare view](https://github.com/TeXitoi/structopt/compare/v0.2.18...v0.3.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=structopt&package-manager=cargo&previous-version=0.2.18&new-version=0.3.0)](https://dependabot.com/compatibility-score.html?dependency-name=structopt&package-manager=cargo&previous-version=0.2.18&new-version=0.3.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-06 23:43:38 +00:00
Mark McCaskey
cb750e053d Update to Structopt 0.3.1 and update Run subcommand to rm raw, etc 2019-09-06 16:42:10 -07:00
Nick Lewycky
8fba294912 Remove the condition on deploying the API docs to our (fake) github pages branch. 2019-09-06 16:26:10 -07:00
Nick Lewycky
e7892f552d Remove redundant displayName from Publish_Docs job. 2019-09-06 16:15:25 -07:00
Nick Lewycky
d05f639730 Fix syntax error missing colon after 'artifact'. 2019-09-06 16:13:06 -07:00
Nick Lewycky
640c1f7aca Add Publish_Docs stage, make it push to a fake gh-pages branch for testing whenever master is updated. 2019-09-06 16:10:18 -07:00
Syrus Akbary
5027b22ee0
Merge branch 'master' into dependabot/cargo/structopt-0.3.0 2019-09-06 19:22:14 -03:00
bors[bot]
240ba4841d
Merge #759
759: Add work from past 3 weeks to changelog r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-09-06 20:06:21 +00:00
Mark McCaskey
5159dab511 Add work from past 3 weeks to changelog 2019-09-06 11:41:55 -07:00
losfair
4210715070 AArch64 translation module. 2019-09-07 01:32:21 +08:00
bors[bot]
20a0afa6a5
Merge #756
756: feat(runtime-c-api) Allow to call `wasmer_export_func_call` with null inputs and a 0 arity r=syrusakbary a=Hywan

Fix #753 

This PR allows to call `wasmer_export_func_call` with inputs set to NULL, and an arity of 0. It avoids to create an empty inputs array. So basically:

```c
wasmer_export_func_call(exported_function, NULL, 0, …, …);
```

instead of:

```c
wasmer_value_t inputs = {};
wasmer_export_func_call(exported_function, inputs, 0, …, …);
```

This PR also updates the test suite for exports. Instead of just the famous `sum` function, we now test more functions, so that all Wasm types are covered, including void functions.

Finally, this PR updates the `wasmer_export_func_call` signature to forbid negative arities.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-09-06 11:56:45 +00:00
Ivan Enderlin
1f1ecb7e00 test(runtime-c-api) Use calloc and simplify code. 2019-09-06 10:20:36 +02:00
Ivan Enderlin
a67ce539ef test: Fix CS. 2019-09-05 15:10:09 +02:00
Ivan Enderlin
86ec75fd98 chore(runtime-c-api) Update C & C++ headers. 2019-09-05 15:09:21 +02:00
Ivan Enderlin
a2343f9f0d test(runtime-c-api) Fully test all kind of exports. 2019-09-05 15:08:23 +02:00
Ivan Enderlin
2d63e25075 feat(runtime-c-api) Arity cannot be negative when calling wasmer_export_func_call. 2019-09-05 14:31:43 +02:00
dependabot-preview[bot]
2b4c107de4
Bump structopt from 0.2.18 to 0.3.0
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.2.18 to 0.3.0.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.2.18...v0.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-04 23:40:09 +00:00
bors[bot]
15066555e7
Merge #726
726: Add serialization for WASI state  r=MarkMcCaskey a=MarkMcCaskey

part of #700 

Due to the trait objects from #583 , we can't use `serde` derive for this or use serde traits directly, we have to do some custom serialization (edit: luckily there's a crate for this: `typetag`)

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-09-04 23:08:10 +00:00
Mark McCaskey
7a9afbffe9
Merge branch 'master' into feature/serialization-of-wasi-state 2019-09-04 14:36:25 -07:00
Mark McCaskey
8c56ee682e Further implement framebuffer 2019-09-04 13:07:50 -07:00
Syrus Akbary
7b1ab0c461
Merge pull request #750 from wasmerio/feature/doc-ci
Build API documentation with cargo doc.
2019-09-03 17:11:10 -07:00
Syrus Akbary
f68ad7f655
Merge pull request #751 from wasmerio/feature/better-docs
Improved docs with custom logo and favicon
2019-09-03 17:09:23 -07:00
Syrus
d8471e2b6a Improved docs with custom logo and favicon 2019-09-03 17:06:31 -07:00
Nick Lewycky
f785fe2e95 Add 'docs' to .PHONY.
Fixes Makefile claiming that 'docs' is up to date because it thinks we're
asking it to build 'docs' directory instead of simply running cargo for us.
2019-09-03 16:18:02 -07:00
Nick Lewycky
5f1de897ad Don't redefine "variables". 2019-09-03 16:13:50 -07:00
Nick Lewycky
f55e58936d Build API documentation with cargo doc. 2019-09-03 16:12:30 -07:00
Syrus Akbary
e98ac29b32
Merge pull request #749 from wasmerio/nlewycky/fuzz-cleanup
cargo fmt + adjust comment.
2019-09-03 15:33:57 -07:00
Syrus
1a35cdd4cd Trying to improve local cache dir 2019-09-03 15:32:32 -07:00
Nick Lewycky
4ce2e2c56d cargo fmt + adjust comment. 2019-09-03 15:26:48 -07:00
Syrus
d54712f73b Fix azure linting 2019-09-03 14:56:29 -07:00
Syrus
7fc8ac84a8 Add sccache directory cache just in case 2019-09-03 14:55:26 -07:00
bors[bot]
688d0a2015
Merge #741
741: add validate_wasm fuzzer r=syrusakbary a=pventuzelo

useful to fuzz validation mechanism and wasmparser library.

Co-authored-by: Patrick Ventuzelo <ventuzelo.patrick@gmail.com>
Co-authored-by: Patrick Ventuzelo <9038181+pventuzelo@users.noreply.github.com>
2019-09-03 21:15:06 +00:00
Syrus Akbary
80c1359c84
Merge pull request #747 from pventuzelo/pventuzelo/724-fix-panics-execute-wasm
[fix issue #724] replace panic! with return Err()
2019-09-03 10:42:47 -07:00
Patrick Ventuzelo
7dd496c490
Update src/bin/wasmer.rs
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2019-09-03 17:06:56 +02:00
Patrick Ventuzelo
cdba7e55e5
Update src/bin/wasmer.rs
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2019-09-03 17:06:37 +02:00
Patrick Ventuzelo
7680c0ea52
Merge branch 'master' into ventuzelo/validate-wasm-fuzzer 2019-09-03 11:03:27 +02:00
Patrick Ventuzelo
6701241267
Merge branch 'master' into pventuzelo/724-fix-panics-execute-wasm 2019-09-03 11:03:12 +02:00
Syrus Akbary
777833ee05
Merge pull request #743 from wasmerio/dependabot/cargo/cbindgen-0.9.1
Bump cbindgen from 0.9.0 to 0.9.1
2019-09-02 10:23:44 -07:00
Syrus Akbary
fb097f150b
Merge pull request #745 from wasmerio/dependabot/cargo/winapi-0.3.8
Bump winapi from 0.3.7 to 0.3.8
2019-09-02 10:23:19 -07:00
Syrus Akbary
19cd7728f0
Merge pull request #491 from wasmerio/add-debugging-doc
add beginnings of debugging document
2019-09-02 10:22:17 -07:00
Patrick Ventuzelo
4406fbb6f3 replace panics with return Err() 2019-09-02 12:12:35 +02:00
Patrick Ventuzelo
afa6d6f52c
[formatting] add new line validate_wasm.rs 2019-09-02 11:14:40 +02:00
Patrick Ventuzelo
9ba77aa1fc
[formating] add new line Cargo.toml 2019-09-02 11:14:05 +02:00
dependabot-preview[bot]
616b768529
Bump winapi from 0.3.7 to 0.3.8
Bumps [winapi](https://github.com/retep998/winapi-rs) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/retep998/winapi-rs/releases)
- [Commits](https://github.com/retep998/winapi-rs/compare/0.3.7...0.3.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-02 09:11:48 +00:00
dependabot-preview[bot]
8a2017cce3
Bump cbindgen from 0.9.0 to 0.9.1
Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/eqrion/cbindgen/releases)
- [Changelog](https://github.com/eqrion/cbindgen/blob/master/CHANGES)
- [Commits](https://github.com/eqrion/cbindgen/compare/v0.9.0...v0.9.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-02 09:11:25 +00:00
Patrick Ventuzelo
f0bd680343 validate_wasm fuzzer 2019-09-02 11:08:40 +02:00
Syrus
8965314529 Trying to fix pipelines 2019-09-01 11:15:35 -07:00
Syrus
4c2e5eddf7 Fix LLVM on Windows 2019-09-01 10:51:16 -07:00
Syrus
5b55490048 Fix Rust install 2019-09-01 10:45:32 -07:00
Syrus
cfb01e8c73 Trying to fix errors 2019-09-01 10:35:50 -07:00
Syrus
259c476122 Trying to fix Windows install 2019-09-01 10:28:49 -07:00
Syrus
20c296ef2b Fixed excludes 2019-09-01 10:21:46 -07:00
Syrus
112b478f4c Trying to fix cargo ssl issue 2019-09-01 10:20:37 -07:00
Syrus
0b3413da73 Improved Rust installation 2019-09-01 09:42:21 -07:00
Syrus
c7c7a5cee1 Improved capi tests 2019-09-01 09:42:07 -07:00
Syrus
416d8d13d1 Fix tests exclusion 2019-09-01 09:31:02 -07:00
Syrus
bc990cc18a Updated Runtime C API comments 2019-09-01 08:52:19 -07:00
Syrus
dc02d0e401 Comment LLVM SIMD spectests on Linux after OSR 2019-09-01 08:52:03 -07:00
Syrus
659c504da4 Updated pipelines to not fail 2019-09-01 08:51:36 -07:00
Heyang Zhou
c28b5d4f02
Merge pull request #567 from wasmerio/feature/llvm-osr
State preserving for LLVM, and Singlepass -> LLVM OSR-based tier switching.
2019-09-01 19:06:44 +08:00
losfair
9015b79091 Cargo fmt 2019-09-01 18:17:47 +08:00
losfair
45040650dd Fix the missing Copy trait error 2019-09-01 18:17:31 +08:00
losfair
7dd5c92c21 Merge remote-tracking branch 'origin/master' into feature/llvm-osr 2019-09-01 17:58:44 +08:00
Syrus
179b3a3f18 Use ubuntu for the check 2019-09-01 02:46:58 -07:00
Syrus
d9ce2591f6 Improved Readme 2019-09-01 02:28:59 -07:00
Syrus Akbary
364459f291
Merge branch 'master' into feature/serialization-of-wasi-state 2019-09-01 02:20:58 -07:00
Syrus Akbary
77358fdb99
Merge pull request #735 from wasmerio/Hywan-patch-1
doc(readme) Improve the language integrations
2019-09-01 02:14:28 -07:00
Syrus
6744fdd02a Improved README 2019-09-01 02:12:46 -07:00
Syrus
d74ce2b725 Improved table 2019-09-01 02:09:54 -07:00
Syrus
e986c55805 Fixed Ruby Gem release 2019-09-01 02:05:35 -07:00
Syrus
c4d1319e91 Fixed C# latest release 2019-09-01 02:03:55 -07:00
Syrus
9a8ad760dc Fixed Rust crates link 2019-09-01 02:02:39 -07:00
Syrus
081eeef37c Improved package links 2019-09-01 02:01:27 -07:00
Syrus
186ccccb99 Trying to improve the readme 2019-09-01 01:56:23 -07:00
Syrus
44f9c7da83 Fixed table 2019-09-01 01:42:13 -07:00
Syrus
c7b3d72e6f Fixed table 2019-09-01 01:41:17 -07:00
Syrus
0361ce1a98 Fixed logo issues 2019-09-01 01:40:48 -07:00
Syrus
dfa20e219d Fixed logos 2019-09-01 01:36:09 -07:00
Syrus
2b7e14723c Improved README 2019-09-01 01:33:38 -07:00
Syrus Akbary
522b6f93a4
Merge branch 'master' into Hywan-patch-1 2019-09-01 01:11:12 -07:00
Syrus
19a7301b07 Trying to improve pipelines 2019-09-01 00:53:41 -07:00
Syrus Akbary
b48766535a
Merge branch 'master' into feature/serialization-of-wasi-state 2019-09-01 00:05:00 -07:00
Syrus Akbary
329b283937
Merge pull request #656 from wasmerio/feature/azure-pipelines
Initial version of Azure pipelines
2019-08-31 23:51:37 -07:00
Syrus
025d548090 Trying to improve conditions of pipelines 2019-08-31 23:49:30 -07:00
Syrus
5d1837b0c1 Trigger only on the following branches 2019-08-31 23:39:35 -07:00
Syrus
9a6c7ed2eb Updated azure pipelines 2019-08-31 23:34:06 -07:00
Syrus
b84287f7a7 Use azure-pipelines in bors 2019-08-31 23:17:31 -07:00
Syrus
4ac4be283a Added changelog checks 2019-08-31 23:15:48 -07:00
Syrus
77518a927f Fixed artifact releases 2019-08-31 21:49:57 -07:00
Syrus
1a1b9667d0 Removed circleci and appveyor configs 2019-08-31 21:30:49 -07:00
Syrus
5c2707a474 Fixed names 2019-08-31 21:30:20 -07:00
Syrus
576f8d5cf4 Fixed githubConnection 2019-08-31 21:25:09 -07:00
Syrus
c47c8a4cec Separated C-API from CLI. Format pipelines 2019-08-31 21:19:50 -07:00
Syrus
74065ac171 Fixed publish dependency 2019-08-31 21:14:01 -07:00
Syrus
e8d666e321 Updated status badges 2019-08-31 21:13:46 -07:00
Syrus
d2eb01f967 Updated azure pipelines with github publish 2019-08-31 21:12:55 -07:00
Mark McCaskey
85358a84ae framebuffer wip 2019-08-30 15:35:07 -07:00
Ivan Enderlin
094ae51a14
doc(readme) Improve the language integrations
This patch changes the list of language integrations into a table, which includes:

* The author of the language integrations (to show whether its community-made),
* The maintenance status (based on Cargo vocabulary),
* Last release badge,
* Number of Github stars.
2019-08-30 12:07:16 +02:00
bors[bot]
6d351b514c
Merge #733
733: Split middleware-common tests into separate subcrate r=MarkMcCaskey a=MarkMcCaskey

New depgraph:
![wasmer_depgraph](https://user-images.githubusercontent.com/5770194/63965617-8719c000-cad4-11e9-8d46-ad8799caad6a.png)


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-29 20:48:53 +00:00
Mark McCaskey
8b32a838f7
Merge branch 'master' into feature/serialization-of-wasi-state 2019-08-30 05:16:50 +09:00
Mark McCaskey
91b199fe12 Split middleware-common tests into separate subcrate 2019-08-29 11:14:57 -07:00
bors[bot]
569d0386a9
Merge #732
732: Remove fd_entry lookup on stdin,out,err for wasi::poll_oneoff r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-29 17:55:36 +00:00
Mark McCaskey
7027d7b2c8 Improve code reuse in polling, reduce cfg usage too 2019-08-29 10:54:27 -07:00
Mark McCaskey
fba6dbff78 Add tests for stdin, stdout, stderr; implement bytes_available too 2019-08-29 10:42:38 -07:00
Syrus
366c6e1efb Improved Azure Pipelines to make the releases 2019-08-28 17:53:33 -07:00
Syrus
a31dae2bf2 Trying to improve InnoSetup 2019-08-28 17:38:01 -07:00
Mark McCaskey
0776da7e22 Remove fd_entry lookup on stdin,out,err for wasi::poll_oneoff 2019-08-28 16:14:14 -07:00
bors[bot]
5205adabf5
Merge #731
731: Always flush when writing, even if we get invalid pointers r=MarkMcCaskey a=MarkMcCaskey

Not exactly an "invalid pointer" but, we were seeing an iovec of length 0 passed in which was causing `__WASI_EFAULT` which was preventing things from flushing properly.

While I was fixing this, I decided to clean it up and make the behavior more obvious by creating a wrapper function.

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-28 22:19:16 +00:00
Mark McCaskey
6767087004 Always flush when writing, even if we get invalid pointers 2019-08-28 15:13:30 -07:00
Mark McCaskey
48509e97bd Update plugin example to use serde and typetag for WASI 2019-08-28 14:47:38 -07:00
Mark McCaskey
e4a51484a7 Add wasitests-setup to unit testing because it runs other tests 2019-08-28 13:36:30 -07:00
Mark McCaskey
8a2dba534a Improve error handling, fix probable lifetime issue 2019-08-28 13:19:06 -07:00
Syrus Akbary
7d05d3c0b8
Added wasmr (wasmer in R) to the language integrations 2019-08-28 13:05:48 -07:00
Mark McCaskey
a188e7f652 Add debug code for CI 2019-08-28 11:19:59 -07:00
Mark McCaskey
634aca8b9d Add WASI serializing test 2019-08-28 10:50:59 -07:00
Mark McCaskey
e88a08f973 Use typetag so that we can still use serde 2019-08-27 15:18:12 -07:00
bors[bot]
6892a586b7
Merge #729
729: Add comment explaining why WasmHash is implemented the way it is r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-27 21:29:52 +00:00
Mark McCaskey
538bba5638 Add comment explaining why WasmHash is implemented the way it is 2019-08-27 11:50:03 -07:00
Mark McCaskey
51faeed2cf Add serialization for WASI state - wip 2019-08-26 17:11:56 -07:00
Syrus
8dc8291500 Fixed innosetup install 2019-08-25 19:37:35 -07:00
Syrus
1dde19cc83 Added InnoSetup 2019-08-25 19:32:34 -07:00
Syrus
e48da878e3 Fixed rust toolchain for check 2019-08-25 18:19:56 -07:00
Syrus
2b08e19a7a Separate check out of tests 2019-08-25 18:18:12 -07:00
Syrus
4da56d1dc6 Fix C-API on Windows 2019-08-25 17:32:04 -07:00
Syrus
3d787b9124 Small llvm path win fix 2019-08-25 01:33:19 -07:00
Syrus
0d450607cf Trying to fix windows llvm 2019-08-25 01:22:54 -07:00
Syrus
d12c3470af Trying to fix LLVM_PATH_WIN 2019-08-25 01:12:33 -07:00
Syrus
2a1c78cbb8 Added env to LLVM 2019-08-25 01:03:54 -07:00
Syrus
410c113b52 Trying to fix windows LLVM PATH 2019-08-25 01:02:49 -07:00
Syrus
998a25e2d1 Fixed windows tests 2019-08-25 00:24:21 -07:00
Syrus
01f1ad5b30 Trying to fix llvm in windows 2019-08-24 22:19:29 -07:00
Syrus
8243cf0737 Trying to fix azure build 2019-08-24 21:53:11 -07:00
Syrus
8f1a77735d Added sccache log 2019-08-24 13:16:58 -07:00
Syrus
034ffcff5c Use macos for linting 2019-08-24 12:53:16 -07:00
Syrus
8739d9002b Improved Azure pipelines integration 2019-08-24 12:52:39 -07:00
Syrus
a18fdde72c Trying to fix sccache 2019-08-24 12:11:18 -07:00
Syrus
f772dbfbb6 Fixed sccache 2019-08-24 11:57:14 -07:00
Syrus
989e7129ab Use Azure Blog Storage cache 2019-08-24 11:45:44 -07:00
Syrus
abcde5face Trying to simplify cache 2019-08-24 10:22:39 -07:00
Syrus
9411ba64f8 Fixed windows make release llvm 2019-08-24 09:14:15 -07:00
Syrus
ff6b0bb46e Added build step 2019-08-24 08:54:32 -07:00
Syrus Akbary
6b517171de
Merge branch 'master' into feature/azure-pipelines 2019-08-23 21:52:02 -07:00
losfair
212e2be166 Remove -fno-rtti 2019-08-22 22:58:08 -07:00
losfair
613e4de9fc Fix LLVM object loader exceptions. 2019-08-22 18:57:26 -07:00
losfair
dcb16a2ae9 Disable test_indirect_many as a mitigation for issue #717 . 2019-08-22 17:57:22 -07:00
losfair
bdcd73cd63 Unblock signals in LLVM trap handler. 2019-08-22 17:45:52 -07:00
Syrus Akbary
854b2013ea
Merge pull request #716 from wasmerio/fix/install-script-portability
Update install script to use the more potable `=` instead of `==`
2019-08-22 17:26:14 -07:00
losfair
f503764780 Restore previous unwind_state. 2019-08-22 17:22:33 -07:00
Mark McCaskey
c0e6f3bae2 Update install script to use the more potable = instead of == 2019-08-22 17:10:17 -07:00
Syrus Akbary
84588e124a
Merge pull request #714 from wasmerio/feature/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2019-08-22 15:05:12 -07:00
Brandon Fish
2719ec313c
Create CODE_OF_CONDUCT.md 2019-08-22 16:16:34 -05:00
losfair
d7c5bb904e Only disallow dead code in llvm-backend for non-Windows environments. 2019-08-22 13:32:35 -07:00
losfair
6534c28aed Allow dead code in llvm-backend. 2019-08-22 13:30:50 -07:00
losfair
e89ab43b98 Fix unused 'stackmaps' and 'module_info' on Windows 2019-08-22 13:25:52 -07:00
losfair
d868445d09 Fix unused import 'vm' on Windows 2019-08-22 13:19:46 -07:00
losfair
eef38429fc Fix unused imports on Windows. 2019-08-22 13:14:05 -07:00
losfair
115da5f130 Try to fix missing git submodule 2019-08-22 13:07:51 -07:00
losfair
7491b360ac Fix CodeMemory::new(0) 2019-08-22 11:57:58 -07:00
bors[bot]
e2bbd4564e
Merge #712
712: Improve build instructions in README, test on Rust 1.36 r=MarkMcCaskey a=MarkMcCaskey

Copied from syn (which is copied from num) (https://github.com/dtolnay/syn/issues/372)

[rendered](8fa4ef34c1/README.md (building))

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-22 18:57:20 +00:00
Mark McCaskey
8fa4ef34c1 Improve build instructions in README, test on Rust 1.36 2019-08-22 11:26:23 -07:00
losfair
86814a1920 Merge remote-tracking branch 'origin/master' into feature/llvm-osr 2019-08-22 10:47:39 -07:00
bors[bot]
877fe4460e
Merge #708
708: runtime-c-api: not installing cranelift if not necessary r=Hywan a=YaronWittenstein

having `default-features = false` lets us install the `runtime-c-api` with `default-backend-singlepass` without installing also `cranelift`

Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
2019-08-22 14:39:17 +00:00
Yaron Wittenstein
86a3a75fe7 adding to llvm-backend feature: "wasmer-runtime/default-backend-llvm" 2019-08-22 17:21:13 +03:00
Yaron Wittenstein
ad49e98183 Merge branch 'master' into c-api-cargo-singlepass-feature 2019-08-22 17:09:29 +03:00
Yaron Wittenstein
dd705d8031 Cargo.toml - building singlepass-backend without default features works 2019-08-22 16:36:01 +03:00
Yaron Wittenstein
4fcf61f3a0 Cargo.toml - fix 2019-08-22 15:52:23 +03:00
Yaron Wittenstein
0d888824cd Cargo.toml - renaming features 2019-08-22 14:36:12 +03:00
bors[bot]
7e030272b4
Merge #566
566: doc(runtime-c-api) Document and reorganize `exports.rs`. r=Hywan a=Hywan

This patch moves all structs at the beginning of the file, and
documents them.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-08-22 11:30:32 +00:00
Ivan Enderlin
6403159b57
Merge branch 'master' into doc-runtime-c-api-exports-1 2019-08-22 13:29:54 +02:00
Ivan Enderlin
a9bb8fea16
doc(runtime-c-api) Fix a typo.
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2019-08-22 13:29:26 +02:00
Ivan Enderlin
8ad181f94c
doc(runtime-c-api) Fix a typo.
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2019-08-22 13:29:11 +02:00
Yaron Wittenstein
2c3e5f06d0 Cargo.toml - renaming feature default-backend-singlepass to singlepass. 2019-08-22 14:23:13 +03:00
Yaron Wittenstein
0b84d9b5af Cargo.toml - installing cranelif by default. 2019-08-22 13:24:25 +03:00
Yaron Wittenstein
4a74023793 Merge branch 'master' into c-api-cargo-singlepass-feature 2019-08-22 13:06:45 +03:00
bors[bot]
763edf99df
Merge #663
663: Bump nix from 0.14.1 to 0.15.0 r=Hywan a=dependabot-preview[bot]

Bumps [nix](https://github.com/nix-rust/nix) from 0.14.1 to 0.15.0.
<details>
<summary>Changelog</summary>

*Sourced from [nix's changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md).*

> ## [0.15.0] - 10 August 2019
> ### Added
> - Added `MSG_WAITALL` to `MsgFlags` in `sys::socket`.
>   ([#1079](https://github-redirect.dependabot.com/nix-rust/nix/pull/1079))
> - Implemented `Clone`, `Copy`, `Debug`, `Eq`, `Hash`, and `PartialEq` for most
>   types that support them. ([#1035](https://github-redirect.dependabot.com/nix-rust/nix/pull/1035))
> - Added `copy_file_range` wrapper
>   ([#1069](https://github-redirect.dependabot.com/nix-rust/nix/pull/1069))
> - Add `mkdirat`.
>   ([#1084](https://github-redirect.dependabot.com/nix-rust/nix/pull/1084))
> - Add `posix_fadvise`.
>   ([#1089](https://github-redirect.dependabot.com/nix-rust/nix/pull/1089))
> - Added `AF_VSOCK` to `AddressFamily`.
>   ([#1091](https://github-redirect.dependabot.com/nix-rust/nix/pull/1091))
> - Add `unlinkat`
>   ([#1058](https://github-redirect.dependabot.com/nix-rust/nix/pull/1058))
> - Add `renameat`.
>   ([#1097](https://github-redirect.dependabot.com/nix-rust/nix/pull/1097))
> 
> ### Changed
> - Support for `ifaddrs` now present when building for Android.
>   ([#1077](https://github-redirect.dependabot.com/nix-rust/nix/pull/1077))
> - Minimum supported Rust version is now 1.31.0
>   ([#1035](https://github-redirect.dependabot.com/nix-rust/nix/pull/1035))
>   ([#1095](https://github-redirect.dependabot.com/nix-rust/nix/pull/1095))
> - Now functions `statfs()` and `fstatfs()` return result with `Statfs` wrapper
>   ([#928](https://github-redirect.dependabot.com/nix-rust/nix/pull/928))
> 
> ### Fixed
> - Enabled `sched_yield` for all nix hosts.
>   ([#1090](https://github-redirect.dependabot.com/nix-rust/nix/pull/1090))
> 
> ### Removed
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/nix-rust/nix/commits)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=nix&package-manager=cargo&previous-version=0.14.1&new-version=0.15.0)](https://dependabot.com/compatibility-score.html?dependency-name=nix&package-manager=cargo&previous-version=0.14.1&new-version=0.15.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-08-22 08:45:26 +00:00
Yaron Wittenstein
2370553f3b Merge branch 'master' into c-api-cargo-singlepass-feature 2019-08-22 11:12:04 +03:00
Yaron Wittenstein
ad0cf47812 Merge branch 'develop' into c-api-cargo-singlepass-feature 2019-08-22 11:05:08 +03:00
Yaron Wittenstein
e6387ec7c3 Merge branch 'master' into c-api-cargo-singlepass-feature 2019-08-22 11:02:57 +03:00
losfair
c7377a465f Merge remote-tracking branch 'origin/master' into feature/llvm-osr 2019-08-21 15:49:25 -07:00
dependabot-preview[bot]
5d4b78e880
Bump nix from 0.14.1 to 0.15.0
Bumps [nix](https://github.com/nix-rust/nix) from 0.14.1 to 0.15.0.
- [Release notes](https://github.com/nix-rust/nix/releases)
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-21 22:36:56 +00:00
losfair
b0beb28ea7 Fix unused import on Windows. 2019-08-21 15:32:20 -07:00
losfair
56e735349d Format everything 2019-08-21 15:23:56 -07:00
losfair
53ebcc355a Disable LLVM stackmap on Windows 2019-08-21 15:23:11 -07:00
losfair
6d7a91a271 Remove a.out in lib/runtime-c-api/tests. 2019-08-21 15:10:27 -07:00
bors[bot]
a7c70043c1
Merge #702
702: Add support for shared memory in Wasm. r=nlewycky a=nlewycky

Add support for memory regions with the shared flag. These are part of the threads proposal.

- Add new `--enable-threads` flags and pass it through to wasmparser.rs and wabt (for .wat files).
- Enable `--enable-threads` when parsing spectests. Enables the shared memory region in `simd.wast`.
- Adds `atomic.wast`, the spec test for the threads proposal. With the LLVM backend, all tests pass.
- Removes the `runtime-core/src/memory/static_` directory since there's no need for it to include two implementations. We use the same implementation of static memory for shared and unshared static memory.
- Implements the atomic instructions in the LLVM backend. However, `atomic.load` and `atomic.store` are provided **with no atomicity.** The rmw and cmpxchg instructions are sequentially consistent.
- `atomic.notify` and `atomic.wait` are unimplemented.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-08-21 22:05:15 +00:00
losfair
08ab8d16e1 Handle SIGILL in LLVM. 2019-08-21 15:05:10 -07:00
Nick Lewycky
8705fe172d Merge branch 'master' of github.com:wasmerio/wasmer into feature/shared-memory 2019-08-21 15:04:38 -07:00
losfair
74faaa3be8 Merge branch 'fix/llvm-trap-windows' into feature/llvm-osr 2019-08-21 15:02:17 -07:00
Nick Lewycky
e6ec261cd5 Remove commented out code. 2019-08-21 15:01:21 -07:00
losfair
bf9d915635 Fix a few issues from PR comments. 2019-08-21 14:53:33 -07:00
losfair
bf471fbc24 Cleanup LLVM object loader. 2019-08-21 11:08:23 -07:00
bors[bot]
31365510ed
Merge #703
703: Fix compilation on AArch64 Linux. r=losfair a=losfair

This only fixes compilation. Cranelift still reports many `not yet implemented` on AArch64.

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-08-21 17:51:48 +00:00
bors[bot]
15913a946f
Merge #666 #695
666: Bump serde_bytes from 0.11.1 to 0.11.2 r=Hywan a=dependabot-preview[bot]

Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.1 to 0.11.2.
<details>
<summary>Release notes</summary>

*Sourced from [serde_bytes's releases](https://github.com/serde-rs/bytes/releases).*

> ## 0.11.2
> - Support "alloc" feature on stable Rust 1.36+ ([#16](https://github-redirect.dependabot.com/serde-rs/bytes/issues/16), thanks [@&#8203;martindisch](https://github.com/martindisch))
</details>
<details>
<summary>Commits</summary>

- [`4856e26`](4856e2611f) Release 0.11.2
- [`1d40bb5`](1d40bb5994) Merge pull request [#16](https://github-redirect.dependabot.com/serde-rs/bytes/issues/16) from martindisch/alloc-stable
- [`a626ecc`](a626ecce86) Remove unstable feature attribute for alloc crate
- See full diff in [compare view](https://github.com/serde-rs/bytes/compare/0.11.1...0.11.2)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=serde_bytes&package-manager=cargo&previous-version=0.11.1&new-version=0.11.2)](https://dependabot.com/compatibility-score.html?dependency-name=serde_bytes&package-manager=cargo&previous-version=0.11.1&new-version=0.11.2)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

695: Bump serde from 1.0.98 to 1.0.99 r=Hywan a=dependabot-preview[bot]

Bumps [serde](https://github.com/serde-rs/serde) from 1.0.98 to 1.0.99.
<details>
<summary>Release notes</summary>

*Sourced from [serde's releases](https://github.com/serde-rs/serde/releases).*

> ## v1.0.99
> - Update Syn dependency to 1.0.
> 
>     *Note: This raises the minimum required compiler version for serde_derive from rustc 1.15 to rustc 1.31. The minimum required compiler version for serde remains at rustc 1.13.*
</details>
<details>
<summary>Commits</summary>

- [`192f5cd`](192f5cd647) Release 1.0.99
- [`7dceee6`](7dceee64fe) Merge pull request [#1591](https://github-redirect.dependabot.com/serde-rs/serde/issues/1591) from dtolnay/up
- [`8ad6ae7`](8ad6ae71c6) Update serde_derive minimum rustc version to 1.31
- [`3ea85a2`](3ea85a28cf) Update to syn/quote 1.0
- [`273ecdb`](273ecdb786) Update ui tests on nightly-2019-08-16
- [`de40eb7`](de40eb7306) Update serde_derive to use question mark
- [`b9c4407`](b9c44073ce) Update serde_test to use question mark
- [`d6e5947`](d6e5947ad2) Suppress warnings about try! macro
- [`668651e`](668651ee01) Format with rustfmt 2019-07-30
- [`fb1cacc`](fb1cacc10e) Update Attr structs to hold symbols
- Additional commits viewable in [compare view](https://github.com/serde-rs/serde/compare/v1.0.98...v1.0.99)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.98&new-version=1.0.99)](https://dependabot.com/compatibility-score.html?dependency-name=serde&package-manager=cargo&previous-version=1.0.98&new-version=1.0.99)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-08-21 07:46:26 +00:00
losfair
3f0dae3329 Fix compilation on AArch64 Linux. 2019-08-20 16:37:32 -07:00
Nick Lewycky
08ee2c0297 Run cargo update. 2019-08-20 12:59:35 -07:00
Nick Lewycky
2882c75957 No need to emit any alignment check for byte-aligned accesses. 2019-08-20 11:30:30 -07:00
Nick Lewycky
70d561a1dd Remove SharedStaticMemory and simplify surrounding code. 2019-08-20 11:30:19 -07:00
Nick Lewycky
1568084d42 Add atomic.wast which we have zero failures on with the llvm backend.
Enable shared memory usage in simd.wast.

Exclude atomic.wast on singlepass and clif.
2019-08-20 11:17:52 -07:00
Nick Lewycky
dcf70167da Fix i64.atomic.load32_u and all alignment checks. 2019-08-20 11:03:22 -07:00
Nick Lewycky
0ba73ac50c Correct flipped misalignment test. 2019-08-20 10:39:53 -07:00
losfair
90dcdfec1c Cargo fmt 2019-08-19 19:17:50 -07:00
losfair
fbe69281ec Add note on many_params test. 2019-08-19 19:17:32 -07:00
losfair
942298facd Add test case for params passed on stack. 2019-08-19 19:13:27 -07:00
losfair
4e6267aa57 Correctly handle more than 5 WASM function parameters when reading state of a LLVM context. 2019-08-19 19:12:33 -07:00
Nick Lewycky
172ef77ddd Use the static intrinsics for static shared memory too. 2019-08-19 17:26:35 -07:00
Nick Lewycky
d66b805529 Add misaligned atomic access trap display for WasmTrapInfo. 2019-08-19 17:26:15 -07:00
Nick Lewycky
0eba153232 Implement shared static memory similarly to unshared static memory. 2019-08-19 15:18:22 -07:00
losfair
124ad73e8a Merge remote-tracking branch 'origin/master' into feature/llvm-osr 2019-08-19 13:06:59 -07:00
Nick Lewycky
c8378329c1 Expound upon Fence's empty implementation being correct. 2019-08-19 10:51:14 -07:00
Nick Lewycky
aecce465c7 Implement atomic.rmw operations including atomic.rmw.cmpxchg. 2019-08-19 10:51:14 -07:00
Nick Lewycky
f2077c204b Implement fence correctly, atomic load/store as non-atomic.
Adds trap for misaligned accesses.
2019-08-19 10:51:14 -07:00
Nick Lewycky
7f3837abc5 Enable threads in spectests. 2019-08-19 10:51:14 -07:00
Nick Lewycky
86346d6ebe Thread the feature support through to wasmparser. 2019-08-19 10:51:14 -07:00
Nick Lewycky
cca419c982 Add the --enable-threads flag and thread it as far as runtime-core. 2019-08-19 10:51:14 -07:00
dependabot-preview[bot]
d6fce6cf67
Bump serde_bytes from 0.11.1 to 0.11.2
Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.1 to 0.11.2.
- [Release notes](https://github.com/serde-rs/bytes/releases)
- [Commits](https://github.com/serde-rs/bytes/compare/0.11.1...0.11.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 16:36:27 +00:00
dependabot-preview[bot]
92dff871b4
Bump serde from 1.0.98 to 1.0.99
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.98...v1.0.99)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 16:36:26 +00:00
bors[bot]
6b2cd7e9cc
Merge #680
680: Fix singlepass error when no function code present r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-08-19 16:20:09 +00:00
bors[bot]
7762a72d8e
Merge #693
693: Bump cc from 1.0.38 to 1.0.40 r=Hywan a=dependabot-preview[bot]

Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.38 to 1.0.40.
<details>
<summary>Commits</summary>

- [`6ad3da7`](6ad3da7558) Bump to 1.0.40
- [`9fcdab9`](9fcdab9102) Fix a bad merge typo
- [`fa98eb0`](fa98eb054d) Bump to 1.0.39
- [`0187762`](0187762feb) Add CUDA support for MSVC ([#426](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/426))
- [`5c0dc67`](5c0dc67db0) Merge pull request [#433](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/433) from turboladen/feature/config-ios-version-min
- [`f99a424`](f99a4248b7) Merge pull request [#432](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/432) from BaoshanPang/master
- [`5ab556e`](5ab556e5f9) use wr-c++ instead of vx-cxx
- [`bae28ef`](bae28efb21) Detect and use `IPHONEOS_DEPLOYMENT_TARGET` for the `-mi*os-version-min` flag
- [`13e04b1`](13e04b1ec0) Merge pull request [#430](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/430) from laanwj/2019_08_rv_nopic
- [`c7cd5dd`](c7cd5ddf6c) Merge pull request [#429](https://github-redirect.dependabot.com/alexcrichton/cc-rs/issues/429) from laanwj/2019_08_rv_correct_abi
- Additional commits viewable in [compare view](https://github.com/alexcrichton/cc-rs/compare/1.0.38...1.0.40)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.0.38&new-version=1.0.40)](https://dependabot.com/compatibility-score.html?dependency-name=cc&package-manager=cargo&previous-version=1.0.38&new-version=1.0.40)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2019-08-19 15:48:25 +00:00
Brandon Fish
38b1e3d25e
Merge branch 'master' into feature/fix-singlepass-panic-no-functions 2019-08-19 09:24:55 -06:00
bors[bot]
b1255179e0
Merge #698
698: Fix issue with emscripten memory out of range r=bjfish a=bjfish

Fixes #678 

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-19 15:15:12 +00:00
Brandon Fish
1886760eba Fix issue with emscripten memory out of range 2019-08-19 09:45:14 -05:00
dependabot-preview[bot]
33e00df668
Bump cc from 1.0.38 to 1.0.40
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.38 to 1.0.40.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.38...1.0.40)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 11:39:05 +00:00
Syrus
09e843090f Updated logo 2019-08-17 21:41:09 -07:00
bors[bot]
dac86eec33
Merge #689
689: Replace wasmer_runtime_code::memory::Atomic with std::sync::atomic atomics. r=nlewycky a=nlewycky

This means we lose op_new(), op_weak() and proxy() from the interface.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-08-17 18:57:28 +00:00
nlewycky
8b22d40988
Merge branch 'master' into nlewycky/std-atomic 2019-08-17 10:40:34 -07:00
Brandon Fish
7b7f55306c
Merge branch 'master' into feature/fix-singlepass-panic-no-functions 2019-08-17 00:34:06 -06:00
bors[bot]
0a3182e0ed
Merge #690
690: Convert panic to error when calling emscripten main r=bjfish a=bjfish

Fixes #685 

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-17 04:30:02 +00:00
Brandon Fish
d89990951e Convert panic to error when calling emscripten main 2019-08-16 22:18:13 -06:00
Nick Lewycky
3040ec90ad cargo fmt 2019-08-16 18:00:20 -07:00
Nick Lewycky
a3fe372beb Replace wasmer_runtime_code::memory::Atomic with std::sync::atomic atomics.
This means we lose op_new(), op_weak() and proxy() from the interface.
2019-08-16 17:36:11 -07:00
losfair
dbaa000e96 Re-enable snapshotting. 2019-08-16 13:08:10 -07:00
bors[bot]
2ebe93cc72
Merge #687
687: Fix emscripten table assertion panic r=bjfish a=bjfish

Fixes #686 

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-16 15:58:45 +00:00
Brandon Fish
57e621d307 Fix emscripten test usage and fix error conditional 2019-08-16 09:57:36 -06:00
Brandon Fish
d1c9ab3539 Convert emscripten memory assertion to error 2019-08-16 09:18:51 -06:00
Brandon Fish
03cabce2d5 Fix emscripten table assertion panic 2019-08-16 09:12:46 -06:00
Syrus Akbary
6e8baf3c89
Merge pull request #684 from wasmerio/feature/add-contributing-md
Add contributing.md
2019-08-15 22:30:03 -07:00
Syrus Akbary
9ef986b574
Merge pull request #683 from wasmerio/feature/add-deny-non-standard-style-unused-mut
Add deny nonstandard-style and unused-mut lints
2019-08-15 22:28:44 -07:00
Brandon Fish
3f07cb2d25 Initial commit of contributing document 2019-08-15 20:58:52 -06:00
losfair
be4ea764a0 Update iterative_hash example for benchmarking 2019-08-15 19:37:54 -07:00
Brandon Fish
bccbbb3d8b Add deny nonstandard-style and unused-mut lints 2019-08-15 20:18:29 -06:00
losfair
afa0600701 Cargo fmt 2019-08-15 19:13:00 -07:00
losfair
8a1f399df6 Fix NaN during first round issue in the iterative hash example. 2019-08-15 19:12:32 -07:00
losfair
6a24485999 Insert trampolines to preserve callee-saved registers for backends without register save area information. 2019-08-15 19:10:24 -07:00
Brandon Fish
98d3e04137 Fix unused mut warning 2019-08-15 20:09:51 -06:00
losfair
0a54213d4f register_preservation_trampoline 2019-08-15 19:08:11 -07:00
losfair
7028df23ef Allow only integers for LLVM function param/return values. 2019-08-15 19:07:03 -07:00
losfair
9471f643fd Update iterative_hash example. 2019-08-15 19:03:39 -07:00
Brandon Fish
439e81d41e Fix singlepass error when no function code present 2019-08-15 10:15:58 -06:00
bors[bot]
995f40564e Merge #671
671: Add wasi::poll_oneoff for Unix r=MarkMcCaskey a=MarkMcCaskey

Part of #570

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-08-15 07:58:35 +00:00
Mark McCaskey
0c45707d33 implement wasi::poll_oneoff for write on Unix-like platforms 2019-08-15 15:51:16 +09:00
Mark McCaskey
d733989657 Add wasi::poll_oneoff file read test 2019-08-15 13:13:20 +09:00
losfair
1582224d61 Cargo fmt 2019-08-14 17:16:30 -07:00
losfair
9edd9ffdfe Make lookup_*_ip public. 2019-08-14 17:14:01 -07:00
losfair
c9e3db3d94 Remove feature(core_intrinsics) 2019-08-14 16:41:44 -07:00
losfair
98ef9182d7 Run clang-format and cargo fmt 2019-08-14 16:35:40 -07:00
losfair
0e0573c73c Merge remote-tracking branch 'origin/master' into feature/llvm-osr 2019-08-14 16:33:26 -07:00
bors[bot]
804e586196 Merge #677
677: Mark memory.size VM intrinsics as not modifying state, and throw.trap/breakpoint as functions which do not return. r=syrusakbary a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-08-14 20:27:56 +00:00
Mark McCaskey
ec20e325fb Feature gate Unix-specific polling code 2019-08-14 16:38:57 +09:00
Mark McCaskey
34340692bf
Merge branch 'master' into feature/wasi-polloneoff 2019-08-14 16:14:47 +09:00
Mark McCaskey
8c03338330 Implement wasi::poll_oneoff more properly for Unix 2019-08-14 15:51:39 +09:00
Nick Lewycky
2f3c9c3e2f Mark memory.size VM intrinsics as not modifying state, and throw.trap/breakpoint as functions which do not return. 2019-08-13 21:50:54 -07:00
bors[bot]
01f1c120d2 Merge #676
676: Compare float bits in spectests assert return r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-14 04:29:02 +00:00
Brandon Fish
8e46e797ac Compare float bits in spectests assert return 2019-08-13 22:14:10 -06:00
bors[bot]
0ab0e9b80a Merge #675
675: Add missing LLVM imported memory functions r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-14 03:36:46 +00:00
Brandon Fish
0bf33662d1 Add missing LLVM imported memory functions 2019-08-13 20:07:55 -06:00
bors[bot]
e05915cf72 Merge #674
674: Return compile error (llvm) for setting immutable global r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-14 01:40:38 +00:00
Brandon Fish
137ac206af Return compile error (llvm) for setting immutable global 2019-08-13 17:59:04 -06:00
bors[bot]
d12ea66f90 Merge #673
673: Add memory descriptor validation r=bjfish a=bjfish

Fixes #653 

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-13 22:18:54 +00:00
Brandon Fish
de8fe32dbe Add memory validation 2019-08-13 13:04:13 -06:00
Mark McCaskey
09b056cc40 Add wip wasi::poll_oneoff work 2019-08-13 16:59:01 +09:00
Syrus Akbary
5239cdb85a
Merge pull request #668 from wasmerio/feature/update-wabt-to-fix-names-spectests
Update WABT dep to fix names spectests
2019-08-13 00:13:36 -07:00
Syrus Akbary
6f6c849272
Merge pull request #669 from wasmerio/feature/finalize-when-no-function-body
Finalize signatures & names when no function bodies
2019-08-13 00:13:20 -07:00
Brandon Fish
f22250d85a Refactor func_count in parser 2019-08-12 21:36:17 -06:00
Brandon Fish
e76777ed9b Finalize signatures & names when no function bodies 2019-08-12 20:22:54 -06:00
Brandon Fish
d695bd0c84 Update WABT dep to fixe names spectests 2019-08-12 15:35:32 -06:00
Syrus
a4979f9909 Remove Logo in non verbose mode 2019-08-11 23:25:50 -07:00
Syrus
8e363aa0bc Added option for minify the total output for install 2019-08-11 23:13:58 -07:00
Syrus
f78e00c7f4 Improved Install script 2019-08-11 22:29:14 -07:00
Brandon Fish
2afdc1d25f
Merge pull request #661 from wasmerio/feature/unexclude-passing-elem-spec
Unexclude passing elem spec
2019-08-11 18:21:00 -06:00
Brandon Fish
20cb7c0048
Merge branch 'master' into feature/unexclude-passing-elem-spec 2019-08-11 18:04:54 -06:00
Brandon Fish
a4b32c1705
Merge pull request #660 from wasmerio/feature/validate-initializers-before-finalizing
Validate all initializers before finalizing
2019-08-11 14:07:07 -06:00
Brandon Fish
9b4ba66e11 Add code comment explanation of validation 2019-08-11 13:59:48 -06:00
Brandon Fish
c837b56678 Unexclude passing elem spec 2019-08-11 13:52:57 -06:00
Brandon Fish
f61fc5c298 Validate all initializers before finalizing 2019-08-11 13:28:47 -06:00
bors[bot]
6ac3ac1c65 Merge #659
659: Validate initializers before writing to memory r=bjfish a=bjfish

Fixes `linking.wast:342`

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-11 07:49:06 +00:00
Syrus
8f31678813 Improve cache 2019-08-10 18:17:01 -07:00
Syrus
fff86f8043 Fix sccache in Windows 2019-08-10 18:15:29 -07:00
Syrus
3517bd51eb Trying to fix sccache 2019-08-10 18:02:57 -07:00
Syrus
af12f627ad Improved sccache usage 2019-08-10 17:57:35 -07:00
Syrus
f83e4edf4f Fixed references to sccache 2019-08-10 17:51:30 -07:00
Syrus
025bd9e32c Trying to fix sccache install 2019-08-10 17:47:09 -07:00
Syrus
1045d46d3d Fixed reference error 2019-08-10 17:41:50 -07:00
Syrus
28ebba41b0 Added sscache to improve compilation times 2019-08-10 17:39:39 -07:00
Syrus
ee1ca08bb8 Moved check down 2019-08-10 16:41:58 -07:00
Syrus
86684bd1a1 Fixed windows tests 2019-08-10 16:31:50 -07:00
Brandon Fish
38a8a0eb01 Minimize unsafe block to unsafe code 2019-08-10 17:20:27 -06:00
Syrus
739f52a81d Comment integration tests for now 2019-08-10 16:18:06 -07:00
Syrus
bdf8a40687 Fixed LLVM install in Windows 2019-08-10 16:17:58 -07:00
Brandon Fish
b7970fb982 Uncomment slow exclude test again 2019-08-10 17:11:32 -06:00
Brandon Fish
0b73776c84 Validate all memory data initializers before writing 2019-08-10 17:10:24 -06:00
Syrus Akbary
0c45b75e14
Merge pull request #658 from wasmerio/feature/reuse-registered-module-instance
Re-use registered module instances in spectests
2019-08-10 16:08:22 -07:00
Syrus
141fad86b3 Added Cache, improved LLVM install 2019-08-10 15:51:51 -07:00
Syrus
a82907eb22 Improved Azure install requirements 2019-08-10 15:32:09 -07:00
Syrus
0ae66297b7 Fixed config 2019-08-10 14:58:21 -07:00
Brandon Fish
228d562a3b Re-use registered module instances in spectests 2019-08-10 15:56:25 -06:00
Syrus
98711dd3d8 Renamed azure pipelines config file 2019-08-10 14:53:47 -07:00
bors[bot]
1f8f810222 Merge #657
657: Spectest Fixes r=bjfish a=bjfish

- Invalid table size for elems should produce link error
- Remove filter which prevents initializer offset check

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-08-10 21:34:58 +00:00
Brandon Fish
db5d8a5bf8 Push debug print to debug CI failure 2019-08-10 15:33:08 -06:00
Brandon Fish
4651b43078
Merge branch 'master' into feature/fix-table-init-error 2019-08-10 15:19:02 -06:00
Brandon Fish
a621b86286 Update windows excludes 2019-08-10 15:04:24 -06:00
Brandon Fish
b484ebb848 cargo fmt 2019-08-10 14:01:50 -06:00
Brandon Fish
bb8b4960b8 Remove filter which prevents initializer offset check 2019-08-10 13:59:31 -06:00
bors[bot]
e1003b7bdc Merge #655
655: Fix more bare dyn traits in runtime-c-api r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-10 18:29:36 +00:00
Brandon Fish
1584beebe6 Invalid table size for elems should produce link error 2019-08-10 12:13:14 -06:00
Syrus
462b0b5149 Initial version of Azure pipelines 2019-08-10 11:11:54 -07:00
Brandon Fish
6372e0947c Fix more bare dyn traits in runtime-c-api 2019-08-10 11:20:22 -06:00
bors[bot]
d23e5eb18c Merge #649
649: Fix some spectest imports and namespace_table issue r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-08-09 20:12:58 +00:00
Brandon Fish
8ec4c0e01d
Merge branch 'master' into feature/fix-namespace-table-issue 2019-08-09 14:12:25 -06:00
losfair
44f71759f6 Use Vec::with_capacity in various places. 2019-08-10 03:23:29 +08:00
losfair
9cade2b441 singlepass: Skip patchpoint. 2019-08-10 03:10:32 +08:00
losfair
d61a8bb6d2 Prevent continueing execution on unreliable stack. (LLVM register save area information is missing) 2019-08-10 03:10:12 +08:00
losfair
2e89f02191 Cargo fmt 2019-08-10 02:44:44 +08:00
losfair
03665fe74a Add CLI option for optimized backends. 2019-08-10 02:43:21 +08:00
losfair
8dfdd82865 Enable managed feature in wasmer-runtime-core 2019-08-10 02:32:33 +08:00
losfair
b8c18215aa Refactor tier switching code 2019-08-10 02:32:14 +08:00
Syrus Akbary
f909f7ed1f
Merge pull request #650 from wasmerio/feature/wasi-path-rename
implement wasi::path_rename
2019-08-09 01:09:23 -07:00
Mark McCaskey
61f1df06d1 implement wasi::path_rename 2019-08-09 15:40:04 +09:00
Brandon Fish
7f0c48b354 Add windows clif excludes 2019-08-08 21:12:36 -06:00
bors[bot]
4dd9db436b Merge #648
648: Remove structopt dependency from LLVM r=syrusakbary a=syrusakbary

* [x] Remove structopt dependency from LLVM
* [x] Fixed `dyn` warning in the wasmer cli
* [x] Make `nix` an optional dependency for LLVM backend

Co-authored-by: Syrus <me@syrusakbary.com>
2019-08-09 03:03:29 +00:00
Brandon Fish
a7ff120dd9 Fix some spectest imports and namespace_table issue 2019-08-08 21:03:00 -06:00
Syrus
d39d4b5f6d Remove structopt dependency from LLVM 2019-08-08 19:42:41 -07:00
bors[bot]
27d8506a46 Merge #643
643: Improve error reporting of IO errors, implement path_symlink r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-09 00:34:22 +00:00
Mark McCaskey
e29a89a3f8 add path_symlink entry to changelog 2019-08-09 09:32:38 +09:00
bors[bot]
46bb58d136 Merge #647
647: Add support for backend flags. Backend flags are opaque to src/bin/wasmer.rs. r=nlewycky a=nlewycky

Use them to implement three features in the LLVM backend, getting a valid ELF object file, the post-optimization LLVM IR and the pre-optimization LLVM IR.

Presently they are also global to the backend which is not ideal.

Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
2019-08-09 00:06:07 +00:00
Nick Lewycky
b2c4501357 Add support for backend flags. Backend flags are opaque to src/bin/wasmer.rs.
Use them to implement three features in the LLVM backend, getting a valid ELF object file, the post-optimization LLVM IR and the pre-optimization LLVM IR.

Presently they are also global to the backend which is not ideal.
2019-08-08 17:05:31 -07:00
bors[bot]
77fe15db31 Merge #646
646: Fix bare_trait_objects warnings r=bjfish a=bjfish

These appear to be coming to stable soon:
https://github.com/rust-lang/rust/blob/master/RELEASES.md#compatibility-notes

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-08 23:25:07 +00:00
bors[bot]
e994e0969f Merge #645
645: Fix a bug where we would fail to find llvm-config-M or llvm-config-M-N when llvm-sys would. r=nlewycky a=nlewycky

Fix another bug where we wouldn't rebuild when certain environment variables changed.

Update to match features in newer llvm-sys.


Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
2019-08-08 23:12:00 +00:00
Brandon Fish
5a41686192 Fix bare_trait_objects warnings 2019-08-08 16:46:52 -06:00
Nick Lewycky
02f1d73f88 Reformat. 2019-08-08 13:55:44 -07:00
Nick Lewycky
c4d4a6888c Fix a bug where we would fail to find llvm-config-M or llvm-config-M-N when llvm-sys would.
Update to match features in newer llvm-sys.
2019-08-08 13:46:40 -07:00
losfair
c1619026d5 Swap code lazily when tiering up from singlepass to LLVM.
Does not handle long-running functions, but should work at least.
2019-08-09 04:26:17 +08:00
Syrus Akbary
3e23ace954
Merge pull request #642 from wasmerio/feature/unexclude-some-passing-unlinkable
Unexclude some now passing assert_unlinkable
2019-08-08 11:52:29 -07:00
Syrus Akbary
537c1562cc
Merge pull request #641 from wasmerio/nlewycky/patch-2
The feature is named "backend-cranelift" in Cargo.toml.
2019-08-08 10:30:37 -07:00
losfair
0d604b754b Commented out code for saving semantics of internal values. 2019-08-08 21:54:39 +08:00
Mark McCaskey
d0696a0c0e implement wasi::path_symlink test & fix readlink test 2019-08-08 16:42:27 +09:00
Brandon Fish
55f214b3ac
Merge branch 'master' into feature/unexclude-some-passing-unlinkable 2019-08-07 23:19:40 -06:00
Brandon Fish
1c32e2a4af Add windows specific clif failures 2019-08-07 23:10:50 -06:00
Mark McCaskey
cdfd9afccc Improve error reporting of IO errors, begin implementation of path_symlink 2019-08-08 11:59:35 +09:00
Brandon Fish
0b0a77413e Unexclude some now passing assert_unlinkable 2019-08-07 19:45:31 -06:00
bors[bot]
205d7081f5 Merge #640
640: Protect::ReadWriteExec is readable and writable. r=syrusakbary a=nlewycky

Also assert that page size is a power of two in two places we assume it is.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-08-08 01:36:19 +00:00
bors[bot]
321ca4e565 Merge #635
635: Update spectests and runner r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus <me@syrusakbary.com>
2019-08-08 00:51:59 +00:00
bors[bot]
666fabba8b Merge #608
608: Implement more wasi syscalls r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-08-08 00:19:17 +00:00
Mark McCaskey
b8f8a637c1
Merge branch 'master' into feature/more-wasi-syscalls 2019-08-07 16:55:03 -07:00
Mark McCaskey
a1a344774b Add CHANGELOG entry 2019-08-08 08:52:44 +09:00
Nick Lewycky
b4eab13e11 The feature is backend-cranelift in Cargo.toml.
Not a big deal right now because cranelift does not implement metering yet.
2019-08-07 16:49:41 -07:00
Nick Lewycky
75959577c3 Protect::ReadWriteExec is readable and writable.
Also assert that page size is a power of two in two places we assume it is.
2019-08-07 16:49:29 -07:00
Brandon Fish
8763d2cbde
Merge branch 'master' into feature/spectests-runner 2019-08-07 16:50:06 -06:00
bors[bot]
bd31422872 Merge #639
639: Return link error instead of assertion failure for bad data r=bjfish a=bjfish

Fixes #588 

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-08-07 21:48:46 +00:00
Brandon Fish
5d9aa1f986 Return link error instead of assertion failure for bad data initialization 2019-08-07 15:40:42 -06:00
losfair
b113f5a24b longjmp turns out to work on Windows. Remove custom unwinding code. 2019-08-08 03:19:19 +08:00
Mark McCaskey
ddb0b99f12 implement path_link updated unlink, fix tests, add new test 2019-08-07 16:11:38 +09:00
Mark McCaskey
6ad0be1e02 add fd_sync test 2019-08-07 12:41:35 +09:00
Mark McCaskey
dbe96bbce9 add wasi::fd_sync 2019-08-07 12:17:52 +09:00
Brandon Fish
dc8384ed22 Add windows specific excludes 2019-08-06 21:03:09 -06:00
Brandon Fish
b7236a58fc Add support for platform star key skip exclude 2019-08-06 20:06:34 -06:00
Brandon Fish
8487b21efa Add remote desktop script 2019-08-06 18:29:45 -06:00
losfair
4b1d337ebe Custom setjmp/longjmp to avoid SEH. (will it work?) 2019-08-07 00:38:42 +08:00
losfair
b50fd31adb Use setjmp/longjmp to handle LLVM exceptions. 2019-08-07 00:06:35 +08:00
Brandon Fish
9b4ee9db5d Remove appveyor RDP configuration 2019-08-05 21:26:42 -06:00
Brandon Fish
7ad629b63e Enable RDP 2019-08-05 21:12:19 -06:00
Brandon Fish
8c13eae2b8 Allow platform specific excludes 2019-08-05 20:57:07 -06:00
Syrus
c15da949bb Test in release mode in windows (faster tests) 2019-08-05 18:42:35 -07:00
Brandon Fish
a56aaeaaa3 Add additional spectest imports 2019-08-05 19:25:12 -06:00
Brandon Fish
03e1b3d8e8 Remove unnecessary println and make spectest runs nocapture 2019-08-05 18:58:51 -06:00
Brandon Fish
540520e54e cargo fmt 2019-08-05 17:55:41 -06:00
Brandon Fish
dc94cfb7b8 Merge branch 'master' into feature/spectests-runner 2019-08-05 17:53:04 -06:00
Brandon Fish
c65abf8ff5 Delete unused commented out println 2019-08-05 17:52:44 -06:00
Brandon Fish
08eb113394 Output failures in exclude format and add all failures as excludes 2019-08-05 17:51:02 -06:00
Nick Lewycky
1d54a938f6 Fix a couple bugs testing NaNs. Add an exclusion list for LLVM min/max. 2019-08-05 15:38:03 -07:00
bors[bot]
180522095f Merge #517
517: add instance creation benchmark r=syrusakbary a=MarkMcCaskey

a benchmark for creating a bunch of instances

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-08-05 22:08:46 +00:00
Syrus Akbary
07e6599a28
Merge branch 'master' into feature/instance-benchmark 2019-08-05 15:07:58 -07:00
bors[bot]
ec1f5db67f Merge #633 #634
633: Added support for setting environment variables. Fixed #394 r=syrusakbary a=syrusakbary

Added support for setting environment variables. Fixed #394

After installing Wasmer from this:
![Screen Shot 2019-08-05 at 2 31 22 PM](https://user-images.githubusercontent.com/188257/62496585-3ab9b980-b78e-11e9-8e98-fdb2c544d052.png)

And executing `wasmer cache dir`:
![Screen Shot 2019-08-05 at 2 32 45 PM](https://user-images.githubusercontent.com/188257/62496597-46a57b80-b78e-11e9-9581-f4271d7b400f.png)


634: Added extra assertions in Emscripten. Fixed #244 r=syrusakbary a=syrusakbary

This PR is a quick fix for #244

Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Syrus <me@syrusakbary.com>
2019-08-05 21:44:33 +00:00
Syrus
47456b5baa Fixed formatting 2019-08-05 14:37:08 -07:00
Syrus Akbary
7b54ce2690
Merge branch 'master' into feature/windows-env 2019-08-05 14:34:33 -07:00
Syrus Akbary
e0f98ea6a6 Added support for setting environment variables. Fixed #394 2019-08-05 14:33:17 -07:00
Syrus
fed7c79923 Added extra assertions in Emscripten. Fixed #244 2019-08-05 14:15:36 -07:00
Syrus
7ba32508fd Updated CHANGELOG with latest changes 2019-08-05 11:49:23 -07:00
Syrus
ea5affc05d Remove svm mentions in wasmer c api codebase 2019-08-05 11:49:16 -07:00
Syrus Akbary
fcb71f022f
Merge pull request #630 from wasmerio/dependabot/cargo/blake2b_simd-0.5.6
Bump blake2b_simd from 0.5.5 to 0.5.6
2019-08-05 10:57:24 -07:00
Syrus Akbary
6692978926
Merge branch 'master' into dependabot/cargo/blake2b_simd-0.5.6 2019-08-05 10:57:06 -07:00
Syrus Akbary
ea36b0aca1
Merge pull request #631 from wasmerio/dependabot/cargo/cc-1.0.38
Bump cc from 1.0.37 to 1.0.38
2019-08-05 10:56:31 -07:00
Syrus Akbary
6952da4b55
Merge pull request #628 from wasmerio/dependabot/cargo/regex-1.2.1
Bump regex from 1.2.0 to 1.2.1
2019-08-05 10:56:10 -07:00
dependabot-preview[bot]
06a7ab847b
Bump cc from 1.0.37 to 1.0.38
Bumps [cc](https://github.com/alexcrichton/cc-rs) from 1.0.37 to 1.0.38.
- [Release notes](https://github.com/alexcrichton/cc-rs/releases)
- [Commits](https://github.com/alexcrichton/cc-rs/compare/1.0.37...1.0.38)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-05 08:39:39 +00:00
dependabot-preview[bot]
50ebbc500f
Bump blake2b_simd from 0.5.5 to 0.5.6
Bumps [blake2b_simd](https://github.com/oconnor663/blake2_simd) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/oconnor663/blake2_simd/releases)
- [Commits](https://github.com/oconnor663/blake2_simd/compare/0.5.5...0.5.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-05 08:38:35 +00:00
dependabot-preview[bot]
a036a306d5
Bump regex from 1.2.0 to 1.2.1
Bumps [regex](https://github.com/rust-lang/regex) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.2.0...1.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-05 08:36:27 +00:00
Mark McCaskey
061d540627 Implement wasi::path_filestat_set_times 2019-08-05 15:53:42 +09:00
bors[bot]
da0fe49ade Merge #627
627: Add check to see if crates were published to release CI step r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-05 06:08:42 +00:00
Mark McCaskey
9d8b919bc1 Add check to see if crates were published to release CI step 2019-08-05 14:54:20 +09:00
Mark McCaskey
6db7bd8f07 get fd_allocate test working 2019-08-05 14:01:04 +09:00
Mark McCaskey
f0eb85a919 refactor wasi state file to hide boilerplate 2019-08-05 11:59:32 +09:00
Mark McCaskey
c2e3847e9a add check for fd_allocate, improve debug str for filestat_t 2019-08-05 11:24:06 +09:00
Mark McCaskey
8f06db45a1 format emitter with current stable Rust 2019-08-05 09:58:54 +09:00
Mark McCaskey
09acf3e581
Merge branch 'master' into feature/more-wasi-syscalls 2019-08-05 09:55:40 +09:00
Brandon Fish
43ae30985c Cleanup test runner 2019-08-04 16:44:27 -06:00
Brandon Fish
e3d78a1343 Implement allowed failures 2019-08-04 16:13:47 -06:00
Brandon Fish
b8610e799f Update README.md, remove old README.md, remove old spectest code 2019-08-04 15:53:48 -06:00
Brandon Fish
93233eb4b4 Implement registered modules 2019-08-04 15:36:17 -06:00
Brandon Fish
5c3edabb7c Enable simd compile 2019-08-04 14:44:55 -06:00
Brandon Fish
665f8707dc Implement named modules 2019-08-04 14:20:09 -06:00
Brandon Fish
8c911cb1c3 Implement action get for assert return 2019-08-04 13:37:39 -06:00
Brandon Fish
7060785d8d Implement assert_exhaustion 2019-08-04 13:18:57 -06:00
Brandon Fish
36bcda711f Update spectests and run by globbing wast files 2019-08-04 12:42:20 -06:00
Brandon Fish
9a33ece373 Merge branch 'master' into feature/spectests-runner 2019-08-04 11:34:22 -06:00
Brandon Fish
0583ae4846 Add system to skip wast commands to allow failures or skipping 2019-08-04 11:25:46 -06:00
Brandon Fish
f0cdb97320 Add invoke action and imports 2019-08-04 10:19:50 -06:00
Brandon Fish
7d376e18ee Add debug line info 2019-08-03 18:07:23 -06:00
Brandon Fish
021fefcdee Disable unlinkable spec temporarily, specs timeout 2019-08-03 17:57:34 -06:00
Brandon Fish
f46d07b5b3 Add more assertions 2019-08-03 17:31:43 -06:00
Yaron Wittenstein
8d583ad4d4 runtime-c-api: Cargo.toml - adding default-features=false for wasmer-runtime and wasmer-runtime-core dependencies 2019-08-03 22:47:36 +03:00
Yaron Wittenstein
a06fa40faa runtime-c-api: adding feature default-backend-singlepass to Cargo.toml 2019-08-03 22:03:21 +03:00
Yaron Wittenstein
9e51c39144 Cargo.toml - configuring singlepass feature 2019-08-03 11:54:59 +03:00
Syrus Akbary
8dc3bffe6e
Skip middleware-llvm tests until is fixed on CI
More info of the failure: https://circleci.com/gh/wasmerio/wasmer/11663

```
cargo test --manifest-path lib/middleware-common/Cargo.toml --release --features llvm
   Compiling wasmer-llvm-backend v0.6.0 (/home/circleci/project/lib/llvm-backend)
   Compiling inkwell v0.1.0 (https://github.com/wasmerio/inkwell?branch=llvm8-0#4c5359e5)
   Compiling wasmer-middleware-common v0.6.0 (/home/circleci/project/lib/middleware-common)
    Finished release [optimized] target(s) in 14.54s
     Running target/release/deps/wasmer_middleware_common-3c263452f3b7d07e

running 2 tests
test metering::tests::test_points_reduced_after_call ... test metering::tests::test_points_reduced_after_call has been running for over 60 seconds
test metering::tests::test_traps_after_costly_call ... test metering::tests::test_traps_after_costly_call has been running for over 60 seconds
Makefile:59: recipe for target 'middleware-llvm' failed
make: *** [middleware-llvm] Terminated
Too long with no output (exceeded 10m0s)
```
2019-08-02 18:45:21 -07:00
bors[bot]
fc37b00abc Merge #623
623: Add support for (register) command in spec tests and enable importing mutable globals. r=nlewycky a=nlewycky

Enable the part of the simd spec tests that now pass.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-08-02 23:51:39 +00:00
Nick Lewycky
9fcb06a270 Missed a line! 2019-08-02 16:49:28 -07:00
Nick Lewycky
59ef811b46 Update readme. 2019-08-02 16:48:34 -07:00
Brandon Fish
22808d1dba Implement spectests summary report 2019-08-02 16:00:35 -06:00
Nick Lewycky
546969a742 These tests are fixed too. 2019-08-02 14:33:11 -07:00
Nick Lewycky
2fabb5bc20 Add support for (register) command in spec tests and enable importing mutable globals.
Enable the part of the simd spec tests that now pass.
2019-08-02 14:18:07 -07:00
Syrus Akbary
17b5082c9b
Merge pull request #621 from wasmerio/feature/add-deny-dead_code-lint
Add deny dead_code lint and fix one error
2019-08-02 13:36:53 -07:00
Brandon Fish
b358605791 One CamelCase style cleanup and allow dead code warning 2019-08-02 14:14:59 -06:00
Brandon Fish
e2e096117a Allow dead_code for existing arch specific methods 2019-08-02 14:07:10 -06:00
bors[bot]
9489af4207 Merge #616
616: runtime-c-api: create the import object separately from instance instantiation  r=bjfish a=YaronWittenstein

Creating an `import object` separately from the `wasmer` instance, let's us build the import object incrementally and support the use-case of having import functions (a.k.a `vmcalls`) implemented in 2 programming languages (Rust and Golang for example) and consumed by the same `wasmer` instance.

Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-08-02 20:03:56 +00:00
Yaron Wittenstein
2a5aaee147 Merge branch 'c-api-import_object_t' of github.com:spacemeshos/wasmer into c-api-import_object_t 2019-08-02 23:01:10 +03:00
Yaron Wittenstein
c67df1c954 Merge branch 'master' into c-api-import_object_t 2019-08-02 22:54:54 +03:00
Yaron Wittenstein
eed3b28eab comment cleanup 2019-08-02 22:54:00 +03:00
Brandon Fish
80e155c1fc
Merge branch 'master' into c-api-import_object_t 2019-08-02 13:51:25 -06:00
Brandon Fish
21ea2465c0 Catch panicking tests 2019-08-02 11:36:38 -06:00
Brandon Fish
2f70a199e4 Add deny dead_code lint and fix one error 2019-08-01 20:46:35 -06:00
bors[bot]
315c72e0b8 Merge #620
620: clang-format the C++, also replace one 'throw()' with 'noexcept'. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-08-02 00:41:20 +00:00
Nick Lewycky
83aa9c67c7 Replace throw() with noexcept. Unlike throw(), noexcept indicates that the function does not throw.
Before C++17, throw() was equivalent to wrapping the function in a try {} catch
{ std::unexpected(); }. In C++17 throw() was made equivalent to noexcept and
in C++20 throw() was removed.
2019-08-01 17:13:23 -07:00
Nick Lewycky
ac49e57c2d Run clang-format-8 over the C++ code. No functionality change. 2019-08-01 17:12:46 -07:00
bors[bot]
a224d53c93 Merge #619
619: Fix typos. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-08-01 23:45:38 +00:00
Nick Lewycky
5fed2cef03 Fix typos. 2019-08-01 16:24:40 -07:00
bors[bot]
1138a048d8 Merge #618
618: Implement InternalEvent::Breakpoint in the llvm backend. r=nlewycky a=nlewycky

Enable now-working metering unit tests when run with the llvm backend.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-08-01 20:31:27 +00:00
nlewycky
bebc3eefe4
Merge branch 'master' into features/llvm-metering 2019-08-01 13:01:10 -07:00
Nick Lewycky
536f9813dc Implement InternalEvent::Breakpoint in the llvm backend.
Enable now-working metering unit tests when run with the llvm backend.
2019-08-01 12:44:25 -07:00
Yaron Wittenstein
18c7f96188 Merge branch 'master' into c-api-import_object_t 2019-08-01 22:27:41 +03:00
Syrus Akbary
a9e3ebaa4a
Merge pull request #615 from penberg/clif-backend
clif-backend: Eliminate FunctionEnvironment construction in feed_event()
2019-08-01 12:22:25 -07:00
Brandon Fish
dfef2b6899
Merge branch 'master' into clif-backend 2019-08-01 11:59:02 -06:00
Yaron Wittenstein
f64eee894e [FIX] test-context.c imports contains now the expected mul import too 2019-08-01 19:31:33 +03:00
losfair
9ed5094f86 Resolve semantics for more values. 2019-08-01 23:28:39 +08:00
Yaron Wittenstein
3f4ffb0e2d Merge branch 'develop' into c-api-import_object_t 2019-08-01 18:15:21 +03:00
Pekka Enberg
869ac21f7b clif-backend: Eliminate FunctionEnvironment construction in feed_event()
The feed_event() function is called for every wasm binary instruction.
Let's optimize it by storing FunctionEnvironment object in
CraneliftFunctionCodeGenerator, rather than constructing it for every
feed_event() invocation.

This change reduces the time to run "ngix compile" benchmark by 68%:

Before:

  nginx compile           time:   [1.4152 s 1.4186 s 1.4222 s]
  Found 1 outliers among 10 measurements (10.00%)
    1 (10.00%) high mild

After:

  nginx compile           time:   [447.76 ms 448.32 ms 448.80 ms]
                          change: [-68.542% -68.440% -68.352%] (p = 0.00 < 0.05)
                          Performance has improved.

I assume some of the clone() calls are very expensive (Vec::clone(),
likely). I did see libc malloc()/free() high up in "perf top" profiles,
which are eliminted by this change.

I also looked into eliminating FunctionBuilder construction from
feed_event(). That turns out to be painful on lifetime rules because it
borrows bunch of other objects, so I am leaving it for someone who knows
the code better than I do.
2019-08-01 18:06:40 +03:00
bors[bot]
bd3be45fcd Merge #602
602: C api extract instance context from instance r=bjfish a=YaronWittenstein

Here is an example of usage:
c9a9d56bd0/crates/svm-wasmer-c-api/examples/counter.c (L132)



Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
2019-08-01 14:27:48 +00:00
Yaron Wittenstein
524585942a deleting test-context binary 2019-08-01 17:24:51 +03:00
Yaron Wittenstein
09d704d053 Merge branch 'master' into c-api-extract-instance_context-from-instance 2019-08-01 14:08:47 +03:00
Yaron Wittenstein
f73180f45e wasmer-c-api:
* adding `wasmer_import_object_new` and `wasmer_import_object_extend`
* adding test file `test-module-import-instantiate.c`
2019-08-01 14:06:25 +03:00
bors[bot]
93032c7360 Merge #609
609: Update dependencies r=syrusakbary a=syrusakbary

This PR does:
* Update dependencies (to explicitly use only one version of a package, in all the places we use it)
* Remove explicit dependency on `hashbrown` since it's already adopted as the default algorithm for `HashMap`
* Small fixes on code to use latest versions

Co-authored-by: Syrus <me@syrusakbary.com>
2019-08-01 08:30:08 +00:00
Syrus
70a767e204 Improved exported memory tests 2019-08-01 01:28:11 -07:00
Syrus
2c6fbcba1f Improved runtime_c_api_tests 2019-08-01 01:27:36 -07:00
Syrus
052ad1381d Use ordered IndexMap for exports in runtime-core 2019-08-01 01:27:21 -07:00
Yaron Wittenstein
ab76755ade runtime-c-api:
* import.rs - adding `import_object_t` and `wasmer_import_object_destroy`
* instance.rs - adding `wasmer_module_import_instantiate`
2019-08-01 10:48:03 +03:00
Mark McCaskey
a12d0ada1a add wasi::fd_pread test 2019-08-01 16:38:34 +09:00
Syrus
676bccff3c Tryin gto make c_api_tests verbose mitigates the flaky error
Each time `make capi` is run, there is a flaky error:

```
Running target/release/deps/runtime_c_api_tests-3df0f74fcea1252d

running 1 test
test test_c_api ... FAILED

failures:

---- test_c_api stdout ----
Running command: `cmake` arg: Some(".")
output:
status: 0
stdout:
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/syrusakbary/Development/wasmer/lib/runtime-c-api/tests

stderr:

Running command: `make` arg: Some("-Wdev -Werror=dev")
output:
status: 0
stdout:
[  7%] Built target test-tables
[ 15%] Built target test-module-exports
[ 23%] Built target test-module-imports
[ 30%] Built target test-globals
[ 38%] Built target test-imports
[ 46%] Built target test-module
[ 53%] Built target test-module-serialize
[ 61%] Built target test-memory
[ 69%] Built target test-validate
[ 76%] Built target test-import-function
[ 84%] Built target test-instantiate
[ 92%] Built target test-exports
[100%] Built target test-exported-memory

stderr:

Running command: `make` arg: Some("test")
output:
status: 2
stdout:
Running tests...
Test project /Users/syrusakbary/Development/wasmer/lib/runtime-c-api/tests
      Start  1: test-exported-memory
 1/13 Test  #1: test-exported-memory .............Child aborted***Exception:   0.00 sec
      Start  2: test-exports
 2/13 Test  #2: test-exports .....................   Passed    0.01 sec
      Start  3: test-globals
 3/13 Test  #3: test-globals .....................   Passed    0.00 sec
      Start  4: test-import-function
 4/13 Test  #4: test-import-function .............   Passed    0.01 sec
      Start  5: test-imports
 5/13 Test  #5: test-imports .....................   Passed    0.01 sec
      Start  6: test-instantiate
 6/13 Test  #6: test-instantiate .................   Passed    0.01 sec
      Start  7: test-memory
 7/13 Test  #7: test-memory ......................   Passed    0.00 sec
      Start  8: test-module
 8/13 Test  #8: test-module ......................   Passed    0.01 sec
      Start  9: test-module-exports
 9/13 Test  #9: test-module-exports ..............   Passed    0.01 sec
      Start 10: test-module-imports
10/13 Test #10: test-module-imports ..............   Passed    0.01 sec
      Start 11: test-module-serialize
11/13 Test #11: test-module-serialize ............   Passed    0.01 sec
      Start 12: test-tables
12/13 Test #12: test-tables ......................   Passed    0.00 sec
      Start 13: test-validate
13/13 Test #13: test-validate ....................   Passed    0.00 sec

92% tests passed, 1 tests failed out of 13

Total Test time (real) =   0.08 sec

The following tests FAILED:
	  1 - test-exported-memory (Child aborted)

stderr:
Errors while running CTest
make[1]: *** [test] Error 8

thread 'test_c_api' panicked at 'Command failed with exit status: ExitStatus(ExitStatus(512))', lib/runtime-c-api/tests/runtime_c_api_tests.rs:43:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
```
2019-08-01 00:22:52 -07:00
Syrus
0dfa1f68a8 Formatted code 2019-07-31 23:51:12 -07:00
Syrus
7d89f9cc9a Updated changelog 2019-07-31 23:46:59 -07:00
Syrus
ebce7d0371 Updated dependencies 2019-07-31 23:42:54 -07:00
Syrus
a6461c3b14 Removed explicit hashbrown dependency 2019-07-31 23:18:38 -07:00
Syrus
6245daaa84 Update dependencies to latest versions 2019-07-31 23:04:03 -07:00
Mark McCaskey
d24c4a9c1a Merge branch 'feature/more-wasi-syscalls' of github.com:wasmerio/wasmer into feature/more-wasi-syscalls 2019-08-01 14:58:59 +09:00
Mark McCaskey
e6f188286b Implement wasi::fd_pread 2019-08-01 14:58:17 +09:00
Yaron Wittenstein
3a84288fd9 Merge branch 'master' into c-api-extract-instance_context-from-instance 2019-08-01 08:54:52 +03:00
Yaron Wittenstein
dd91a8208a changes after PR review https://github.com/wasmerio/wasmer/pull/602#pullrequestreview-269368270 2019-08-01 08:48:20 +03:00
Mark McCaskey
61d72a179b implement updating times in wasi::fd_filestat_set_times 2019-08-01 14:06:28 +09:00
Mark McCaskey
bca1ffc8d6
Merge branch 'master' into feature/more-wasi-syscalls 2019-07-31 21:41:19 -07:00
Mark McCaskey
a824d8d4d8 Implement wasi::{fd_allocation, fd_filestat_set_size} 2019-08-01 13:34:42 +09:00
bors[bot]
2b6e58962b Merge #606
606: Cleanup Wasmer r=syrusakbary a=syrusakbary

This PR moves a few things around trying to make Wasmer more compelling to use:
* Two less directories on the root (`fuzz` is moved to the `lib/` folder, `media` is moved to `src/installer` folder)
* Improved README
* Moved `ARCHITECTURE.md` into the `docs` folder.

Co-authored-by: Syrus <me@syrusakbary.com>
2019-08-01 04:25:30 +00:00
Syrus
a83b6eccfa Fixed middleware linting 2019-07-31 21:24:46 -07:00
Syrus
5e7a20ef94 Improved metering codebase 2019-07-31 21:20:39 -07:00
Syrus
9efaaab0bf Merge branch 'master' into feature/cleanup 2019-07-31 21:11:54 -07:00
Syrus
6433a778a1 Improved README. Simplified integration tests command 2019-07-31 21:11:29 -07:00
Syrus
0d428d6c99 Moved fuzz dir back to root 2019-07-31 21:02:20 -07:00
bors[bot]
33166eaf66 Merge #607
607: Feature/update wasmparser and clif fork deps r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-08-01 02:28:35 +00:00
bors[bot]
3e27b0ca79 Merge #590
590: wasmer-c-api: error visibility changes  r=bjfish a=YaronWittenstein

I've changed the visibility to `public` in order to support code like here:
https://github.com/spacemeshos/svm/blob/52f04b52cc/crates/svm-wasmer-c-api/src/macros.rs#L150

@syrusakbary @bjfish @Hywan 

Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-08-01 01:59:12 +00:00
Brandon Fish
a832a4c787
Merge branch 'master' into wasmer-c-api-error-visibility 2019-07-31 19:58:23 -06:00
bors[bot]
f8fa06e5ed Merge #589
589: wasmer-c-api-changes: making `wasmer_byte_array` fields `public` r=bjfish a=YaronWittenstein

I've added this PR since I've tests that need access to `wasmer_byte_array` field.
Here is an example:
52f04b52cc/crates/svm-wasmer-c-api/tests/c_api.rs (L96)

```rust
unsafe fn cast_wasmer_byte_array_to_string(wasmer_bytes: &wasmer_byte_array) -> String {
    let slice: &[u8] =
        std::slice::from_raw_parts(wasmer_bytes.bytes, wasmer_bytes.bytes_len as usize);

    if let Ok(s) = std::str::from_utf8(slice) {
        s.to_string()
    } else {
        panic!("error converting `wasmer_byte_array` to string")
    }
}
```

@syrusakbary @bjfish @Hywan 

Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-08-01 01:25:02 +00:00
Syrus
90d5dc6d62 Updated C# integration link 2019-07-31 18:19:42 -07:00
Syrus
6b66c024f0 Improved C/C++ icon 2019-07-31 18:18:37 -07:00
Brandon Fish
d9e1609616
Merge branch 'master' into wasmer-c-api-changes 2019-07-31 19:15:39 -06:00
Mark McCaskey
20e424c11e update wasmparser and clif-fork dependencies 2019-08-01 10:13:25 +09:00
Syrus
a7db7f11f4 Improved README 2019-07-31 18:09:23 -07:00
Syrus
11e22f0536 Move architecture into docs 2019-07-31 18:05:15 -07:00
Syrus
9bac6d8818 Move fuzzer inside lib 2019-07-31 18:05:04 -07:00
bors[bot]
d117a46647 Merge #604
604: Fix metering benchmark with LLVM. r=syrusakbary a=nlewycky

Makes "make bench-llvm" pass.

Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-07-31 23:58:26 +00:00
Syrus
89523e0186 Move media into installer dir 2019-07-31 14:48:48 -07:00
Syrus
253b2198fb Improved Wasmer Installer in Windows 2019-07-31 14:09:01 -07:00
Syrus Akbary
5bf6a6b0bd
Trying to fix appveyor 2019-07-31 13:53:27 -07:00
Syrus Akbary
3100cef798 Updated Appveyor to publish .dll and a build with LLVM installed 2019-07-31 13:34:26 -07:00
nlewycky
54b5c642dc
Merge branch 'master' into features/llvm-metering 2019-07-31 13:13:07 -07:00
Nick Lewycky
931d556de1 Add support for internal fields. 2019-07-31 13:10:51 -07:00
Nick Lewycky
0e1fedceef Fix build of metering_benchmark with the llvm backend. 2019-07-31 13:04:40 -07:00
bors[bot]
196c916ccf Merge #603
603: Prepare for release of 0.6.0 r=syrusakbary a=syrusakbary

Prepare for release of 0.6.0

Co-authored-by: Syrus <me@syrusakbary.com>
2019-07-31 17:44:42 +00:00
Syrus
fdda670b58 Updated Changelog wrapping 0.6.0 version 2019-07-31 10:35:45 -07:00
Syrus
d95ef83331 Updated wapm-cli to 0.3.7 2019-07-31 10:34:53 -07:00
Syrus
fccf68c734 Updated version to 0.6.0 2019-07-31 10:28:45 -07:00
Yaron Wittenstein
0fb7eb1e19 tests/test-context.c - destroying resources in the end 2019-07-31 14:48:22 +03:00
Yaron Wittenstein
f6b5f1ba1b wasmer-c-api: adding asserts to tests/test-context.c 2019-07-31 14:32:38 +03:00
Yaron Wittenstein
351977690b adding a document for wasmer_instance_context_get 2019-07-31 14:15:16 +03:00
Yaron Wittenstein
847dd6f65e c-api: adding wasmer_instance_context_get (instance.rs) 2019-07-31 14:12:25 +03:00
bors[bot]
b5e20e508d Merge #601
601: simplify example and make public get_wasi_state unsafe r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-07-31 07:17:47 +00:00
Mark McCaskey
2991ec36a4 uncomment install rust in appveyor windows ci 2019-07-31 16:16:19 +09:00
Mark McCaskey
a72610a546 remove unneeded call to main in plugin example 2019-07-31 16:01:44 +09:00
Mark McCaskey
7760d5a4a2 simplify example and make public get_wasi_state unsafe 2019-07-31 15:59:08 +09:00
bors[bot]
7d1ed7a056 Merge #600
600: Remove all uses of mem::uninitialized for Rust 1.38 r=syrusakbary a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-07-31 05:43:55 +00:00
Syrus Akbary
6a4091e78e
Merge branch 'master' into feature/no-mem-uninit 2019-07-30 22:28:56 -07:00
Mark McCaskey
0ab8a0de09 Remove all uses of mem::uninitialized for Rust 1.38 2019-07-31 13:21:20 +09:00
bors[bot]
ae05d6f808 Merge #595
595: Add useful functions for external use of WASI filesystem r=MarkMcCaskey a=MarkMcCaskey

part of #583 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-07-31 03:56:48 +00:00
Mark McCaskey
b407633366 add logging to plugin example, improve swap, and add some consts 2019-07-31 12:51:55 +09:00
Mark McCaskey
c099ed54e9
Merge branch 'master' into feature/public-api-wasi-fs 2019-07-30 19:26:19 -07:00
Mark McCaskey
620a521690 clean up wasi fs public api changes 2019-07-31 09:58:39 +09:00
Syrus Akbary
99ecfaa503
Merge pull request #598 from wasmerio/features/llvm-windows
LLVM backend enabled for Windows
2019-07-30 17:38:50 -07:00
Syrus Akbary
0256a6eb88
Merge branch 'master' into features/llvm-windows 2019-07-30 17:38:36 -07:00
bors[bot]
7106a4f3cc Merge #599
599: Fix llvm backend failures in fat spec tests and simd_binaryen spec test. r=syrusakbary a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-07-31 00:13:23 +00:00
Syrus
020b94836c Added more examples into the repo 2019-07-30 17:02:16 -07:00
bors[bot]
f778330fed Merge #597
597: fix metering benchmark r=MarkMcCaskey a=MarkMcCaskey

resolves #596 

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-07-30 23:55:46 +00:00
Nick Lewycky
ca4920f421 Add changelog entry. 2019-07-30 16:55:24 -07:00
Mark McCaskey
229254fd04 Update bench part of readme, add benchmark compilation to CI 2019-07-31 08:53:33 +09:00
Syrus
1d0ac80fa8 Improved Appveyor build times 2019-07-30 15:56:42 -07:00
Syrus
97c6956d98 Added llvm in windows support to Changelog 2019-07-30 15:56:25 -07:00
nlewycky
9b815cb518
Merge branch 'master' into features/llvm 2019-07-30 15:50:55 -07:00
Nick Lewycky
c42f47da34 Adjust simd_binaryen.wast until it works with LLVM except for known issues.
This doesn't yet work as of this commit, we'll need to pick up a new version of wasmparser.rs too.
2019-07-30 15:47:00 -07:00
Syrus
22f8b3f3dc Improved LLVM compilation for Unix 2019-07-30 15:32:21 -07:00
Syrus
89178732cc Fixed unix errors 2019-07-30 15:23:03 -07:00
Syrus
180e4766fe Merge branch 'master' into features/llvm-windows 2019-07-30 15:09:21 -07:00
Nick Lewycky
bdb1c4c44e Fix inkwell assertion due to treating vector as float. Fix llvm backend fatal error due to missing support for fminimum/fmaximum. 2019-07-30 14:59:04 -07:00
Syrus Akbary
12f8f3d085 First working version of LLVM in Windows 2019-07-30 14:47:53 -07:00
Nick Lewycky
3e7545a278 Fix the Trunc[SU] operations, makes conversions.wast pass. 2019-07-30 12:42:25 -07:00
Syrus Akbary
c21a91e2fe
Updated CHANGELOG with missing singlepass changes 2019-07-30 12:40:39 -07:00
losfair
4f56703657 Support runtime tier switching. 2019-07-30 22:25:58 +08:00
losfair
283676af2b Add .clone() to fix singlepass. 2019-07-30 22:25:37 +08:00
losfair
0a7f95ee06 Allow a range of instruction offsets to be used in ip lookup. 2019-07-30 22:25:15 +08:00
Mark McCaskey
741fffedb0 fix metering benchmark 2019-07-30 15:59:21 +09:00
Mark McCaskey
fba09bef1a Add useful functions for external use of WASI filesystem 2019-07-30 14:53:42 +09:00
bors[bot]
e0e92dbb79 Merge #594
594: Improvement cache in Windows r=syrusakbary a=syrusakbary

Caching was disabled on Windows, but can be re-enabled easily by improving the folder cache naming.

Reason why caching was disabled on Windows: We use a very long string (64 chars) for the wasmer version (hash). But we can use the version directly (no need to hashing)

Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-07-30 01:36:44 +00:00
Syrus Akbary
714bf6ab6b Fixed imports 2019-07-29 18:35:59 -07:00
Syrus Akbary
a056da1c15 Fixed lint 2019-07-29 18:32:49 -07:00
Syrus Akbary
6e3fda247e Fix usage of Wasmer Version 2019-07-29 18:31:57 -07:00
Syrus Akbary
98b20d9240 Fixed Caching in Windows lint and improved code 2019-07-29 18:29:20 -07:00
Syrus Akbary
7bceb08b64 Added tests 2019-07-29 18:25:12 -07:00
Syrus Akbary
c69bbd3334 Fixed lint 2019-07-29 17:54:27 -07:00
Syrus Akbary
13901cc665 Improvement cache in Windows 2019-07-29 17:33:50 -07:00
bors[bot]
296f8a1bab Merge #587
587: Use --enable-simd to control whether SIMD is enabled in the wasmparser. r=nlewycky a=nlewycky

Before this change, 'wasmer run --backend=llvm some-simd.wasm' would run without complaint.

Also, note that the flag is not part of the cache key, so after any successful run, we can run it again without passing the flag.

Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-07-29 23:05:41 +00:00
Nick Lewycky
e47f8b8a1e Merge branch 'features/flag' of github.com:wasmerio/wasmer into features/flag 2019-07-29 15:48:09 -07:00
Nick Lewycky
5f0ce6ef2f Enable SIMD when parsing the spec tests. 2019-07-29 15:47:38 -07:00
nlewycky
a5536bb376
Merge branch 'master' into features/flag 2019-07-29 13:59:23 -07:00
bors[bot]
3af0cba6a9 Merge #592
592: Add instructions on how to seed the fuzzer corpus from the spec tests. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-07-29 19:34:01 +00:00
Nick Lewycky
7a1ddc0b5a Rename validate to validate_with_features. 2019-07-29 12:11:23 -07:00
Nick Lewycky
86316c474a Use --enable-simd to control whether SIMD is enabled in the wasmparser.
Before this change, 'wasmer run --backend=llvm some-simd.wasm' would run without complaint.

Also, note that the flag is not part of the cache key, so after any successful run, we can run it again without passing the flag.
2019-07-29 12:11:23 -07:00
Nick Lewycky
e076568168 Add instructions on how to seed the fuzzer corpus from the spec tests. 2019-07-29 11:48:52 -07:00
Syrus Akbary
514eb70194
Merge pull request #593 from penberg/docker-build
Add a Docker sandbox for building Wasmer
2019-07-29 11:45:33 -07:00
Pekka Enberg
b9e1607043 Add a Docker sandbox for building Wasmer
Building Wasmer is bit of a pain, because it requires Rust nightly, and
bunch of OS specific packages.

To make building easier, this adds a "build" script at the top-level
directory, which can be used to build Wasmer within a Docker sandbox
that has all the necessary dependencies installed. The build environment
is based on latest Ubuntu 19.04.

You first need to build a Docker image of the sandbox:

    docker build --file Dockerfile.build --tag wasmer-build .

Then, to build Wasmer, run:

    ./build make

To test Wasmer, run:

    ./build make test

and so on.

You can also drop into a shell within the Docker with:

    ./build

The "build" script bind mounts current directory as "/wasmer" in the
Docker container, which allows inspecting the build contents like you
had built them on your local machine.

For future improvements, we should consider:

  - Consolidation with existing Dockerfile (that is used for Circle CI)

  - Publishing the build sandbox image on Docker Hub so that people
    don't have to build it themselves

  - Moving dependency installation to separate script, which can be
    reused outside of the Docker sandbox.

The work has been inspired by "devtool" in the Firecracker project:

  https://github.com/firecracker-microvm/firecracker/blob/master/tools/devtool

and "dbuild" in the Scylla project:

  https://github.com/scylladb/scylla/blob/master/tools/toolchain/dbuild
2019-07-29 21:18:04 +03:00
Yaron Wittenstein
784e65d587 making wasmer_byte_array fields public 2019-07-29 17:24:43 +03:00
Yaron Wittenstein
8408260edd wasmer-c-api: adding #[derive(Debug)] for wasmer_result_t (so that we can do assert_eq!) 2019-07-29 17:10:17 +03:00
Yaron Wittenstein
a8d2469689 wasmer-c-api: returning back pub(crate) fn inner for export.rs 2019-07-29 13:44:56 +03:00
Yaron Wittenstein
10fc660aad wasmer_byte_array visibility revert (see PR: "wasmer-c-api-changes: making wasmer_byte_array fields public #589") 2019-07-29 13:41:28 +03:00
Nick Lewycky
11f66d287b Improve NaN handling by canonicalizing NaNs before most operations.
Not handled here is @llvm.minnum and @llvm.maxnum which should be replaced with
@llvm.minimum and @llvm.maximum, but using those currently leads to LLVM backend
fatal errors.
2019-07-28 22:53:48 -07:00
Nick Lewycky
2f021f0e2a LLVM srem is undefined in cases where i32.rem_s and i64.rem_s are defined. 2019-07-28 22:53:48 -07:00
Brandon Fish
8098b7e44d Merge branch 'master' into feature/spectests-runner 2019-07-26 22:15:42 -05:00
bors[bot]
f483c89da7 Merge #586
586: Fixes case with empty module, handle case with no signatures r=bjfish a=bjfish

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:373:21

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-07-26 23:20:42 +00:00
Brandon Fish
d7c11bcf5f Fixes case with empty module, handle case with no signatures 2019-07-26 17:58:57 -05:00
bors[bot]
53c343bc6f Merge #579
579: fix caching for other backends, improve default compiler code r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-07-26 22:21:00 +00:00
bors[bot]
e89af86cb7 Merge #585
585: add rust example to CI r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-07-26 22:01:59 +00:00
Mark McCaskey
ce64f7ad0f Add wasm plugin rust example test to bors.toml 2019-07-26 15:00:52 -07:00
bors[bot]
cf0a10124d Merge #584
584: Add --enable-simd flag to wasmer run and wasmer validate. r=nlewycky a=nlewycky



Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
2019-07-26 19:49:22 +00:00
Mark McCaskey
a666fb3e4a Add Rust plugin example example to CI 2019-07-26 11:56:18 -07:00
losfair
efb5277d1d Stack parsing now works with LLVM. 2019-07-27 02:50:49 +08:00
Nick Lewycky
6cddc25ddd Derive Debug on these small structs. 2019-07-26 11:12:13 -07:00
Nick Lewycky
8f417f3d59 Add --enable-simd flag to wasmer run and wasmer validate. 2019-07-26 00:34:02 -07:00
Brandon Fish
459837f412 Initial commit of wast spectest runner 2019-07-25 22:31:19 -05:00
Syrus Akbary
ab5f28851a
Merge pull request #578 from vavrusa/master
llvm-backend: export FunctionCodeGenerator and ModuleCodeGenerator
2019-07-25 17:08:50 -07:00
Mark McCaskey
2cfa97357f
Merge pull request #582 from wasmerio/fix/clif-semver-nightmare
fix semver issue with clif 0.31 + new version of wasmparser
2019-07-25 11:11:10 -07:00
Mark McCaskey
d1a5cc9139 fix semver issue with clif 0.31 + new version of wasmparser 2019-07-25 10:38:20 -07:00
Yaron Wittenstein
f04d552361 wasmer-c-api:
* error.rs - changing `update_last_error` visibility to `pub`.
* error.rs - changing `CApiError` `msg` field visibility to `pub`.
2019-07-25 15:46:57 +03:00
Yaron Wittenstein
015616b541 export.rs - changing FuncPointer inner visibility to pub 2019-07-25 14:59:59 +03:00
Yaron Wittenstein
6cc31d3b49 lib.rs - making wasmer_byte_array fields public 2019-07-25 11:42:47 +03:00
Syrus Akbary
4ada51957d
Merge branch 'master' into feature/caching-fix-and-better-default-compiler 2019-07-24 18:58:45 -07:00
Syrus Akbary
c767b265d7
Improved CHANGELOG
Added dates to different versions and updated missing PRs
2019-07-24 18:50:26 -07:00
Marek Vavruša
659f088c4f llvm-backend: export FunctionCodeGenerator and ModuleCodeGenerator
This is in line with the singlepass-backend to be able to use LLVM MCG with
a StreamingCompiler.
2019-07-24 18:46:35 -07:00
Syrus Akbary
947de78c3e
Added Twitter badge 2019-07-24 18:35:57 -07:00
Syrus Akbary
ec65abb289
Merge pull request #580 from wasmerio/feature/various-improvements
Various improvements
2019-07-24 18:18:26 -07:00
Syrus
680e4b8577 Improved README installation instructions 2019-07-24 18:15:18 -07:00
Syrus
76daa7b3fd Improved Wasmer Backends documentation 2019-07-24 18:06:59 -07:00
Mark McCaskey
99b75c4dea update changelog 2019-07-24 17:46:32 -07:00
Syrus
0191de4e50 Improved WAPM mentions 2019-07-24 17:44:06 -07:00
Syrus
0f5131303d Simplified examples 2019-07-24 17:43:17 -07:00
Syrus
3bca3ee983 Make dependency installation easier to read 2019-07-24 17:42:03 -07:00
Syrus
c89848f984 Moved scripts to scripts folder 2019-07-24 17:36:08 -07:00
Syrus
ac859ac531 Added CODEOWNERS file 2019-07-24 17:32:04 -07:00
Mark McCaskey
a3089a4501 fix caching for other backends, improve default compiler code 2019-07-24 17:31:59 -07:00
Syrus Akbary
e877e6d6df
Merge pull request #542 from wasmerio/simd
Initial commit of SIMD support in wasmer.
2019-07-24 15:35:38 -07:00
nlewycky
624f3459ab
Merge branch 'master' into simd 2019-07-24 14:44:52 -07:00
Syrus Akbary
6a810bc220
Merge pull request #561 from YaronWittenstein/ctx-drop-finalizer
* vm.rs - calling `Ctx` `data_finalizer` upon destruction
2019-07-24 14:36:41 -07:00
nlewycky
361a027ec9
Only enable SIMD when using the LLVM backend.
Co-Authored-By: Syrus Akbary <me@syrusakbary.com>
2019-07-24 14:10:09 -07:00
nlewycky
f6240721ea
Merge branch 'master' into simd 2019-07-24 14:08:24 -07:00
Nick Lewycky
4b1bc24a2b Update cranelift to the version crates.io.
This is needed in order for the resulting wasmer to be releasable.
2019-07-24 14:06:19 -07:00
Mark McCaskey
610c5bfe1f
Merge branch 'master' into ctx-drop-finalizer 2019-07-24 13:52:57 -07:00
Mark McCaskey
05be42300e
Merge pull request #576 from wasmerio/fix/dropping-bad-data
fix Drop of uninit Ctx; use MaybeUninit
2019-07-24 13:51:30 -07:00
Mark McCaskey
1574a33ee8 Merge branch 'fix/dropping-bad-data' of github.com:wasmerio/wasmer into fix/dropping-bad-data 2019-07-24 13:50:24 -07:00
Mark McCaskey
a534ecb0bb increase bors timeout threshold 2019-07-24 13:49:21 -07:00
Nick Lewycky
5c1b7d2e5b Adds the SIMD tests from binaryren, updated to work with wasmer.
This test is too large and therefore does not run by default, see
`fn is_fat_test` in spectests.rs.
2019-07-24 13:48:38 -07:00
Mark McCaskey
ce9bea402c
Merge branch 'master' into fix/dropping-bad-data 2019-07-24 13:32:42 -07:00
losfair
cc4f0e31a6 TwoHalves & trying to get cowsay to compile again 2019-07-25 02:44:28 +08:00
Mark McCaskey
3c952f307e fix Drop of uninit Ctx; use MaybeUninit 2019-07-24 11:29:16 -07:00
Nick Lewycky
f763de94ab Update to wabt 0.9.0. 2019-07-24 10:03:08 -07:00
Nick Lewycky
0ed104b543 Remove incorrect comment -- wasmer does support mutable globals.
The reason this test needed to be disabled is correctly documented in the comment above.
2019-07-23 17:13:02 -07:00
Nick Lewycky
16fe3ce0af Merge branch 'master' into simd 2019-07-23 13:51:15 -07:00
Nick Lewycky
fe2bd6ad6c Add missing names to LLVM instructions. 2019-07-23 13:19:27 -07:00
bors[bot]
dbfd1c614d Merge #575
575: Prepare for release of 0.5.7 r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-07-23 19:57:58 +00:00
Mark McCaskey
24a4fedade update wapm build for circleci 2019-07-23 11:35:59 -07:00
Mark McCaskey
ad7e3b52d3 Prepare for release of 0.5.7 2019-07-23 11:20:59 -07:00
Syrus
5ef19b76a0 Updated README 2019-07-22 17:50:16 -07:00
Syrus
fadb975114 Fixed macos check 2019-07-22 17:50:16 -07:00
Nick Lewycky
4b77fae991 Temporarily disable kernel-loader by adding a panic! to kwasmd.
I expect that the V128 changes have broken kernel-loader because I haven't taken care to ensure that the interface was updated the same way on both sides.
2019-07-22 16:49:21 -07:00
Nick Lewycky
d6546f7ab6 Write out full 128 bit return value. 2019-07-22 16:47:09 -07:00
Syrus
a301c7abd5 Updated LLVM to 8.0 2019-07-22 14:04:17 -07:00
Nick Lewycky
18307bb79c Improve panic/unreachable/unimplemented usage. Refactor a little. 2019-07-22 12:15:56 -07:00
losfair
0133b92bec Populating LLVM stack maps into MSM/FSM. 2019-07-23 02:55:43 +08:00
Nick Lewycky
4535274cf3 Update the loader interface for 128 bit types. 2019-07-22 11:23:41 -07:00
Nick Lewycky
f8e8b1cdea Update to latest wasmer clif branch. 2019-07-22 10:59:27 -07:00
Yaron Wittenstein
c3ced14e46 Merge branch 'master' into ctx-drop-finalizer 2019-07-22 14:13:11 +03:00
Nick Lewycky
775c120b38 Update to newer wasmerio/wabt-rs. 2019-07-19 15:48:50 -07:00
Nick Lewycky
fc935710c7 Merge branch 'master' of github.com:wasmerio/wasmer into simd 2019-07-19 15:37:36 -07:00
Nick Lewycky
cd25356858 Fix shuffle and enable tests. Add support for new load_splat instructions.
Updates to wasmparser 0.34.0 and picks up a newer wasmerio/wabt.
2019-07-19 15:19:58 -07:00
bors[bot]
b8ea3edec1 Merge #555
555: wasi filesystem rewrite + implementation of many syscalls r=MarkMcCaskey a=MarkMcCaskey

This lets the go compiler print its help text...

The rest of symlink code to follow...

This PR also does a major refactor of the file system code.  So we'll have to add more tests to be sure we didn't break anything

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-07-19 21:12:27 +00:00
Mark McCaskey
04b540ca72 add changelog entry 2019-07-19 13:52:22 -07:00
Mark McCaskey
f15e90f8f3
Merge branch 'master' into feature/wasi-readlink 2019-07-19 13:36:27 -07:00
Mark McCaskey
a0672b3fa2 updates from code review 2019-07-19 13:36:05 -07:00
Mark McCaskey
328ef4e66e use correct debug macro on Windows 2019-07-19 12:55:58 -07:00
Mark McCaskey
d74560e1d4 impl fd_close 2019-07-19 12:10:45 -07:00
Mark McCaskey
a8a0dbed91 improve abstraction impl rm syscalls, properly finish create_dir 2019-07-19 11:47:31 -07:00
Mark McCaskey
9910527b30 further improve sandbox, rework syscalls, add tests 2019-07-18 17:14:01 -07:00
Nick Lewycky
3e009c5971 Reformat. 2019-07-18 13:40:24 -07:00
Nick Lewycky
ea93b68165 Bump size of global up to 128 bits.
Fixes last spec test failure from the WAVM SIMD spec test.
2019-07-18 13:39:41 -07:00
Nick Lewycky
3be6a024aa Fix bugs in V128 support based on results from testing against simd spec test.
These is one test failure remaining with V128 global variables.

* Fix trunc_sat. We need both the largest float that can be converted to an int
  and the largest int, they are not the same number.
* Implement calling of functions that take V128 by passing in two i64's.
* Improve support for V128 in spectests. Parse binary modules with the same
  features as the outer spectest. Fix compilation error involving Result in
  emitted .rs file. Handle V128 in more cases when producing .rs file. Parse
  the wast script with SIMD enabled.
* Adjust the WAVM spectest so that it parses with WABT and mostly passes with
  wasmer. Wabt is particular about ints not having decimal places and floats
  having decimal places. Wasmer does not support mutable globals or shared
  memory. Tests of shuffles are disabled. Some assert_invalid tests that wabt
  won't even parse are disabled.
2019-07-18 12:52:59 -07:00
nlewycky
489f72b89a
Merge pull request #568 from wasmerio/nlewycky-patch-1
Fix typo in comment.
2019-07-18 12:33:50 -07:00
nlewycky
3f3bf38d94
Fix typo in comment.
"Then thou must count to three. Three shall be the number of the counting and the number of the counting shall be three. Four shalt thou not count, neither shalt thou count two, excepting that thou then proceedeth to three."
2019-07-18 11:24:25 -07:00
losfair
2e030c9c4a Parsing LLVM stackmaps. 2019-07-19 02:02:15 +08:00
Mark McCaskey
dc19bf32b9 fmt 2019-07-17 15:47:59 -07:00
Mark McCaskey
e7e1b8c7d3 get tests passing! (more tests and clean up required) 2019-07-17 15:32:47 -07:00
Mark McCaskey
65bc9a5203 massive fs rewrite; add virtual root, tests 2019-07-17 14:00:51 -07:00
losfair
a14a8e4c50 Emit stack map at critical points. 2019-07-18 02:43:04 +08:00
Ivan Enderlin
36098189b3 doc(runtime-c-api) Document and reorganize exports.rs.
This patch moves all structs at the beginning of the file, and
documents them.
2019-07-17 11:01:42 +02:00
Nick Lewycky
eeac6d5d2d Merge branch 'master' of github.com:wasmerio/wasmer into simd 2019-07-16 19:16:45 -07:00
Mark McCaskey
78702fc1a0 Merge remote-tracking branch 'origin/master' into feature/wasi-readlink 2019-07-16 13:50:56 -07:00
Mark McCaskey
cea7d5da7d add readlink test 2019-07-16 13:49:45 -07:00
bors[bot]
0ed08eb10b Merge #565
565: update to 0.5.6 r=syrusakbary a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-07-16 20:43:30 +00:00
Mark McCaskey
19f544e489 update to 0.5.6 2019-07-16 13:12:21 -07:00
Mark McCaskey
dd1ddea37b wip fs improvements 2019-07-15 17:37:11 -07:00
Syrus Akbary
cd0a248613
Merge pull request #563 from wasmerio/improve-wasi-tests
improve wasitest infra and fix fseek test
2019-07-15 13:41:12 -07:00
Mark McCaskey
b2abcb3f0e update changelog 2019-07-15 12:48:04 -07:00
Syrus Akbary
193665461b
Merge branch 'master' into improve-wasi-tests 2019-07-15 12:43:21 -07:00
Syrus Akbary
b8378959a2
Merge pull request #564 from wasmerio/nlewycky-patch-1
Fix typo in comment.
2019-07-15 11:31:13 -07:00
nlewycky
42780042ef
Fix typo in comment. 2019-07-15 10:55:26 -07:00
Mark McCaskey
affb9465d5 update rustfmt.toml to ignore and fmt 2019-07-15 10:43:30 -07:00
Mark McCaskey
53d7ecba2c improve wasitest infra and fix fseek test 2019-07-15 10:36:12 -07:00
Mark McCaskey
122963909f symlink code from last week 2019-07-15 09:59:07 -07:00
Yaron Wittenstein
ad10152982 * vm.rs - calling Ctx data_finalizer upon destruction 2019-07-15 15:14:09 +03:00
bors[bot]
8a471cc235 Merge #559
559: Initial commit of a fuzzer. Run with "cargo fuzz run simple_instantiate". r=nlewycky a=nlewycky

Used to discover issue #558.

We'll probably want to reconsider the default .gitignore of the artifacts and corpus directories. The fuzzer wastes a lot of time not having even a single exampel of a valid .wasm file to start with.

Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
Co-authored-by: nlewycky <nicholas@mxc.ca>
2019-07-14 02:52:26 +00:00
Nick Lewycky
46f3a9f5e4 Add a readme. 2019-07-13 18:41:06 -07:00
nlewycky
d482e4cd5e
Merge branch 'master' into features/fuzzer 2019-07-13 18:16:47 -07:00
Nick Lewycky
5c0ede0b42 Initial commit of a fuzzer. Run with "cargo fuzz run simple_instantiate".
Used to discover issue #558.

We'll probably want to reconsider the default .gitignore of the artifacts and corpus directories. The fuzzer wastes a lot of time not having even a single exampel of a valid .wasm file to start with.
2019-07-13 17:57:30 -07:00
bors[bot]
608bb272dc Merge #554
554: finish implementation of wasi::fd_seek, fix bug in filestat r=syrusakbary a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus <me@syrusakbary.com>
2019-07-13 23:03:10 +00:00
Syrus
2ce0e02cc8 Added changes in CHANGELOG 2019-07-13 16:01:29 -07:00
Syrus
24f1e99ead Fixed WASI tests 2019-07-13 16:00:18 -07:00
Syrus
b0ead8fc04 Merge branch 'master' into feature/complete-fd-seek 2019-07-13 15:40:51 -07:00
bors[bot]
13abdfee98 Merge #557
557: Update loader-kernel feature name, fix compilation track state r=syrusakbary a=bjfish

- feature name `loader:kernel` -> `loader-kernel` (no colons)
- add track state `false` to loader kernel default, @losfair let me know if this default is incorrect
- cargo fmt

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-07-13 09:35:27 +00:00
Brandon Fish
ed19fd2913 Update loader-kernel feature name, fix compilation track state, cargo fmt 2019-07-12 23:02:57 -05:00
Brandon Fish
09db8d6cdc
Merge pull request #556 from wasmerio/feature/add-make-check-to-build
Add make check to build to check features are in test
2019-07-12 22:54:56 -05:00
Brandon Fish
bf2494898d Add cargo to macos path for make check 2019-07-12 22:35:54 -05:00
Brandon Fish
6fdff3ecca Add make check to build to check features are in test 2019-07-12 22:18:09 -05:00
bors[bot]
844cf44a38 Merge #552
552: Allow disabling state tracking for faster startup. r=bjfish a=losfair

~10% compilation speedup when `--no-track-state` is enabled.

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-07-13 02:01:38 +00:00
Mark McCaskey
5119f07ea3 implement wasi::readlink 2019-07-12 15:58:28 -07:00
Mark McCaskey
a608f3aad0 fix wasi test template code 2019-07-12 15:17:10 -07:00
Mark McCaskey
cbac3ed92d finish implementation of wasi::fd_seek, fix bug in filestat 2019-07-12 15:10:16 -07:00
bors[bot]
bd2a082a78 Merge #550
550: Fix singlepass compilation error with `imul` instruction. r=losfair a=losfair



Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-07-12 16:39:32 +00:00
losfair
977fd1e25e Fix trap offset lookup. 2019-07-13 00:17:33 +08:00
losfair
450109e2bb Fix singlepass compilation error. 2019-07-13 00:17:21 +08:00
losfair
08cdc9a42f Allow disabling state tracking for faster startup. 2019-07-12 23:37:40 +08:00
losfair
f327feccef Merge remote-tracking branch 'origin/master' into fix/imul-relax 2019-07-12 23:37:01 +08:00
Syrus Akbary
08111b77bc
Update install.sh 2019-07-11 18:01:42 -07:00
bors[bot]
6f36cc00ee Merge #551
551: Try a new list of optimization passes. r=nlewycky a=nlewycky

A few notes:
a) the inliner doesn't help because all the calls are indirect and not even opt -O2 can figure out which functions they're actually calling.
b) aggressive instruction combining is not a super-set of the instruction combiner. Instcombine is made up of a large number (probably 10,000s) of patterns, and some particularly slow ones were taken out and moved to the aggressive instruction combiner. Aggressive instcombine *only* runs that handful of optimizations, which fired zero times on our example wasm files.
c) NewGVN is not ready for production, it has asserts that fire when building sqlite or cowsay. This is why sqlite didn't build with the llvm backend.
d) Scalar-replacement-of-aggregates (sroa) is a strict superset of promote-memory-to-registers (mem2reg), and you probably want sroa because it's usually faster. It also fires 10,000s more times than mem2reg on lua.wasm.
e) Aggressive-dead-code-elimination was only deleting as much regular dead-code-elimination, but is slower because it depends on a postdominator tree (PDT) analysis that. Other passes don't need PDT so we'll have to build it for just this one pass (as opposed to regular dominator-tree which is reused by many passes). I've replaced this with bit-tracking dead-code-elimination which deletes more code than dce/adce.

Co-authored-by: Nick Lewycky <nicholas@mxc.ca>
Co-authored-by: nlewycky <nicholas@mxc.ca>
2019-07-12 00:38:40 +00:00
nlewycky
278adf678a
Merge branch 'master' into nlewycky/llvm 2019-07-11 16:48:46 -07:00
Nick Lewycky
7fb88251d4 Simplify trap_if_not_representable_as_int.
Fix typo in function name. Use two fcmp instructions instead of unpacking the bits of the IEEE float and using integer arithmetic to determine details about its value.
2019-07-11 16:46:37 -07:00
Syrus Akbary
d59c5531fd
Update install.sh 2019-07-11 16:23:57 -07:00
Syrus Akbary
0583da0ae2
Use WASMER_DIR if present when INSTALL_DIRECTORY is not present
Fixed #549
2019-07-11 16:22:02 -07:00
bors[bot]
9e974c7ce3 Merge #548
548: Update to nix 0.14 r=syrusakbary a=repi

Instead of using a mix of nix 0.12 & 0.13 crates.

Co-authored-by: Johan Andersson <repi@repi.se>
2019-07-11 21:58:55 +00:00
Nick Lewycky
7045030532 Try a new list of optimization passes.
A few notes:
a) the inliner doesn't help because all the calls are indirect and not even opt -O2 can figure out which functions they're actually calling.
b) aggressive instruction combining is not a super-set of the instruction combiner. Instcombine is made up of a large number (probably 10,000s) of patterns, and some particularly slow ones were taken out and moved to the aggressive instruction combiner. Aggressive instcombine *only* runs that handful of optimizations, which fired zero times on our example wasm files.
c) NewGVN is not ready for production, it has asserts that fire when building sqlite or cowsay. This is why sqlite didn't build with the llvm backend.
d) Scalar-replacement-of-aggregates (sroa) is a strict superset of promote-memory-to-registers (mem2reg), and you probably want sroa because it's usually faster. It also fires 10,000s more times than mem2reg on lua.wasm.
e) Aggressive-dead-code-elimination was only deleting as much regular dead-code-elimination, but is slower because it depends on a postdominator tree (PDT) analysis that. Other passes don't need PDT so we'll have to build it for just this one pass (as opposed to regular dominator-tree which is reused by many passes). I've replaced this with bit-tracking dead-code-elimination which deletes more code than dce/adce.
2019-07-11 14:48:07 -07:00
losfair
c186e0244e Fix compile error on imul. 2019-07-11 20:26:20 +08:00
Johan Andersson
b41040cc59 Update to nix 0.14.
Instead of using a mix of nix 0.12 & 0.13
2019-07-11 12:28:56 +02:00
bors[bot]
0c4a8f77d2 Merge #543 #544
543: update version numbers to 0.5.5 r=MarkMcCaskey a=MarkMcCaskey



544: Use bitcast instead of alloca+load+ptrcast+store sequence. r=MarkMcCaskey a=nlewycky



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-07-11 00:51:31 +00:00
Mark McCaskey
80a8262b2f revert appveyor change 2019-07-10 17:30:24 -07:00
Mark McCaskey
019de38fe8 update lock file 2019-07-10 17:19:20 -07:00
nlewycky
3795b48401
Merge branch 'master' into llvm-cleanup 2019-07-10 16:58:27 -07:00
Mark McCaskey
7789d1b096
Merge branch 'master' into release-0.5.5 2019-07-10 16:35:00 -07:00
Mark McCaskey
e084cd9e04
Merge pull request #546 from wasmerio/fix/publishing-for-clif-backend
use published forks of clif so we can publish again
2019-07-10 16:33:55 -07:00
Nick Lewycky
7f00dc3cdb Reformat. 2019-07-10 15:33:32 -07:00
Nick Lewycky
8faff26c31 Give float_bits bitcast instruction a name. 2019-07-10 15:31:18 -07:00
Mark McCaskey
50302d5d4e use published forks of clif so we can publish again 2019-07-10 15:10:00 -07:00
Syrus
e980931329 Added simd spectest file 2019-07-10 14:43:54 -07:00
Syrus
a14d2b27b4 Added simd tests for llvm 2019-07-10 14:41:15 -07:00
Nick Lewycky
702125eef2 Fill in changelog entry. 2019-07-10 14:31:58 -07:00
Nick Lewycky
e4123433a1 Reformat. 2019-07-10 14:28:07 -07:00
Nick Lewycky
53907b0ab2 Update inkwell to our own copy until upstream supports LLVM 8.
LLVM 8 support from https://github.com/lumen/inkwell/tree/llvm8 .
2019-07-10 14:23:47 -07:00
Nick Lewycky
1ac2416c89 Add changelog entry. 2019-07-10 13:54:36 -07:00
Nick Lewycky
f4af4e387d Stub out support for V128 in the C API for now. 2019-07-10 13:54:36 -07:00
Nick Lewycky
bb30434392 This .into_iter() call is equivalent to .iter() and will not move the array. 2019-07-10 13:54:36 -07:00
Nick Lewycky
fdc13563b8 Initial implementation of SIMD in the LLVM backend. 2019-07-10 13:54:32 -07:00
Nick Lewycky
3ba8100e98 Add V128 stubs to allow singlepass backend to build again. 2019-07-10 13:48:12 -07:00
Nick Lewycky
77afcea9dc Add V128 stubs to allow LLVM backend to build again. 2019-07-10 13:48:12 -07:00
Nick Lewycky
df5c12cbe1 Add V128 to wasmer runtime. Unimplemented in clif-backend. Other backends don't build. 2019-07-10 13:48:12 -07:00
Nick Lewycky
0a1bdd449e Update to @llvm.minimum/@llvm.maximum which requires LLVM 8.
The @llvm.minnum/@llvm.maxnum intrinsics don't produce correct (for wasm) outputs in all cases.
2019-07-10 13:48:12 -07:00
Nick Lewycky
ea83924547 Update to LLVM 8.0. 2019-07-10 13:48:12 -07:00
Nick Lewycky
51556e74da Turn on parsing of SIMD in .wat files. 2019-07-10 13:48:12 -07:00
Nick Lewycky
b8d2aee80f Update wabt to 0.8 release. 2019-07-10 13:48:12 -07:00
Nick Lewycky
9579b07a54 Enable SIMD support in wasmparser. 2019-07-10 13:48:12 -07:00
Nick Lewycky
acbface4be Factor out creating wasmparser::ValidatingParserConfig to its own function. 2019-07-10 13:48:08 -07:00
nlewycky
d1f3fb2ec2
Merge branch 'master' into llvm-cleanup 2019-07-10 13:32:17 -07:00
Mark McCaskey
b2db9238af
Merge pull request #545 from wasmerio/fix/ci-on-master-oops
rm clif submodule; fix master
2019-07-10 13:23:35 -07:00
Mark McCaskey
ad3d4a4679 rm clif submodule; fix master 2019-07-10 10:38:38 -07:00
Nick Lewycky
1e86e32d40 Use bitcast instead of alloca+load+ptrcast+store sequence. 2019-07-10 10:24:14 -07:00
Mark McCaskey
2ef7448e62 remove colons from feature names 2019-07-09 17:57:31 -07:00
Mark McCaskey
4752492974 update version numbers to 0.5.5 2019-07-09 17:43:04 -07:00
bors[bot]
8901f3fb66 Merge #541
541: fix abi crates depending on compilers r=MarkMcCaskey a=MarkMcCaskey

Here's the new dep graph: (red is optional)
![wasmer_depgraph](https://user-images.githubusercontent.com/5770194/60916081-6191d800-a242-11e9-9a0d-438079dea701.png)


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-07-09 23:35:02 +00:00
Mark McCaskey
74ce33919f
Merge branch 'master' into fix/abi-crate-deps 2019-07-09 15:31:45 -07:00
Mark McCaskey
3dbb4c27ba update CI for new submodule 2019-07-09 15:28:50 -07:00
Syrus Akbary
40e67e37aa
Merge pull request #537 from wasmerio/feature/prehashed-keys
Add hidden flag `--cache-key` to use prehashed modules for speed
2019-07-09 15:15:59 -07:00
Mark McCaskey
4612b2bf9a add cranelift as submodule to clif-backend 2019-07-09 14:30:31 -07:00
Mark McCaskey
6d494a297f fix emscripten tests 2019-07-09 13:41:40 -07:00
Mark McCaskey
5993c0bcae add wasi and emscripten unit tests to CI 2019-07-09 13:21:34 -07:00
Mark McCaskey
e0c285c652 fix emscripten dependencies by making separate test crate 2019-07-09 12:07:05 -07:00
Mark McCaskey
5bf491857b fix abi crates depending on compilers 2019-07-09 11:58:03 -07:00
Mark McCaskey
30add2481e do backend caching with a directory 2019-07-08 17:05:54 -07:00
Mark McCaskey
4407a7cf93 Add hidden flag --cache-key to use prehashed modules for speed 2019-07-08 15:46:28 -07:00
bors[bot]
2fa58097c2 Merge #536
536: Update cache key generation to use backend compiler name too r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-07-08 22:17:30 +00:00
Mark McCaskey
62798fd966 fix test
fix doc test
2019-07-08 13:21:34 -07:00
Mark McCaskey
8e34cb6818 Merge branch 'feature/improved-cache-key' of github.com:wasmerio/wasmer into feature/improved-cache-key 2019-07-08 12:23:13 -07:00
Mark McCaskey
9a3fd82a4b Keep WashHash::generate function the same 2019-07-08 12:22:17 -07:00
Mark McCaskey
f2b9ccbee8
Merge branch 'master' into feature/improved-cache-key 2019-07-08 11:30:24 -07:00
Syrus
1d1c22326b Fixed CI 2019-07-08 11:30:04 -07:00
Mark McCaskey
f45d523012 update tests to use backend as in cache key gen 2019-07-08 11:11:27 -07:00
Mark McCaskey
b746a88138 Update cache key generation to use backend compiler name too 2019-07-08 10:50:28 -07:00
Jesús Leganés-Combarro
c8a15ede7f
Make wasmer compatible with latest Emscripten (#533)
Make wasmer compatible with latest Emscripten
2019-07-08 19:06:07 +02:00
Syrus
b67b051a4a Updated emscripten with comment 2019-07-08 09:39:19 -07:00
Syrus
6f1a8995ca Fixed emscripten windows vars format 2019-07-08 00:35:18 -07:00
Syrus
680b833e94 Move emscripten ___syscall221 to the unix implementation 2019-07-07 23:36:50 -07:00
Syrus
72a80a6122 FIxed emscripten windows issues 2019-07-07 22:50:50 -07:00
Syrus
69be61c9cb Remove this calls in windows 2019-07-07 19:51:11 -07:00
Syrus
798ad03182 Improved formatting in unix syscalls 2019-07-07 19:35:46 -07:00
Syrus
e786939589 Improved Makefile 2019-07-07 19:35:28 -07:00
Syrus
f4e60c09c1 Squashed commit of the following:
commit 62d9da4e3e02251a0f61c904e826bc06cf964ff7
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 18:16:34 2019 -0700

    Fixed syscall221

commit a8fde9148d50d89616d8a85a68110b89e3273229
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 18:16:04 2019 -0700

    Improved ioctl use case

commit 5ad109d39838624ad84232a4c17714b885835893
Merge: 61526e2c 5cab8161
Author: Syrus <me@syrusakbary.com>
Date:   Sun Jul 7 17:44:25 2019 -0700

    Merge branch 'command/dash' into feature/emscripten-update

commit 5cab816193d47d53aabb4be4ccaf448dca5ed0b2
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 20:11:49 2019 +0200

    Generic IOCTLs mapping

commit 5a0dc0374cdc5a3754e3ecc82584288df640d239
Merge: 61cfed79 9d120ed3
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 17:15:02 2019 +0200

    Merge remote-tracking branch 'origin/master' into command/dash

commit 61cfed7916078602eabbd4448b109f47dcfff1e8
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:04:04 2019 +0200

    Fixed implementation for syscalls 200, 201 and 202

commit 91e26d1a0ee46d6f9ec4804ca13ca928d55e7bbb
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:03:26 2019 +0200

    Improved debug messages

commit 53a8fbeb2a0912e928609f0afcea6ffb1e911193
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:03:04 2019 +0200

    [___syscall146] Move loop out of `unsafe` zone

commit d6dd3696f10f4cbb0722321bd9d06e45a9d464ac
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 13:01:31 2019 +0200

    [___syscall140] Fixed types

commit c827a6a99346535764e22bfb5ab9147a52a0a543
Merge: 2bc16826 5e18d04d
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Sat Jul 6 12:21:33 2019 +0200

    Merge remote-tracking branch 'origin/master' into command/dash

commit 2bc16826b5923dba56243fe3bd99f4be8a09c990
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:05:00 2019 +0200

    Implement `getpgid` syscall

commit d464954f5803e4d84b6f94dc9ef87cc577aa9c65
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:04:36 2019 +0200

    [fcntl64] Replace mock for real implementation

commit 3fe0183d853624bcdc968a890ac36ff7062905a7
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:03:39 2019 +0200

    [ioctl] No-of for `TIOCSPGRP` command & code clean-up

commit cc83ec9ac1cf1ad60748fd3bb5114a6e6e471d92
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:02:47 2019 +0200

    [___syscall5] debug messages

commit 91587c8bde9d2b02402a7843f37eee22322d86fb
Author: Jesús Leganés-Combarro 'piranna <piranna@gmail.com>
Date:   Thu Jul 4 07:02:20 2019 +0200

    [___syscall57] debug messages
2019-07-07 19:35:09 -07:00
Syrus
61526e2c45 Improved code format 2019-07-07 17:10:55 -07:00
Syrus
d9eee3f35a Added contains_key method to Namespace 2019-07-07 17:10:34 -07:00
Syrus
cb7a1f4486 Improved emscripten code based on comments 2019-07-07 17:10:13 -07:00
Syrus
9c96f01494 Fixed emscripten ns collision. Added ctime implementation 2019-07-07 15:55:52 -07:00
Syrus
d0b186b939 Added emscripten sbrk implementation 2019-07-06 22:05:45 -07:00
Syrus
d3d84cbc22 Formatted emscripten files 2019-07-06 17:46:48 -07:00
Syrus
15d1fd4bbb Move emscripten pthread into its own module 2019-07-06 17:45:56 -07:00
Syrus
f5af920724 Added pthread_self emscripten method 2019-07-06 17:41:03 -07:00
Syrus
b1f868dc52 Enable shared memory in emscripten 2019-07-06 17:29:24 -07:00
Syrus
24e7c1b263 Updated compatibility with latest emscripten 2019-07-06 17:15:35 -07:00
Syrus
336b5459bd Removing build from normal tests 2019-07-06 10:57:24 -07:00
Syrus
10571abb35 Fixing appveyor 2019-07-06 10:48:52 -07:00
Syrus
c3032e0853 Trying to fix CI builds 2019-07-06 10:41:45 -07:00
bors[bot]
9d120ed35f Merge #529
529: update to version 0.5.4 r=syrusakbary a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-07-06 14:11:15 +00:00
Syrus Akbary
4d21d2485c
Merge branch 'master' into update-0.5.4 2019-07-06 00:53:02 -07:00
bors[bot]
5e18d04d8f Merge #530
530: Improved clarity on tests r=syrusakbary a=syrusakbary

Improved clarity on tests.

* This PR improves the [Makefile making it much easier to test and readable](685ed53070/Makefile).
* It also assumes we are building always with `+nightly`, so the cache can be reused in the CI.
* It improves the testing section in the [main README](685ed53070/README.md (testing))


Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Syrus <me@syrusakbary.com>
2019-07-06 04:06:38 +00:00
Syrus
5a2a3f65df Trying to fix tests 2019-07-05 20:38:19 -07:00
Syrus
14fa5589e9 FIxing lint in nightly 2019-07-05 20:22:40 -07:00
Syrus
196fdb60c3 Trying to fix macOS tests 2019-07-05 20:13:48 -07:00
Syrus
beeeb4ebcf Merge branch 'feature/add-all-jobs-to-bors' into feature/improved-tests 2019-07-05 19:57:34 -07:00
Syrus
7a120f48d7 Fixed capi 2019-07-05 19:55:03 -07:00
Syrus
2569d3b40c Added LLVM compiler to WASI tests 2019-07-05 19:27:33 -07:00
Syrus
b9237a9f00 Fixed WASI tests 2019-07-05 19:15:10 -07:00
Syrus
e82ffe2457 Removed test-rust-nightly since its the default 2019-07-05 19:04:43 -07:00
Syrus
8e20705b58 Fixed stable tests 2019-07-05 19:00:52 -07:00
Syrus
685ed53070 Added test-stable to the mix 2019-07-05 18:57:30 -07:00
Syrus
03b0bdfbbe Improving lint 2019-07-05 18:43:19 -07:00
Syrus
d4386e634c Fixed lint 2019-07-05 18:40:18 -07:00
Syrus
39a7b70aa9 Improved clarity on tests 2019-07-05 18:36:34 -07:00
Mark McCaskey
723fcf1568 update wapm tag 2019-07-05 16:33:26 -07:00
Brandon Fish
84a3029217 Add back imports used within feature scop 2019-07-05 15:53:14 -05:00
Mark McCaskey
99ebb782dc update to version 0.5.4 2019-07-05 13:35:55 -07:00
Brandon Fish
8850f3545c Update config to try test-and-build jobs on trying/staging 2019-07-05 15:10:56 -05:00
Brandon Fish
73dacfaad0 Add build jobs to bors 2019-07-05 12:42:40 -05:00
bors[bot]
7ba2a4c7cc Merge #525
525: Fix build warnings in wasmer and kwasmd r=bjfish a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
Co-authored-by: Brandon Fish <bjfish@users.noreply.github.com>
2019-07-05 16:38:10 +00:00
Brandon Fish
519063f349
Merge branch 'master' into feature/fix-wasmer-build-warning 2019-07-05 11:37:38 -05:00
Syrus
9c2250dd41 Improved WASI path_readlink function signature 2019-07-05 03:27:13 -07:00
Brandon Fish
817bf93f1a Fix build warnings in wasmer and kwasmd 2019-07-05 00:04:58 -05:00
bors[bot]
d26cee8bba Merge #489
489: Su Engine: Decoding and encoding runtime state. r=losfair a=losfair

This PR implements a managed runtime that is able to suspend a running WebAssembly program at arbitrary point in time, decode its machine state (registers and stack) into the corresponding WebAssembly abstract state (call frames, locals and the value stack), and encode the abstract state back into machine state for resuming execution later.

Features enabled by this PR include:

- Tier (compiler backend) switching at runtime.
- Debugging with backtraces and local variables.
- Suspending to disk.
- Live migration.

The name "Su" corresponds to 「溯」 in Chinese, originating from 「溯洄从之」 in The Book of Songs.

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-07-05 01:39:41 +00:00
losfair
a3dcc0e240 Merge remote-tracking branch 'origin/master' into feature/osr 2019-07-04 23:56:45 +08:00
losfair
02464991da Cargo fmt 2019-07-04 01:45:54 +08:00
losfair
f32b22d571 Bkpt* -> Breakpoint* 2019-07-04 01:45:06 +08:00
losfair
7f28a4dbef Cleanup constants and comments. 2019-07-04 01:42:11 +08:00
losfair
5c5ecfff7d Rename alternative_stack to fault. 2019-07-04 01:27:19 +08:00
Mark McCaskey
01491fd986 add instance creation benchmark 2019-07-01 11:17:31 -07:00
losfair
650f67a339 Merge remote-tracking branch 'origin/master' into feature/osr 2019-07-01 21:15:35 +08:00
losfair
adada7e751 Only print backtrace if frames are detected 2019-07-01 21:12:19 +08:00
losfair
614b3b9918 Run middlewares after begin_body. 2019-06-30 11:50:21 +08:00
losfair
80509e3f78 Fix singlepass miscompilation. 2019-06-30 11:50:06 +08:00
losfair
db117d2f26 Cleanup internal logic. 2019-06-27 17:54:06 +08:00
losfair
1bd30bed4b Implement XMM register reading on Linux. 2019-06-27 16:00:04 +08:00
losfair
967027003d Full preemptive snapshot/resume. 2019-06-27 15:49:43 +08:00
losfair
7d0b70bddf Added iterative hash example. 2019-06-27 01:32:19 +08:00
losfair
15e1ac0c1d Added command line parameter for specifying resuming image. 2019-06-27 01:29:10 +08:00
losfair
f048dc2ff6 Cleanup & fix memory leaks. 2019-06-27 01:04:59 +08:00
losfair
63f9818cf6 Move more logic into runtime-core and add an interactive shell. 2019-06-27 00:41:07 +08:00
losfair
a792ac6a48 Wrap alternative stack functions properly. 2019-06-26 20:45:32 +08:00
losfair
73ca597d73 Prevent trie_traversal from being automatically compiled as an native example. 2019-06-26 14:24:58 +08:00
losfair
183571927c Merge remote-tracking branch 'origin/master' into feature/osr 2019-06-26 13:02:41 +08:00
losfair
f81464142a Fix unused import error on Windows. 2019-06-26 12:56:37 +08:00
losfair
1bdf0d5ad7 Fix clippy error. 2019-06-26 12:50:34 +08:00
losfair
03e6311446 Require backend:singlepass for suspend/resume. 2019-06-26 12:46:01 +08:00
losfair
9b4343eac5 Fix compilation on Linux. 2019-06-26 12:33:50 +08:00
losfair
bcd54a0152 Cleanup temporary files. 2019-06-26 11:31:31 +08:00
losfair
2373d371ae Optimize backtraces. 2019-06-26 11:28:46 +08:00
losfair
8ea79a0e69 Rename suspend_file to image_file. 2019-06-26 01:42:18 +08:00
losfair
2730efcc6c Cargo fmt 2019-06-26 01:39:30 +08:00
losfair
f0cf012677 Add recursive trie traversal example. 2019-06-26 01:39:00 +08:00
losfair
0937e53801 Fully persist program state. 2019-06-26 01:38:39 +08:00
losfair
3f2aeec9bc Suspend & restore. 2019-06-25 20:01:56 +08:00
losfair
8303853227 Cargo fmt 2019-06-25 03:56:20 +08:00
losfair
988b2c5748 Update Cargo.lock 2019-06-25 03:55:57 +08:00
losfair
fb7c3eee8a Improve stack trace collection and rendering. 2019-06-25 03:55:33 +08:00
losfair
73eb04d269 Merge remote-tracking branch 'origin/master' into feature/osr 2019-06-24 23:35:47 +08:00
losfair
9585b89705 Fix bugs in state reading. 2019-06-12 23:54:15 +08:00
losfair
32008eba88 Read stack values based on state map. 2019-06-12 22:02:15 +08:00
losfair
00b6bf632a Dumping stack through import. 2019-06-12 13:38:58 +08:00
losfair
ddd0653a25 Make singlepass backend emit state mapping information. 2019-06-12 00:21:43 +08:00
losfair
da9bf05218 Machine state diff 2019-06-11 20:49:30 +08:00
Mark McCaskey
34b5e44eb9 add beginnings of debugging document 2019-06-10 13:33:51 +02:00
losfair
082b8376ae State representation. 2019-06-09 21:21:18 +08:00
1622 changed files with 80510 additions and 19971 deletions

View File

@ -1,90 +0,0 @@
version: "{build} ~ {branch}"
os: Visual Studio 2017
branches:
only:
- staging
- trying
- master
environment:
matrix:
- CHANNEL: stable
ARCH: x86_64
ABI: msvc
TARGET: x86_64-pc-windows-msvc
cache:
- 'C:\Users\appveyor\.cargo'
- target
- wapm-cli-target
install:
# # Install LLVM
# - mkdir C:\projects\deps
# - cd C:\projects\deps
# - appveyor DownloadFile http://prereleases.llvm.org/win-snapshots/LLVM-7.0.0-r336178-win64.exe -FileName llvm.exe
# - 7z x llvm.exe -oC:\projects\deps\llvm
# # - set "PATH=%PATH%;C:\projects\deps\llvm\bin"
# - set "LLD_LINK=C:\projects\deps\llvm\bin\lld-link.exe"
# - set "LLVM_SYS_70_PREFIX=C:\projects\deps\llvm"
# - cd "%APPVEYOR_BUILD_FOLDER%"
# Install Rust
# uncomment these lines if the cache is cleared, or if we must re-install rust for some reason
# - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
# - rustup-init.exe -yv --default-host %target%
- set PATH=%PATH%;C:\\Libraries\\llvm-5.0.0\\bin;%USERPROFILE%\.cargo\bin
- rustup default stable-%target%
- rustup update
- rustc -vV
- cargo -vV
# Install InnoSetup
- appveyor-retry appveyor DownloadFile https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-08-22-is.exe
- 2017-08-22-is.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
- set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH%
# uncomment to RDP to appveyor
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
build_script:
- cargo build --release --verbose
# Now we build wapm
- git submodule init
- git submodule update
# Cache wapm cli target in dir above to prevent breaking git submodule on windows
- if not exist wapm-cli-target mkdir wapm-cli-target
- move wapm-cli-target wapm-cli
- cd wapm-cli
- rename wapm-cli-target target
- cd ..
- cargo build --release --manifest-path wapm-cli/Cargo.toml --features telemetry
- cd wapm-cli
- rename target wapm-cli-target
- cd ..
- move wapm-cli\wapm-cli-target wapm-cli-target
- cargo build --release --manifest-path lib/runtime-c-api/Cargo.toml
test_script:
- cargo test --manifest-path lib/spectests/Cargo.toml --features clif
before_deploy:
- cd ./src/installer
- iscc wasmer.iss
- copy /y .\WasmerInstaller.exe ..\..\WasmerInstaller-%APPVEYOR_REPO_TAG_NAME%.exe
- appveyor PushArtifact ..\..\WasmerInstaller-%APPVEYOR_REPO_TAG_NAME%.exe
- cd ..\..\
matrix:
fast_finish: true
deploy:
description: 'WasmerInstaller'
artifact: /.*\.exe/
auth_token:
secure: BbreGNDJy20922za7OhJG5TERzfX+dJSBQwttNTJkLvszbqMov6hhAtRb3P45hpf
provider: GitHub
on:
branch: master
appveyor_repo_tag: true

43
.azure/install-cmake.yml Normal file
View File

@ -0,0 +1,43 @@
# This template installs CMake (if doesn't exist in the systems)
steps:
- bash: |
set -ex
if [ -x "`command -v cmake`" ]; then
echo `command -v cmake` `cmake --version` installed
else
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
tar xf cmake-3.4.1-Darwin-x86_64.tar.gz
export CMAKE_BIN_PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin"
echo "##vso[task.prependpath]$CMAKE_BIN_PATH"
fi
displayName: "Install CMake (macOS)"
condition: eq(variables['Agent.OS'], 'Darwin')
- bash: |
set -ex
if [ -x "`command -v cmake`" ]; then
echo `command -v cmake` `cmake --version` installed
else
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz
tar xf cmake-3.4.1-Linux-x86_64.tar.gz
export CMAKE_BIN_PATH="`pwd`/cmake-3.4.1-Linux-x86_64/CMake.app/Contents/bin"
echo "##vso[task.prependpath]$CMAKE_BIN_PATH"
fi
displayName: "Install CMake (Linux)"
condition: eq(variables['Agent.OS'], 'Linux')
- bash: |
set -ex
if [ -x "`command -v cmake`" ]; then
echo `command -v cmake` `cmake --version` installed
else
chocolatey install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
fi
displayName: "Install CMake (Windows)"
condition: eq(variables['Agent.OS'], 'Windows_NT')
- bash: |
set -ex
cmake --version
displayName: CMake version

View File

@ -0,0 +1,18 @@
# This template installs InnoSetup
steps:
- bash: |
set -ex
if [ -x "`command -v iscc`" ]; then
echo `command -v iscc` `iscc -?` installed
else
choco install innosetup -y
fi
displayName: Install InnoSetup - Windows
condition: eq(variables['Agent.OS'], 'Windows_NT')
# - bash: |
# set -ex
# iscc
# displayName: InnoSetup
# condition: eq(variables['Agent.OS'], 'Windows_NT')

70
.azure/install-llvm.yml Normal file
View File

@ -0,0 +1,70 @@
# This template installs LLVM (if doesn't exist in the systems)
steps:
- bash: |
set -ex
if [ -x "`command -v llvm-config`" ]; then
echo `command -v llvm-config` `llvm-config --version` installed
else
curl -O https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz
tar xf clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz
export LLVM_PATH="`pwd`/clang+llvm-8.0.0-x86_64-apple-darwin/"
echo "##vso[task.prependpath]$LLVM_PATH/bin"
echo "##vso[task.setvariable variable=LLVM_SYS_80_PREFIX]$LLVM_PATH"
fi
displayName: "Install LLVM (macOS)"
condition: eq(variables['Agent.OS'], 'Darwin')
- bash: |
set -ex
if [ -x "`command -v llvm-config`" ]; then
echo `command -v llvm-config` `llvm-config --version` installed
else
curl -O https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
export LLVM_PATH="`pwd`/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/"
echo "##vso[task.prependpath]$LLVM_PATH/bin"
echo "##vso[task.setvariable variable=LLVM_SYS_80_PREFIX]$LLVM_PATH"
fi
displayName: "Install LLVM (Linux X64)"
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OSArchitecture'], 'X64'))
- bash: |
set -ex
if [ -x "`command -v llvm-config`" ]; then
echo `command -v llvm-config` `llvm-config --version` installed
else
curl -O https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-aarch64-linux-gnu.tar.xz
tar xf clang+llvm-8.0.0-aarch64-linux-gnu.tar.xz
export LLVM_PATH="`pwd`/clang+llvm-8.0.0-aarch64-linux-gnu/"
echo "##vso[task.prependpath]$LLVM_PATH/bin"
echo "##vso[task.setvariable variable=LLVM_SYS_80_PREFIX]$LLVM_PATH"
fi
displayName: "Install LLVM (Linux ARM)"
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OSArchitecture'], 'ARM64'))
- bash: |
set -ex
mkdir Win64_Release
cd Win64_Release
curl -OL https://github.com/wasmerio/llvm-build/releases/download/8.x/Win64_Release.zip
7z x Win64_Release.zip
llvm=`pwd`
echo "##vso[task.prependpath]$llvm/bin"
echo "##vso[task.setvariable variable=LLVM_SYS_80_PREFIX;]$llvm"
cd ..
displayName: "Install LLVM (Windows)"
condition: eq(variables['Agent.OS'], 'Windows_NT')
# Just to make sure the paths and vars are set properly
- powershell: |
Write-Host "##vso[task.prependpath]$pwd/Win64_Release/bin"
Write-Host "##vso[task.setvariable variable=LLVM_SYS_80_PREFIX;]$pwd/Win64_Release/"
displayName: Install LLVM (Windows)
condition: eq(variables['Agent.OS'], 'Windows_NT')
- bash: |
set -ex
env
llvm-config --version
displayName: LLVM version

58
.azure/install-rust.yml Normal file
View File

@ -0,0 +1,58 @@
# This template installs Rust (if doesn't exist in the systems)
# Also installs the desired Rust toolchain
# Template inspired by Tokio and wasm-bindgen templates
# Tokio template: https://github.com/tokio-rs/tokio/blob/master/ci/azure-install-rust.yml
# Wasm-bindgen template: https://github.com/rustwasm/wasm-bindgen/blob/master/ci/azure-install-rust.yml
steps:
# - bash: |
# set -ex
# brew install openssl@1.1 curl
# brew link openssl@1.1 --force
# echo "##vso[task.prependpath]/usr/local/opt/openssl/bin"
# echo "##vso[task.setvariable variable=LDFLAGS;]-L/usr/local/opt/openssl/lib"
# echo "##vso[task.setvariable variable=CPPFLAGS;]-I/usr/local/opt/openssl/include"
# displayName: "Fix Cargo SSL (macOS)"
# condition: eq(variables['Agent.OS'], 'Darwin')
- bash: |
set -ex
if [ -x "`command -v rustup`" ]; then
echo `command -v rustup` `rustup -V` installed
else
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLCHAIN
echo "##vso[task.prependpath]$HOME/.cargo/bin"
fi
displayName: "Install Rust (Linux, macOS)"
condition: ne(variables['Agent.OS'], 'Windows_NT')
# - bash: |
# set -ex
# if [ -x "`command -v rustup`" ]; then
# echo `command -v rustup` `rustup -V` installed
# else
# choco install rust -y
# # curl -sSf -o rustup-init.exe https://win.rustup.rs
# # ./rustup-init.exe -y --default-toolchain $RUST_TOOLCHAIN
# # echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin"
# fi
# displayName: "Install Rust (Windows)"
# condition: eq(variables['Agent.OS'], 'Windows_NT')
- bash: |
set -ex
rustup update --no-self-update $RUST_TOOLCHAIN
rustup default $RUST_TOOLCHAIN
rustup target add x86_64-unknown-linux-musl
rustup target add wasm32-wasi
if [ -n "$ANDROID" ]; then
rustup target add x86_64-linux-android --toolchain $RUST_TOOLCHAIN
fi
rustc -Vv
cargo -V
displayName: Install Rust
- bash: echo "##vso[task.setvariable variable=RUSTC_VERSION;]`rustc --version`"
displayName: Set rustc version in env var

View File

@ -0,0 +1,62 @@
# This template installs sccache (Shared Compilation Cache)
# More info: https://github.com/mozilla/sccache
# Template originally from wasm-bindgen
# https://github.com/rustwasm/wasm-bindgen/blob/master/ci/azure-install-sccache.yml
steps:
- bash: |
set -ex
curl -L https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-unknown-linux-musl.tar.gz | tar xzf -
sccache=`pwd`/sccache-0.2.10-x86_64-unknown-linux-musl/sccache
echo "##vso[task.setvariable variable=RUSTC_WRAPPER;]$sccache"
displayName: Install sccache - Linux X64
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OSArchitecture'], 'X64'))
- bash: |
command -v sccache > /dev/null || cargo install sccache
echo "##vso[task.setvariable variable=RUSTC_WRAPPER;]sccache"
displayName: Install sccache - Linux ARM
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OSArchitecture'], 'ARM64'))
- bash: |
set -ex
brew install openssl@1.1
curl -L https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-apple-darwin.tar.gz | tar xzf -
sccache=`pwd`/sccache-0.2.10-x86_64-apple-darwin/sccache
echo "##vso[task.setvariable variable=RUSTC_WRAPPER;]$sccache"
displayName: Install sccache - Darwin
condition: eq( variables['Agent.OS'], 'Darwin' )
- powershell: |
Invoke-WebRequest https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-pc-windows-msvc.tar.gz -OutFile sccache.tar.gz
tar xzf sccache.tar.gz
Write-Host "##vso[task.setvariable variable=RUSTC_WRAPPER;]$pwd/sccache-0.2.10-x86_64-pc-windows-msvc/sccache.exe"
displayName: Install sccache - Windows
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: |
set -ex
env
SCCACHE_ERROR_LOG=`pwd`/sccache.log RUST_LOG=debug $RUSTC_WRAPPER --start-server
$RUSTC_WRAPPER -s
cat sccache.log
displayName: "start sccache"
condition: not(eq( variables['Agent.OS'], 'Windows_NT' ))
env:
SCCACHE_AZURE_CONNECTION_STRING: $(SCCACHE_AZURE_CONNECTION_STRING)
SCCACHE_AZURE_BLOB_CONTAINER: $(SCCACHE_AZURE_BLOB_CONTAINER)
# Only use Azure pipelines cache in Windows
- bash: |
set -ex
env
mkdir -p $SCCACHE_DIR
SCCACHE_ERROR_LOG=`pwd`/sccache.log RUST_LOG=debug $RUSTC_WRAPPER --start-server
$RUSTC_WRAPPER -s
cat sccache.log
displayName: "start sccache"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
env:
SCCACHE_DIR: $(Pipeline.Workspace)/.sccache
- task: CacheBeta@0
inputs:
key: sccache | $(Agent.OS) | Cargo.lock
path: $(Pipeline.Workspace)/.sccache
displayName: Cache Cargo Target
condition: eq( variables['Agent.OS'], 'Windows_NT' )

View File

@ -1,435 +0,0 @@
run_with_build_env_vars: &run_with_build_env_vars
environment:
LLVM_SYS_70_PREFIX: /home/circleci/project/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/
run_install_dependencies: &run_install_dependencies
run:
name: install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
version: 2
jobs:
changelog:
docker:
- image: docker:stable-git
steps:
- checkout
- run:
command: ! git diff --exit-code CHANGELOG.md
# Job used for testing
lint:
docker:
- image: circleci/rust:latest
<<: *run_with_build_env_vars
steps:
- checkout
- restore_cache:
keys:
- v8-lint-{{ arch }}-{{ checksum "Cargo.lock" }}
- <<: *run_install_dependencies
- run:
name: Install lint deps
command: |
git config --global --unset url."ssh://git@github.com".insteadOf || true
rustup toolchain install nightly-2019-05-20
rustup component add rustfmt
rustup component add clippy --toolchain=nightly-2019-05-20 || cargo +nightly-2019-05-20 install --git https://github.com/rust-lang/rust-clippy/ --force clippy
- run:
name: Execute lints
command: |
make lint
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v8-lint-{{ arch }}-{{ checksum "Cargo.lock" }}
test:
docker:
- image: circleci/rust:latest
<<: *run_with_build_env_vars
steps:
- checkout
- restore_cache:
keys:
- v8-test-cargo-cache-linux-stable-{{ arch }}-{{ checksum "Cargo.lock" }}
- <<: *run_install_dependencies
- run:
name: Tests
command: make test
- run:
name: Emscripten Tests
command: |
make test-emscripten-clif
make test-emscripten-llvm
- run:
name: Integration Tests
command: make integration-tests
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v8-test-cargo-cache-linux-stable-{{ arch }}-{{ checksum "Cargo.lock" }}
test-macos:
macos:
xcode: "9.0"
steps:
- checkout
- restore_cache:
keys:
- v8-cargo-cache-darwin-stable-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install crate dependencies
command: |
# Installing cmake outside of brew to improve speed
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
tar xf cmake-3.4.1-Darwin-x86_64.tar.gz
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
# Installing LLVM outside of brew
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz
tar xf clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz
- run:
name: Install Rust
command: |
curl -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
cargo --version
- run:
name: Tests
command: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
# We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
make test
- run:
name: Emscripten Tests
command: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
# We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
make test-emscripten-clif
make test-emscripten-llvm
- run:
name: Integration Tests
command: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
make integration-tests
- save_cache:
paths:
- ~/.cargo/registry/
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
- target/release/.fingerprint
- target/release/build
- target/release/deps
key: v8-cargo-cache-darwin-stable-{{ arch }}-{{ checksum "Cargo.lock" }}
test-and-build:
docker:
- image: circleci/rust:latest
steps:
- checkout
- run:
name: "Pull dependencies"
command: |
git submodule init
git submodule update
- restore_cache:
keys:
- v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
# Use rust nightly (for singlepass, for now)
- run: rustup default nightly-2019-04-11
- run:
name: Tests
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test
- run:
name: Emscripten Tests
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test-emscripten-clif
make test-emscripten-llvm
- run:
name: Debug flag checked
command: |
cargo check --features "debug"
- run:
name: Release Build
command: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make production-release
cargo build --release --manifest-path wapm-cli/Cargo.toml --features telemetry
mkdir -p artifacts
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
# GIT_VERSION=$(git describe --exact-match --tags)
echo "${VERSION}" >> artifacts/version
echo "${CIRCLE_TAG}" >> artifacts/git_version
make build-install
cp ./wasmer.tar.gz ./artifacts/$(./binary-name.sh)
- run:
name: Dynamic library
command: |
cargo build --release --manifest-path lib/runtime-c-api/Cargo.toml
cp target/release/libwasmer_runtime_c_api.so ./artifacts
- persist_to_workspace:
root: .
paths:
- artifacts
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
- target/release/.fingerprint
- target/release/build
- target/release/deps
- wapm-cli/target/release/.fingerprint
- wapm-cli/target/release/build
- wapm-cli/target/release/deps
key: v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
test-and-build-macos:
macos:
xcode: "9.0"
steps:
- checkout
- run:
name: "Pull dependencies"
command: |
git submodule init
git submodule update
- restore_cache:
keys:
- v8-cargo-cache-darwin-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install crate dependencies
command: |
# Installing cmake outside of brew to improve speed
curl -O https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
tar xf cmake-3.4.1-Darwin-x86_64.tar.gz
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
# Installing LLVM outside of brew
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz
tar xf clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz
- run:
name: Install Rust
command: |
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
export PATH="$HOME/.cargo/bin:$PATH"
cargo --version
# Use rust nightly (for singlepass, for now)
# - run:
# name: Install Rust nightly
# command: |
# export PATH="$HOME/.rustup/bin:$PATH"
# rustup default nightly-2019-04-11
- run:
name: Tests
command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
# We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
make test
- run:
name: Emscripten Tests
command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
# We increase the ulimit for fixing cargo unclosed files in mac
ulimit -n 8000
sudo sysctl -w kern.maxfiles=655360 kern.maxfilesperproc=327680
make test-emscripten-clif
make test-emscripten-singlepass
- run:
name: Release Build
command: |
export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/"
make production-release
cargo build --release --manifest-path wapm-cli/Cargo.toml --features telemetry
mkdir -p artifacts
make build-install
cp ./wasmer.tar.gz ./artifacts/$(./binary-name.sh)
# VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
# echo "${VERSION}" >> artifacts/version
- run:
name: Generate dynamic library for the runtime C API
command: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo build --release --manifest-path lib/runtime-c-api/Cargo.toml
install_name_tool -id "@rpath/libwasmer_runtime_c_api.dylib" target/release/libwasmer_runtime_c_api.dylib
cp target/release/libwasmer_runtime_c_api.dylib ./artifacts
- persist_to_workspace:
root: .
paths:
- artifacts
- save_cache:
paths:
- ~/.cargo/registry/
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
- target/release/.fingerprint
- target/release/build
- target/release/deps
- wapm-cli/target/release/.fingerprint
- wapm-cli/target/release/build
- wapm-cli/target/release/deps
key: v8-cargo-cache-darwin-nightly-{ arch }}-{{ checksum "Cargo.lock" }}
test-rust-nightly:
docker:
- image: circleci/rust:latest
steps:
- checkout
- restore_cache:
keys:
- v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}
- run:
name: Install dependencies
command: |
sudo apt-get install -y cmake
curl -O https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
tar xf clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz
rustup toolchain install nightly
rustup target add wasm32-wasi --toolchain nightly
- run: |
rustup default nightly
make test-wasi-singlepass
make test-wasi-clif
- run: rustup default nightly-2019-04-11
- run: |
export LLVM_SYS_70_PREFIX="`pwd`/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/"
make test
make test-singlepass
make test-emscripten-clif
make test-emscripten-singlepass
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: v8-cargo-cache-linux-nightly-{{ arch }}-{{ checksum "Cargo.lock" }}-nightly
publish-github-release:
docker:
- image: cibuilds/github
steps:
- attach_workspace:
at: .
- run:
name: "Publish Release on GitHub"
command: |
# go get github.com/tcnksm/ghr
# VERSION=$(git log -1 --pretty=%B)
# VERSION=$(./artifacts/ --version)
VERSION=$(cat ./artifacts/version)
# VERSION_TAG=${CIRCLE_TAG}
VERSION_TAG=$(cat ./artifacts/git_version)
rm ./artifacts/version
rm ./artifacts/git_version
# VERSION_TAG=$(git describe --exact-match --tags)
#if [ "$VERSION" == "$VERSION_TAG" ]; then
# echo "Versions match, publishing to Github"
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${VERSION} ./artifacts/ || true
#else
# echo "Versions don't match. Wasmer output version (wasmer --version) is ${VERSION} while Git tag is ${VERSION_TAG}"
# exit 1
#fi
trigger-benchmark-build:
docker:
- image: circleci/rust:latest
steps:
- run:
name: "Trigger Benchmark Build"
command: |
if [[ -z "${CIRCLE_API_USER_TOKEN}" ]]; then
echo "CIRCLE_API_USER_TOKEN environment variable not set"
exit 1
else
echo "Triggering benchmark build"
curl -u ${CIRCLE_API_USER_TOKEN} \
-d build_parameters[CIRCLE_JOB]=bench \
https://circleci.com/api/v1.1/project/github/wasmerio/wasmer-bench/tree/master
fi
workflows:
version: 2
main:
jobs:
- changelog
- lint
- test:
filters:
branches:
only:
- trying
- staging
- test-macos:
filters:
branches:
only:
- trying
- staging
- test-and-build:
filters:
branches:
only:
- master
- test-and-build-macos:
filters:
branches:
only:
- master
- test-rust-nightly:
filters:
branches:
only:
- trying
- staging
- publish-github-release:
requires:
- lint
- test-and-build
- test-and-build-macos
filters:
branches:
only: master
- trigger-benchmark-build:
requires:
- test-and-build
- lint
filters:
branches:
only: master

View File

@ -1,6 +0,0 @@
# Ignore everything
**
!lib/**
!src/**
!Cargo.toml
!Cargo.lock

1
.gitattributes vendored
View File

@ -1,2 +1,3 @@
lib/emscripten/emtests/* linguist-vendored
lib/spectests/spectests/* linguist-vendored
CHANGELOG.md merge=union

38
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,38 @@
#
src/ @syrusakbary @MarkMcCaskey
# Backends
lib/singlepass-backend @losfair @nlewycky
lib/clif-backend @nlewycky
lib/llvm-backend @nlewycky @losfair
# Runtime
lib/runtime-core @Hywan
lib/runtime @MarkMcCaskey @Hywan
lib/runtime-c-api @Hywan
lib/win-exception-handler @losfair
lib/middleware-common @losfair
# Frontend integrations
## Emscripten
lib/emscripten @MarkMcCaskey @syrusakbary
lib/emscripten-tests @MarkMcCaskey @syrusakbary
## WASI
lib/wasi @MarkMcCaskey
lib/wasi-tests @MarkMcCaskey
## Spectests
lib/spectests @syrusakbary @MarkMcCaskey @nlewycky
# Kernel
lib/kernel-loader @losfair
lib/kernel-net @losfair
# Examples
examples @syrusakbary
# Documentation
docs @syrusakbary

View File

@ -7,37 +7,44 @@ assignees: ''
---
Thanks for the bug report!
<!-- Thanks for the bug report! -->
### Describe the bug
<!--
A clear and concise description of what the bug is.
Copy and paste the result of executing the following in your shell, so we can know the version of wasmer, Rust (if available) and architecture of your environment.
-->
```bash
```sh
echo "`wasmer -V` | `rustc -V` | `uname -m`"
```
### Steps to reproduce
### Steps to reproduce
<!--
Include steps that will help us recreate the issue.
For example,
1. Go to '…'
2. Compile with '…'
3. Run '…'
4. See error
If applicable, add a link to a test case (as a zip file or link to a repository we can clone).
-->
### Expected behavior
A clear and concise description of what you expected to happen.
<!-- A clear and concise description of what you expected to happen. -->
### Actual behavior
<!--
A clear and concise description of what actually happened.
If applicable, add screenshots to help explain your problem.
-->
### Additional context
Add any other context about the problem here.
<!-- Add any other context about the problem here. -->

15
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,15 @@
<!--
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests
-->
# Description
<!--
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->
# Review
- [ ] Add a short description of the the change to the CHANGELOG.md file

7
.gitignore vendored
View File

@ -5,3 +5,10 @@
.idea
**/.vscode
install/
capi/
api-docs/
api-docs-repo/
# Generated by tests on Android
/avd
/core

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "wapm-cli"]
path = wapm-cli
url = https://github.com/wasmerio/wapm-cli.git

View File

@ -1,74 +0,0 @@
# Wasmer Architecture
Wasmer uses the following components:
- Compiler backends: for compiling Wasm binaries to machine code ([more info here](https://github.com/wasmerio/wasmer/tree/master/lib#backends))
- [wabt](https://github.com/pepyakin/wabt-rs): for transforming `.wast` files to `.wasm` and running WebAssembly spec tests
- [wasmparser](https://github.com/yurydelendik/wasmparser.rs): for parsing the `.wasm` files and translating them into WebAssembly modules
## How Wasmer works
The first time you run `wasmer run myfile.wasm`, Wasmer will:
- Check if is a `.wast` file, and if so, transform it to `.wasm`
- Check that the provided binary is a valid WebAssembly one, i.e. its binary format starts with `\0asm`.
- Parse it with `wasmparser` and generate a `Module` from it
- Generate an `Instance` with the proper `import_object` (that means, if is detected to be an Emscripten file, it will add the Emscripten expected imports)
- Try to call the WebAssembly `start` function, or if it does not exist, try to search for the function that is exported as `main`
Find a more detailed explanation of the process below:
### Phase 1: Generating the Module / IR
As the WebAssembly file is being parsed, it will read the sections in the WebAssembly file (memory, table, function, global and element definitions) using the `Module` (or `ModuleEnvironment`) as the structure to hold this information.
However, the real IR initialization happens while a function body is being parsed/created, i.e. when the parser reads the section `(func ...)`.
While the function body is being parsed the corresponding `FuncEnvironment` methods will be called.
So for example, if the function is using a table, the `make_table` method within that `FuncEnvironment` will be called.
Each of this methods will return the corresponding IR representation.
The `Module` creation will be finished once the parsing is done, and will hold all the function IR as well as the imports/exports.
### Phase 2: Compiling the Functions
Now that we have a `Module` (and all its definitions living in `ModuleInfo`) we should be ready to compile its functions.
Right now, the `Instance` is the one in charge of compiling this functions into machine code.
When creating the `Instance`, each of the function bodies (IR) will be compiled into machine code that our architecture can understand.
Once we have the compiled values, we will push them to memory and mark them as executable, so we can call them from anywhere in our code.
#### Relocations
Sometimes the functions that we generate will need to call other functions, but the generated code has no idea how to link these functions together.
For example, if a function `A` is calling function `B` (that means is having a `(call b)` on its body) while compiling `A` we will have no idea where the function `B` lives on memory (as `B` is not yet compiled nor pushed into memory).
For that reason, we will start collecting all the calls that function `A` will need to do under the hood, and save it's offsets.
We do that, so we can patch the function calls after compilation, to point to the correct memory address.
Note: sometimes this functions rather than living in the same WebAssembly module, they will be provided as import values.
#### Traps
There will be other times where the function created will cause a trap (for example, if executing `0 / 0`).
When this happens, we will save the offset of the trap (while the function is being compiled).
Thanks to that when we execute a function, if it traps (that means a sigaction is called), we would be able to backtrack from a memory address to a specific trap case.
### Phase 3: Finalizing
Once all the functions are compiled and patched with the proper relocations addresses, we will initialize the corresponding tables (where we save the pointers to all the exported functions), memories and globals that the instance need.
Once that's finished, we will have a `Instance` function that will be ready to execute any function we need.
## Emscripten
Wasmer's Emscripten integration tries to wrap (and emulate) all the different syscalls that Emscripten needs.
We provide this integration by filling the `import_object` with the Emscripten functions, while instantiating the WebAssembly Instance.
## WASI
Wasmer's WASI integration implements all the different syscalls that WASI needs.
We provide this integration by filling the `import_object` with the WASI functions, while instantiating the WebAssembly Instance.

View File

@ -1,21 +1,29 @@
# Wasmer Attributions
Wasmer is a community effort.
In order to build the best WebAssembly runtime it's our duty to see how other runtimes are approaching the same space
and get inspired from them on the things that they got right, so Wasmer and its community can benefit from a solid
foundation.
Wasmer is a community effort and makes use of code from various other
projects. Listed below are notable sections of code that are licensed
from other projects and the relevant license of those projects.
These are the different project that we used as inspiration:
These are the projects that were used as inspiration and/or that we are using code from:
- [Nebulet](https://github.com/nebulet/nebulet): as the base for creating a great Rust WebAssembly runtime
- [WAVM](https://github.com/wavm/wavm): for their great integration and testing framework
- [greenwasm](https://github.com/Kimundi/greenwasm): for their [spectests framework](https://github.com/Kimundi/greenwasm/tree/master/greenwasm-spectest)
- [wasmtime](https://github.com/CraneStation/wasmtime): for their [mmap implementation](https://github.com/CraneStation/wasmtime/blob/3f24098edc81cd9bf0f877fb7fba018cad0f039e/lib/runtime/src/mmap.rs)
- [wasmtime](https://github.com/CraneStation/wasmtime):
For their [mmap implementation](https://github.com/CraneStation/wasmtime/blob/3f24098edc81cd9bf0f877fb7fba018cad0f039e/lib/runtime/src/mmap.rs), the wast test implementation and the implementation of the `__jit_debug_register_code` function
in Rust, the structure of using Cranelift with the GDB JIT
interface including implementation details regarding the structure
of generating debug information for each function with Cranelift
(for example, the sorting of the extended basic blocks before
processing the instructions), and the API for transforming DWARF
see [wasm-debug's attribution file](https://github.com/wasmerio/wasm-debug/blob/master/ATTRIBUTIONS.md)
for more information
- [stackoverflow](https://stackoverflow.com/a/45795699/1072990): to create an efficient HashMap with pair keys
- [Emscripten](https://github.com/kripken/emscripten): for emtests test sources to ensure compatibility
- [The WebAssembly spec](https://github.com/WebAssembly/spec/tree/master/test): for implementation details of WebAssembly and spectests
We would love to hear from you if you think we can take inspiration from other projects that we haven't covered here.
😊
Please let us know if you believe there is an error or omission in
this list and we will do our best to correct it.
## Licenses

View File

@ -1,14 +1,281 @@
# Changelog
All PRs to the Wasmer repository must add to this file.
Blocks of changes will separated by version increments.
## **[Unreleased]**
## 0.5.3
- [#1439](https://github.com/wasmerio/wasmer/pull/1439) Move `wasmer-interface-types` into its own repository
## 0.17.0 - 2020-05-11
- [#1401](https://github.com/wasmerio/wasmer/pull/1401) Make breaking change to `RuntimeError`: `RuntimeError` is now more explicit about its possible error values allowing for better insight into why a call into Wasm failed.
- [#1382](https://github.com/wasmerio/wasmer/pull/1382) Refactored test infranstructure (part 2)
- [#1380](https://github.com/wasmerio/wasmer/pull/1380) Refactored test infranstructure (part 1)
- [#1357](https://github.com/wasmerio/wasmer/pull/1357) Refactored bin commands into separate files
- [#1331](https://github.com/wasmerio/wasmer/pull/1331) Implement the `record` type and instrutions for WIT
- [#1345](https://github.com/wasmerio/wasmer/pull/1345) Adding ARM testing in Azure Pipelines
- [#1335](https://github.com/wasmerio/wasmer/pull/1335) Change mutability of `memory` to `const` in `wasmer_memory_data_length` in the C API
- [#1329](https://github.com/wasmerio/wasmer/pull/1329) New numbers and strings instructions for WIT
- [#1332](https://github.com/wasmerio/wasmer/pull/1332) Add option to `CompilerConfig` to force compiler IR verification off even when `debug_assertions` are enabled. This can be used to make debug builds faster, which may be important if you're creating a library that wraps Wasmer and depend on the speed of debug builds.
- [#1320](https://github.com/wasmerio/wasmer/pull/1320) Change `custom_sections` field in `ModuleInfo` to be more standards compliant by allowing multiple custom sections with the same name. To get the old behavior with the new API, you can add `.last().unwrap()` to accesses. For example, `module_info.custom_sections["custom_section_name"].last().unwrap()`.
- [#1313](https://github.com/wasmerio/wasmer/pull/1313) Add new high-level public API through `wasmer` crate. Includes many updates including:
- Minor improvement: `imports!` macro now handles no trailing comma as well as a trailing comma in namespaces and between namespaces.
- New methods on `Module`: `exports`, `imports`, and `custom_sections`.
- New way to get exports from an instance with `let func_name: Func<i32, i64> = instance.exports.get("func_name");`.
- Improved `Table` APIs including `set` which now allows setting functions directly. TODO: update this more if `Table::get` gets made public in this PR
- TODO: finish the list of changes here
- [#1303](https://github.com/wasmerio/wasmer/pull/1303) NaN canonicalization for singlepass backend.
- [#1292](https://github.com/wasmerio/wasmer/pull/1292) Experimental Support for Android (x86_64 and AArch64)
- [#1305](https://github.com/wasmerio/wasmer/pull/1305) Handle panics from DynamicFunc.
- [#1301](https://github.com/wasmerio/wasmer/pull/1301) Update supported stable Rust version to 1.41.1.
- [#1300](https://github.com/wasmerio/wasmer/pull/1300) Add support for multiple versions of WASI tests: wasitests now test all versions of WASI.
- [#1285](https://github.com/wasmerio/wasmer/pull/1285) Greatly improve errors in `wasmer-interface-types`
- [#1283](https://github.com/wasmerio/wasmer/pull/1283) Workaround for floating point arguments and return values in `DynamicFunc`s.
## 0.16.2 - 2020-03-11
- [#1294](https://github.com/wasmerio/wasmer/pull/1294) Fix bug related to system calls in WASI that rely on reading from WasmPtrs as arrays of length 0. `WasmPtr` will now succeed on length 0 arrays again.
## 0.16.1 - 2020-03-11
- [#1291](https://github.com/wasmerio/wasmer/pull/1291) Fix installation packaging script to package the `wax` command.
## 0.16.0 - 2020-03-11
- [#1286](https://github.com/wasmerio/wasmer/pull/1286) Updated Windows Wasmer icons. Add wax
- [#1284](https://github.com/wasmerio/wasmer/pull/1284) Implement string and memory instructions in `wasmer-interface-types`
- [#1272](https://github.com/wasmerio/wasmer/pull/1272) Fix off-by-one error bug when accessing memory with a `WasmPtr` that contains the last valid byte of memory. Also changes the behavior of `WasmPtr<T, Array>` with a length of 0 and `WasmPtr<T>` where `std::mem::size_of::<T>()` is 0 to always return `None`
## 0.15.0 - 2020-03-04
- [#1263](https://github.com/wasmerio/wasmer/pull/1263) Changed the behavior of some WASI syscalls to now handle preopened directories more properly. Changed default `--debug` logging to only show Wasmer-related messages.
- [#1217](https://github.com/wasmerio/wasmer/pull/1217) Polymorphic host functions based on dynamic trampoline generation.
- [#1252](https://github.com/wasmerio/wasmer/pull/1252) Allow `/` in wasi `--mapdir` wasm path.
- [#1212](https://github.com/wasmerio/wasmer/pull/1212) Add support for GDB JIT debugging:
- Add `--generate-debug-info` and `-g` flags to `wasmer run` to generate debug information during compilation. The debug info is passed via the GDB JIT interface to a debugger to allow source-level debugging of Wasm files. Currently only available on clif-backend.
- Break public middleware APIs: there is now a `source_loc` parameter that should be passed through if applicable.
- Break compiler trait methods such as `feed_local`, `feed_event` as well as `ModuleCodeGenerator::finalize`.
## 0.14.1 - 2020-02-24
- [#1245](https://github.com/wasmerio/wasmer/pull/1245) Use Ubuntu 16.04 in CI so that we use an earlier version of GLIBC.
- [#1234](https://github.com/wasmerio/wasmer/pull/1234) Check for unused excluded spectest failures.
- [#1232](https://github.com/wasmerio/wasmer/pull/1232) `wasmer-interface-types` has a WAT decoder.
## 0.14.0 - 2020-02-20
- [#1233](https://github.com/wasmerio/wasmer/pull/1233) Improved Wasmer C API release artifacts.
- [#1216](https://github.com/wasmerio/wasmer/pull/1216) `wasmer-interface-types` receives a binary encoder.
- [#1228](https://github.com/wasmerio/wasmer/pull/1228) Singlepass cleanup: Resolve several FIXMEs and remove protect_unix.
- [#1218](https://github.com/wasmerio/wasmer/pull/1218) Enable Cranelift verifier in debug mode. Fix bug with table indices being the wrong type.
- [#787](https://github.com/wasmerio/wasmer/pull/787) New crate `wasmer-interface-types` to implement WebAssembly Interface Types.
- [#1213](https://github.com/wasmerio/wasmer/pull/1213) Fixed WASI `fdstat` to detect `isatty` properly.
- [#1192](https://github.com/wasmerio/wasmer/pull/1192) Use `ExceptionCode` for error representation.
- [#1191](https://github.com/wasmerio/wasmer/pull/1191) Fix singlepass miscompilation on `Operator::CallIndirect`.
- [#1180](https://github.com/wasmerio/wasmer/pull/1180) Fix compilation for target `x86_64-unknown-linux-musl`.
- [#1170](https://github.com/wasmerio/wasmer/pull/1170) Improve the WasiFs builder API with convenience methods for overriding stdin, stdout, and stderr as well as a new sub-builder for controlling the permissions and properties of preopened directories. Also breaks that implementations of `WasiFile` must be `Send` -- please file an issue if this change causes you any issues.
- [#1161](https://github.com/wasmerio/wasmer/pull/1161) Require imported functions to be `Send`. This is a breaking change that fixes a soundness issue in the API.
- [#1140](https://github.com/wasmerio/wasmer/pull/1140) Use [`blake3`](https://github.com/BLAKE3-team/BLAKE3) as default hashing algorithm for caching.
- [#1129](https://github.com/wasmerio/wasmer/pull/1129) Standard exception types for singlepass backend.
## 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
- [#1099](https://github.com/wasmerio/wasmer/pull/1099) Remove `backend::Backend` from `wasmer_runtime_core`
- [#1097](https://github.com/wasmerio/wasmer/pull/1097) Move inline breakpoint outside of runtime backend
- [#1095](https://github.com/wasmerio/wasmer/pull/1095) Update to cranelift 0.52.
- [#1092](https://github.com/wasmerio/wasmer/pull/1092) Add `get_utf8_string_with_nul` to `WasmPtr` to read nul-terminated strings from memory.
- [#1071](https://github.com/wasmerio/wasmer/pull/1071) Add support for non-trapping float-to-int conversions, enabled by default.
## 0.12.0 - 2019-12-18
Special thanks to [@ethanfrey](https://github.com/ethanfrey), [@AdamSLevy](https://github.com/AdamSLevy), [@Jasper-Bekkers](https://github.com/Jasper-Bekkers), [@srenatus](https://github.com/srenatus) for their contributions!
- [#1078](https://github.com/wasmerio/wasmer/pull/1078) Increase the maximum number of parameters `Func` can take
- [#1062](https://github.com/wasmerio/wasmer/pull/1062) Expose some opt-in Emscripten functions to the C API
- [#1032](https://github.com/wasmerio/wasmer/pull/1032) Change the signature of the Emscripten `abort` function to work with Emscripten 1.38.30
- [#1060](https://github.com/wasmerio/wasmer/pull/1060) Test the capi with all the backends
- [#1069](https://github.com/wasmerio/wasmer/pull/1069) Add function `get_memory_and_data` to `Ctx` to help prevent undefined behavior and mutable aliasing. It allows accessing memory while borrowing data mutably for the `Ctx` lifetime. This new function is now being used in `wasmer-wasi`.
- [#1058](https://github.com/wasmerio/wasmer/pull/1058) Fix minor panic issue when `wasmer::compile_with` called with llvm backend.
- [#858](https://github.com/wasmerio/wasmer/pull/858) Minor panic fix when wasmer binary with `loader` option run a module without exported `_start` function.
- [#1056](https://github.com/wasmerio/wasmer/pull/1056) Improved `--invoke` args parsing (supporting `i32`, `i64`, `f32` and `f32`) in Wasmer CLI
- [#1054](https://github.com/wasmerio/wasmer/pull/1054) Improve `--invoke` output in Wasmer CLI
- [#1053](https://github.com/wasmerio/wasmer/pull/1053) For RuntimeError and breakpoints, use Box<Any + Send> instead of Box<Any>.
- [#1052](https://github.com/wasmerio/wasmer/pull/1052) Fix minor panic and improve Error handling in singlepass backend.
- [#1050](https://github.com/wasmerio/wasmer/pull/1050) Attach C & C++ headers to releases.
- [#1033](https://github.com/wasmerio/wasmer/pull/1033) Set cranelift backend as default compiler backend again, require at least one backend to be enabled for Wasmer CLI
- [#1044](https://github.com/wasmerio/wasmer/pull/1044) Enable AArch64 support in the LLVM backend.
- [#1030](https://github.com/wasmerio/wasmer/pull/1030) Ability to generate `ImportObject` for a specific version WASI version with the C API.
- [#1028](https://github.com/wasmerio/wasmer/pull/1028) Introduce strict/non-strict modes for `get_wasi_version`
- [#1029](https://github.com/wasmerio/wasmer/pull/1029) Add the “floating” `WasiVersion::Latest` version.
- [#1006](https://github.com/wasmerio/wasmer/pull/1006) Fix minor panic issue when `wasmer::compile_with` called with llvm backend
- [#1009](https://github.com/wasmerio/wasmer/pull/1009) Enable LLVM verifier for all tests, add new llvm-backend-tests crate.
- [#1022](https://github.com/wasmerio/wasmer/pull/1022) Add caching support for Singlepass backend.
- [#1004](https://github.com/wasmerio/wasmer/pull/1004) Add the Auto backend to enable to adapt backend usage depending on wasm file executed.
- [#1068](https://github.com/wasmerio/wasmer/pull/1068) Various cleanups for the singlepass backend on AArch64.
## 0.11.0 - 2019-11-22
- [#713](https://github.com/wasmerio/wasmer/pull/713) Add AArch64 support for singlepass.
- [#995](https://github.com/wasmerio/wasmer/pull/995) Detect when a global is read without being initialized (emit a proper error instead of panicking)
- [#996](https://github.com/wasmerio/wasmer/pull/997) Refactored spectests, emtests and wasitests to use default compiler logic
- [#992](https://github.com/wasmerio/wasmer/pull/992) Updates WAPM version to 0.4.1, fix arguments issue introduced in #990
- [#990](https://github.com/wasmerio/wasmer/pull/990) Default wasmer CLI to `run`. Wasmer will now attempt to parse unrecognized command line options as if they were applied to the run command: `wasmer mywasm.wasm --dir=.` now works!
- [#987](https://github.com/wasmerio/wasmer/pull/987) Fix `runtime-c-api` header files when compiled by gnuc.
- [#957](https://github.com/wasmerio/wasmer/pull/957) Change the meaning of `wasmer_wasi::is_wasi_module` to detect any type of WASI module, add support for new wasi snapshot_preview1
- [#934](https://github.com/wasmerio/wasmer/pull/934) Simplify float expressions in the LLVM backend.
## 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.
- [#917](https://github.com/wasmerio/wasmer/pull/917) Host functions (aka imported functions) may not have `&mut vm::Ctx` as first argument, i.e. the presence of the `&mut vm::Ctx` argument is optional.
- [#915](https://github.com/wasmerio/wasmer/pull/915) All backends share the same definition of `Trampoline` (defined in `wasmer-runtime-core`).
## 0.10.1 - 2019-11-11
- [#952](https://github.com/wasmerio/wasmer/pull/952) Use C preprocessor to properly hide trampoline functions on Windows and non-x86_64 targets.
## 0.10.0 - 2019-11-11
Special thanks to [@newpavlov](https://github.com/newpavlov) and [@Maxgy](https://github.com/Maxgy) for their contributions!
- [#942](https://github.com/wasmerio/wasmer/pull/942) Deny missing docs in runtime core and add missing docs
- [#939](https://github.com/wasmerio/wasmer/pull/939) Fix bug causing attempts to append to files with WASI to delete the contents of the file
- [#940](https://github.com/wasmerio/wasmer/pull/940) Update supported Rust version to 1.38+
- [#923](https://github.com/wasmerio/wasmer/pull/923) Fix memory leak in the C API caused by an incorrect cast in `wasmer_trampoline_buffer_destroy`
- [#921](https://github.com/wasmerio/wasmer/pull/921) In LLVM backend, annotate all memory accesses with TBAA metadata.
- [#883](https://github.com/wasmerio/wasmer/pull/883) Allow floating point operations to have arbitrary inputs, even including SNaNs.
- [#856](https://github.com/wasmerio/wasmer/pull/856) Expose methods in the runtime C API to get a WASI import object
## 0.9.0 - 2019-10-23
Special thanks to @alocquet for their contributions!
- [#898](https://github.com/wasmerio/wasmer/pull/898) State tracking is now disabled by default in the LLVM backend. It can be enabled with `--track-state`.
- [#861](https://github.com/wasmerio/wasmer/pull/861) Add descriptions to `unimplemented!` macro in various places
- [#897](https://github.com/wasmerio/wasmer/pull/897) Removes special casing of stdin, stdout, and stderr in WASI. Closing these files now works. Removes `stdin`, `stdout`, and `stderr` from `WasiFS`, replaced by the methods `stdout`, `stdout_mut`, and so on.
- [#863](https://github.com/wasmerio/wasmer/pull/863) Fix min and max for cases involving NaN and negative zero when using the LLVM backend.
## 0.8.0 - 2019-10-02
Special thanks to @jdanford for their contributions!
- [#850](https://github.com/wasmerio/wasmer/pull/850) New `WasiStateBuilder` API. small, add misc. breaking changes to existing API (for example, changing the preopen dirs arg on `wasi::generate_import_object` from `Vec<String>` to `Vec<Pathbuf>`)
- [#852](https://github.com/wasmerio/wasmer/pull/852) Make minor grammar/capitalization fixes to README.md
- [#841](https://github.com/wasmerio/wasmer/pull/841) Slightly improve rustdoc documentation and small updates to outdated info in readme files
- [#836](https://github.com/wasmerio/wasmer/pull/836) Update Cranelift fork version to `0.44.0`
- [#839](https://github.com/wasmerio/wasmer/pull/839) Change supported version to stable Rust 1.37+
- [#834](https://github.com/wasmerio/wasmer/pull/834) Fix panic when unwraping `wasmer` arguments
- [#835](https://github.com/wasmerio/wasmer/pull/835) Add parallel execution example (independent instances created from the same `ImportObject` and `Module` run with rayon)
- [#834](https://github.com/wasmerio/wasmer/pull/834) Fix panic when parsing numerical arguments for no-ABI targets run with the wasmer binary
- [#833](https://github.com/wasmerio/wasmer/pull/833) Add doc example of using ImportObject's new `maybe_with_namespace` method
- [#832](https://github.com/wasmerio/wasmer/pull/832) Delete unused runtime ABI
- [#809](https://github.com/wasmerio/wasmer/pull/809) Fix bugs leading to panics in `LocalBacking`.
- [#831](https://github.com/wasmerio/wasmer/pull/831) Add support for atomic operations, excluding wait and notify, to singlepass.
- [#822](https://github.com/wasmerio/wasmer/pull/822) Update Cranelift fork version to `0.43.1`
- [#829](https://github.com/wasmerio/wasmer/pull/829) Fix deps on `make bench-*` commands; benchmarks don't compile other backends now
- [#807](https://github.com/wasmerio/wasmer/pull/807) Implement Send for `Instance`, breaking change on `ImportObject`, remove method `get_namespace` replaced with `with_namespace` and `maybe_with_namespace`
- [#817](https://github.com/wasmerio/wasmer/pull/817) Add document for tracking features across backends and language integrations, [docs/feature_matrix.md]
- [#823](https://github.com/wasmerio/wasmer/issues/823) Improved Emscripten / WASI integration
- [#821](https://github.com/wasmerio/wasmer/issues/821) Remove patch version on most deps Cargo manifests. This gives Wasmer library users more control over which versions of the deps they use.
- [#820](https://github.com/wasmerio/wasmer/issues/820) Remove null-pointer checks in `WasmPtr` from runtime-core, re-add them in Emscripten
- [#803](https://github.com/wasmerio/wasmer/issues/803) Add method to `Ctx` to invoke functions by their `TableIndex`
- [#790](https://github.com/wasmerio/wasmer/pull/790) Fix flaky test failure with LLVM, switch to large code model.
- [#788](https://github.com/wasmerio/wasmer/pull/788) Use union merge on the changelog file.
- [#785](https://github.com/wasmerio/wasmer/pull/785) Include Apache license file for spectests.
- [#786](https://github.com/wasmerio/wasmer/pull/786) In the LLVM backend, lower atomic wasm operations to atomic machine instructions.
- [#784](https://github.com/wasmerio/wasmer/pull/784) Fix help string for wasmer run.
## 0.7.0 - 2019-09-12
Special thanks to @YaronWittenstein @penberg for their contributions.
- [#776](https://github.com/wasmerio/wasmer/issues/776) Allow WASI preopened fds to be closed
- [#774](https://github.com/wasmerio/wasmer/issues/774) Add more methods to the `WasiFile` trait
- [#772](https://github.com/wasmerio/wasmer/issues/772) [#770](https://github.com/wasmerio/wasmer/issues/770) Handle more internal failures by passing back errors
- [#756](https://github.com/wasmerio/wasmer/issues/756) Allow NULL parameter and 0 arity in `wasmer_export_func_call` C API
- [#747](https://github.com/wasmerio/wasmer/issues/747) Return error instead of panicking on traps when using the Wasmer binary
- [#741](https://github.com/wasmerio/wasmer/issues/741) Add validate Wasm fuzz target
- [#733](https://github.com/wasmerio/wasmer/issues/733) Remove dependency on compiler backends for `middleware-common`
- [#732](https://github.com/wasmerio/wasmer/issues/732) [#731](https://github.com/wasmerio/wasmer/issues/731) WASI bug fixes and improvements
- [#726](https://github.com/wasmerio/wasmer/issues/726) Add serialization and deserialization for Wasi State
- [#716](https://github.com/wasmerio/wasmer/issues/716) Improve portability of install script
- [#714](https://github.com/wasmerio/wasmer/issues/714) Add Code of Conduct
- [#708](https://github.com/wasmerio/wasmer/issues/708) Remove unconditional dependency on Cranelift in the C API
- [#703](https://github.com/wasmerio/wasmer/issues/703) Fix compilation on AArch64 Linux
- [#702](https://github.com/wasmerio/wasmer/issues/702) Add SharedMemory to Wasmer. Add `--enable-threads` flag, add partial implementation of atomics to LLVM backend.
- [#698](https://github.com/wasmerio/wasmer/issues/698) [#690](https://github.com/wasmerio/wasmer/issues/690) [#687](https://github.com/wasmerio/wasmer/issues/690) Fix panics in Emscripten
- [#689](https://github.com/wasmerio/wasmer/issues/689) Replace `wasmer_runtime_code::memory::Atomic` with `std::sync::atomic` atomics, changing its interface
- [#680](https://github.com/wasmerio/wasmer/issues/680) [#673](https://github.com/wasmerio/wasmer/issues/673) [#669](https://github.com/wasmerio/wasmer/issues/669) [#660](https://github.com/wasmerio/wasmer/issues/660) [#659](https://github.com/wasmerio/wasmer/issues/659) Misc. runtime and singlepass fixes
- [#677](https://github.com/wasmerio/wasmer/issues/677) [#675](https://github.com/wasmerio/wasmer/issues/675) [#674](https://github.com/wasmerio/wasmer/issues/674) LLVM backend fixes and improvements
- [#671](https://github.com/wasmerio/wasmer/issues/671) Implement fs polling in `wasi::poll_oneoff` for Unix-like platforms
- [#656](https://github.com/wasmerio/wasmer/issues/656) Move CI to Azure Pipelines
- [#650](https://github.com/wasmerio/wasmer/issues/650) Implement `wasi::path_rename`, improve WASI FS public api, and allow open files to exist even when the underlying file is deleted
- [#643](https://github.com/wasmerio/wasmer/issues/643) Implement `wasi::path_symlink` and improve WASI FS public api IO error reporting
- [#608](https://github.com/wasmerio/wasmer/issues/608) Implement wasi syscalls `fd_allocate`, `fd_sync`, `fd_pread`, `path_link`, `path_filestat_set_times`; update WASI fs API in a WIP way; reduce coupling of WASI code to host filesystem; make debug messages from WASI more readable; improve rights-checking when calling syscalls; implement reference counting on inodes; misc bug fixes and improvements
- [#616](https://github.com/wasmerio/wasmer/issues/616) Create the import object separately from instance instantiation in `runtime-c-api`
- [#620](https://github.com/wasmerio/wasmer/issues/620) Replace one `throw()` with `noexcept` in llvm backend
- [#618](https://github.com/wasmerio/wasmer/issues/618) Implement `InternalEvent::Breakpoint` in the llvm backend to allow metering in llvm
- [#615](https://github.com/wasmerio/wasmer/issues/615) Eliminate `FunctionEnvironment` construction in `feed_event()` speeding up to 70% of compilation in clif
- [#609](https://github.com/wasmerio/wasmer/issues/609) Update dependencies
- [#602](https://github.com/wasmerio/wasmer/issues/602) C api extract instance context from instance
- [#590](https://github.com/wasmerio/wasmer/issues/590) Error visibility changes in wasmer-c-api
- [#589](https://github.com/wasmerio/wasmer/issues/589) Make `wasmer_byte_array` fields `public` in wasmer-c-api
## 0.6.0 - 2019-07-31
- [#603](https://github.com/wasmerio/wasmer/pull/603) Update Wapm-cli, bump version numbers
- [#595](https://github.com/wasmerio/wasmer/pull/595) Add unstable public API for interfacing with the WASI file system in plugin-like usecases
- [#598](https://github.com/wasmerio/wasmer/pull/598) LLVM Backend is now supported in Windows
- [#599](https://github.com/wasmerio/wasmer/pull/599) Fix llvm backend failures in fat spec tests and simd_binaryen spec test.
- [#579](https://github.com/wasmerio/wasmer/pull/579) Fix bug in caching with LLVM and Singlepass backends.
Add `default-backend-singlepass`, `default-backend-llvm`, and `default-backend-cranelift` features to `wasmer-runtime`
to control the `default_compiler()` function (this is a breaking change). Add `compiler_for_backend` function in `wasmer-runtime`
- [#561](https://github.com/wasmerio/wasmer/pull/561) Call the `data_finalizer` field on the `Ctx`
- [#576](https://github.com/wasmerio/wasmer/pull/576) fix `Drop` of uninit `Ctx`
- [#542](https://github.com/wasmerio/wasmer/pull/542) Add SIMD support to Wasmer (LLVM backend only)
- Updates LLVM to version 8.0
## 0.5.7 - 2019-07-23
- [#575](https://github.com/wasmerio/wasmer/pull/575) Prepare for release; update wapm to 0.3.6
- [#555](https://github.com/wasmerio/wasmer/pull/555) WASI filesystem rewrite. Major improvements
- adds virtual root showing all preopened directories
- improved sandboxing and code-reuse
- symlinks work in a lot more situations
- many misc. improvements to most syscalls touching the filesystem
## 0.5.6 - 2019-07-16
- [#565](https://github.com/wasmerio/wasmer/pull/565) Update wapm and bump version to 0.5.6
- [#563](https://github.com/wasmerio/wasmer/pull/563) Improve wasi testing infrastructure
- fixes arg parsing from comments & fixes the mapdir test to have the native code doing the same thing as the WASI code
- makes wasitests-generate output stdout/stderr by default & adds function to print stdout and stderr for a command if it fails
- compiles wasm with size optimizations & strips generated wasm with wasm-strip
- [#554](https://github.com/wasmerio/wasmer/pull/554) Finish implementation of `wasi::fd_seek`, fix bug in filestat
- [#550](https://github.com/wasmerio/wasmer/pull/550) Fix singlepass compilation error with `imul` instruction
## 0.5.5 - 2019-07-10
- [#541](https://github.com/wasmerio/wasmer/pull/541) Fix dependency graph by making separate test crates; ABI implementations should not depend on compilers. Add Cranelift fork as git submodule of clif-backend
- [#537](https://github.com/wasmerio/wasmer/pull/537) Add hidden flag (`--cache-key`) to use prehashed key into the compiled wasm cache and change compiler backend-specific caching to use directories
- [#536](https://github.com/wasmerio/wasmer/pull/536) ~Update cache to use compiler backend name in cache key~
## 0.5.4 - 2019-07-06
- [#529](https://github.com/wasmerio/wasmer/pull/529) Updates the Wasm Interface library, which is used by wapm, with bug fixes and error message improvements
## 0.5.3 - 2019-07-03
- [#523](https://github.com/wasmerio/wasmer/pull/523) Update wapm version to fix bug related to signed packages in the global namespace and locally-stored public keys
## 0.5.2 - 2019-07-02
- [#516](https://github.com/wasmerio/wasmer/pull/516) Add workaround for singlepass miscompilation on GetLocal
- [#521](https://github.com/wasmerio/wasmer/pull/521) Update Wapm-cli, bump version numbers
- [#518](https://github.com/wasmerio/wasmer/pull/518) Update Cranelift and WasmParser
- [#514](https://github.com/wasmerio/wasmer/pull/514) [#519](https://github.com/wasmerio/wasmer/pull/519) Improved Emscripten network related calls, added a null check to `WasmPtr`
@ -26,7 +293,7 @@ Blocks of changes will separated by version increments.
- [#493](https://github.com/wasmerio/wasmer/pull/493) `wasmer_module_instantiate` has better error messages in the runtime C API
- [#474](https://github.com/wasmerio/wasmer/pull/474) Set the install name of the dylib to `@rpath`
- [#490](https://github.com/wasmerio/wasmer/pull/490) Add MiddlewareChain and StreamingCompiler to runtime
- [#487](https://github.com/wasmerio/wasmer/pull/487) Fix stack offset check in singlepass backend
- [#487](https://github.com/wasmerio/wasmer/pull/487) Fix stack offset check in singlepass backend
- [#450](https://github.com/wasmerio/wasmer/pull/450) Added Metering
- [#481](https://github.com/wasmerio/wasmer/pull/481) Added context trampoline into runtime
- [#484](https://github.com/wasmerio/wasmer/pull/484) Fix bugs in emscripten socket syscalls

76
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at contact@wasmer.io. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

33
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,33 @@
# How to Contribute to Wasmer
Thank you for your interest in contributing to Wasmer. This document outlines some recommendations on how to contribute.
## Issues & Feature Requests
Please use the issue template and provide a failing example if possible to help us recreate the issue.
## Pull Requests
For large changes, please try reaching communicating with the Wasmer maintainers via GitHub Issues or Spectrum Chat to ensure we can accept the change once it is ready.
We recommend trying the following commands before sending a pull request to ensure code quality:
- `cargo fmt --all` Ensures all code is correctly formatted.
- Run `cargo test` in the crates that you are modifying.
- Run `cargo build --all` (nightly) or `cargo build --all --exclude wasmer-singlepass-backend`
A comprehensive CI test suite will be run by a Wasmer team member after the PR has been created.
### Common Build Issues
#### LLVM Dependency
`Didn't find usable system-wide LLVM`
Building Wasmer with the LLVM backend requires LLVM to be installed
#### Singlepass Nightly Only
`error[E0554]: #![feature] may not be used on the stable release channel`
Building Wasmer with the singlepass backend requires the nightly version of Rust

3112
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,13 @@
[package]
name = "wasmer"
version = "0.5.3"
name = "wasmer-bin"
version = "0.17.0"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
repository = "https://github.com/wasmerio/wasmer"
publish = true
description = "High-Performance WebAssembly JIT interpreter"
license = "MIT"
default-run = "wasmer"
include = [
"examples/**/*",
"src/**/*",
@ -17,34 +18,40 @@ include = [
"/README.md",
"rustfmt.toml"
]
autoexamples = false
[dependencies]
byteorder = "1.3.1"
errno = "0.2.4"
structopt = "0.2.11"
wabt = "0.7.2"
hashbrown = "0.1.8"
wasmer-clif-backend = { path = "lib/clif-backend" }
wasmer-singlepass-backend = { path = "lib/singlepass-backend", optional = true }
atty = "0.2"
byteorder = "1.3"
errno = "0.2"
fern = { version = "0.5", features = ["colored"], optional = true }
log = "0.4"
structopt = "0.3"
wabt = { version = "0.9.1", optional = true }
wasmer = { path = "lib/api", default-features = false }
wasmer-middleware-common = { path = "lib/middleware-common" }
wasmer-runtime = { path = "lib/runtime" }
# wasmer-runtime-abi = { path = "lib/runtime-abi", optional = true }
wasmer-runtime = { path = "lib/runtime", default-features = false }
wasmer-runtime-core = { path = "lib/runtime-core" }
wasmer-emscripten = { path = "lib/emscripten" }
wasmer-llvm-backend = { path = "lib/llvm-backend", optional = true }
wasmer-wasi = { path = "lib/wasi", optional = true }
wasmer-kernel-loader = { path = "lib/kernel-loader", optional = true }
wasmer-dev-utils = { path = "lib/dev-utils", optional = true }
# Backends
wasmer-singlepass-backend = { path = "lib/singlepass-backend", optional = true }
wasmer-clif-backend = { path = "lib/clif-backend", optional = true }
wasmer-llvm-backend = { path = "lib/llvm-backend", optional = true }
# Frontends
wasmer-emscripten = { path = "lib/emscripten" }
wasmer-wasi = { path = "lib/wasi", optional = true }
wasmer-wasi-experimental-io-devices = { path = "lib/wasi-experimental-io-devices", optional = true }
[workspace]
members = [
"lib/api",
"lib/clif-backend",
"lib/singlepass-backend",
"lib/runtime",
# "lib/runtime-abi",
"lib/runtime-core",
"lib/emscripten",
"lib/spectests",
"lib/win-exception-handler",
"lib/runtime-c-api",
"lib/llvm-backend",
@ -52,28 +59,74 @@ members = [
"lib/middleware-common",
"lib/kernel-loader",
"lib/kernel-net",
"lib/dev-utils",
"examples/plugin-for-example"
"lib/wasi-experimental-io-devices",
"examples/parallel",
"examples/plugin-for-example",
"examples/parallel-guest",
"tests/test-generator",
"tests/generate-wasi-tests",
"tests/generate-emscripten-tests",
"tests/wast",
]
[build-dependencies]
wabt = "0.7.2"
glob = "0.2.11"
rustc_version = "0.2.3"
anyhow = "1.0.19"
generate-emscripten-tests = { path = "tests/generate-emscripten-tests" }
generate-wasi-tests = { path = "tests/generate-wasi-tests" }
test-generator = { path = "tests/test-generator" }
glob = "0.3"
rustc_version = "0.2"
[dev-dependencies]
anyhow = "1.0.19"
wasmer-wast = { path = "tests/wast" }
lazy_static = "1.4"
# To allow parameterized tests
test-case = "1.0.0"
criterion = "0.3"
glob = "0.3"
libc = "0.2.60" # for `tests/dev-utils`'s Stdout capturing
serde = { version = "1", features = ["derive"] } # used by the plugin example
serde_json = "1"
typetag = "0.1" # used by the plugin example
wabt = "0.9.1"
[features]
default = ["fast-tests", "wasi"]
"loader:kernel" = ["wasmer-kernel-loader"]
debug = ["wasmer-runtime-core/debug"]
trace = ["wasmer-runtime-core/trace"]
extra-debug = ["wasmer-clif-backend/debug", "wasmer-runtime-core/debug"]
# This feature will allow cargo test to run much faster
fast-tests = []
"backend:llvm" = ["wasmer-llvm-backend"]
"backend:singlepass" = ["wasmer-singlepass-backend"]
# Don't add the backend features in default, please add them on the Makefile
# since we might want to autoconfigure them depending on the availability on the host.
default = ["wasi", "wabt"]
loader-kernel = ["wasmer-kernel-loader"]
debug = ["fern", "log/max_level_debug", "log/release_max_level_debug"]
trace = ["fern", "log/max_level_trace", "log/release_max_level_trace"]
docs = ["wasmer-runtime/docs"]
backend-cranelift = [
"wasmer-clif-backend",
"wasmer-clif-backend/generate-debug-information",
"wasmer-runtime-core/generate-debug-information",
"wasmer-runtime/cranelift",
"wasmer/cranelift",
]
backend-llvm = [
"wasmer-llvm-backend",
"wasmer-runtime/llvm",
"wasmer-runtime-core/generate-debug-information-no-export-symbols",
"wasmer/llvm",
]
backend-singlepass = [
"wasmer-singlepass-backend",
"wasmer-runtime/singlepass",
"wasmer/singlepass",
]
wasi = ["wasmer-wasi"]
# vfs = ["wasmer-runtime-abi"]
experimental-io-devices = ["wasmer-wasi-experimental-io-devices"]
managed = ["backend-singlepass", "wasmer-runtime-core/managed"]
[[example]]
name = "plugin"
required-features = ["wasi", "backend-cranelift"]
crate-type = ["bin"]
[[example]]
name = "callback"
crate-type = ["bin"]
required-features = ["backend-cranelift"]

View File

@ -1,25 +0,0 @@
FROM circleci/rust:1.33.0-stretch as wasmer-build-env
RUN sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
cmake \
&& sudo rm -rf /var/lib/apt/lists/*
RUN curl -SL https://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz \
| tar -xJC /home/circleci
ENV LLVM_SYS_70_PREFIX /home/circleci/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04/
FROM wasmer-build-env AS wasmer-debug-env
RUN sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
valgrind \
&& sudo rm -rf /var/lib/apt/lists/*
FROM wasmer-build-env AS wasmer-build
WORKDIR /home/circleci/wasmer
COPY . /home/circleci/wasmer
RUN sudo chmod -R 777 .
RUN cargo build --release
FROM debian:stretch AS wasmer
WORKDIR /root/
COPY --from=wasmer-build /home/circleci/wasmer/target/release/wasmer .
ENTRYPOINT ["./wasmer"]

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Wasmer, Inc. and its affiliates.
Copyright (c) 2019-present Wasmer, Inc. and its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

484
Makefile
View File

@ -1,111 +1,431 @@
ifeq (test, $(firstword $(MAKECMDGOALS)))
runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
$(eval $(runargs):;@true)
.PHONY: spectests emtests clean build install lint precommit docs examples
# uname only works in *Unix like systems
ifneq ($(OS), Windows_NT)
ARCH := $(shell uname -m)
UNAME_S := $(shell uname -s)
else
# We can assume, if in windows it will likely be in x86_64
ARCH := x86_64
UNAME_S :=
endif
.PHONY: spectests emtests clean build install lint precommit
backends :=
# Singlepass is enabled
RUST_VERSION := $(shell rustc -V)
ifneq (, $(findstring nightly,$(RUST_VERSION)))
# Singlepass doesn't work yet on Windows
ifneq ($(OS), Windows_NT)
backends += singlepass
endif
endif
ifeq ($(ARCH), x86_64)
# In X64, Cranelift is enabled
backends += cranelift
# LLVM could be enabled if not in Windows
ifneq ($(OS), Windows_NT)
# Autodetect LLVM from llvm-config
ifneq (, $(shell which llvm-config))
LLVM_VERSION := $(shell llvm-config --version)
# If findstring is not empty, then it have found the value
ifneq (, $(findstring 8,$(LLVM_VERSION))$(findstring 9,$(LLVM_VERSION)))
backends += llvm
endif
else
ifneq (, $(shell which llvm-config-8))
backends += llvm
endif
endif
endif
endif
backends := $(filter-out ,$(backends))
ifneq ($(OS), Windows_NT)
bold := $(shell tput bold)
green := $(shell tput setaf 2)
reset := $(shell tput sgr0)
endif
$(info Available backends: $(bold)$(green)${backends}$(reset))
backend_features_spaced := $(foreach backend,$(backends),backend-$(backend))
backend_features := --features "$(backend_features_spaced)"
# $(info Cargo features ${backend_features})
# Generate files
generate-emtests:
WASM_EMSCRIPTEN_GENERATE_EMTESTS=1 cargo build --release \
&& echo "formatting" \
&& cargo fmt
# To generate WASI tests you'll need to have the correct versions of the Rust nightly
# toolchain installed, see `WasiVersion::get_compiler_toolchain` in
# `tests/generate-wasi-tests/src/wasi_version.rs`
#
# or run `make wasitests-setup-toolchain` or `make wasitests-setup-toolchain-all`
generate-wasitests: wasitests-setup
WASM_WASI_GENERATE_WASITESTS=1 cargo build --release -vv \
&& echo "formatting" \
&& cargo fmt
generate-wasitests-all: wasitests-setup
WASI_TEST_GENERATE_ALL=1 WASM_WASI_GENERATE_WASITESTS=1 cargo build --release -vv \
&& echo "formatting" \
&& cargo fmt
emtests-generate: generate-emtests
wasitests-generate: generate-wasitests
wasitests-setup-toolchain: wasitests-setup
WASM_WASI_SET_UP_TOOLCHAIN=1 cargo build --release -vv
wasitests-setup-toolchain-all: wasitests-setup
WASI_TEST_GENERATE_ALL=1 WASM_WASI_SET_UP_TOOLCHAIN=1 cargo build --release -vv
generate: generate-emtests generate-wasitests
# Spectests
spectests-singlepass:
cargo test singlepass::spec --release $(backend_features)
spectests-cranelift:
cargo test cranelift::spec --release $(backend_features)
spectests-llvm:
cargo test llvm::spec --release $(backend_features) -- --test-threads=1
# This will re-generate the Rust test files based on spectests/*.wast
spectests:
WASMER_RUNTIME_GENERATE_SPECTESTS=1 cargo build -p wasmer-runtime-core
cargo test spec --release $(backend_features) -- --test-threads=1
emtests:
WASM_EMSCRIPTEN_GENERATE_EMTESTS=1 cargo build -p wasmer-emscripten
wasitests:
WASM_WASI_GENERATE_WASITESTS=1 cargo build -p wasmer-wasi
# Emscripten tests
emtests-singlepass:
cargo test singlepass::emscripten --release $(backend_features)
# clean:
# rm -rf artifacts
emtests-cranelift:
cargo test cranelift::emscripten --release $(backend_features)
build:
cargo build --features debug
emtests-llvm:
cargo test llvm::emscripten --release $(backend_features) -- --test-threads=1
emtests-all:
cargo test emscripten --release $(backend_features) -- --test-threads=1
emtests: emtests-singlepass emtests-cranelift emtests-llvm
# Middleware tests
middleware-singlepass:
cargo test singlepass::middleware --release $(backend_features)
middleware-cranelift:
cargo test cranelift::middleware --release $(backend_features)
middleware-llvm:
cargo test llvm::middleware --release $(backend_features)
middleware: middleware-singlepass middleware-cranelift middleware-llvm
# Wasitests
wasitests-setup:
ifeq (,$(wildcard ./tests/wasi_test_resources/test_fs/temp))
rm -rf tests/wasi_test_resources/test_fs/temp
endif
mkdir -p tests/wasi_test_resources/test_fs/temp
wasitests-singlepass: wasitests-setup
cargo test singlepass::wasi --release $(backend_features)
wasitests-cranelift: wasitests-setup
cargo test cranelift::wasi --release $(backend_features) -- --test-threads=1
wasitests-llvm: wasitests-setup
cargo test llvm::wasi --release $(backend_features) -- --test-threads=1
wasitests-all: wasitests-setup
cargo test wasi --release $(backend_features) -- --test-threads=1
wasitests-unit: wasitests-setup
cargo test --manifest-path lib/wasi/Cargo.toml --release
wasitests: wasitests-unit wasitests-singlepass wasitests-cranelift wasitests-llvm
# Backends
singlepass: wasitests-setup
cargo test -p wasmer-singlepass-backend --release
cargo test singlepass:: --release $(backend_features) -- --test-threads=1
cranelift: wasitests-setup
cargo test -p wasmer-clif-backend --release
cargo test cranelift:: --release $(backend_features)
llvm: wasitests-setup
cargo test -p wasmer-llvm-backend --release
cargo test llvm:: --release $(backend_features) -- --test-threads=1
# All tests
capi-singlepass:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features singlepass-backend,wasi
capi-cranelift:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features cranelift-backend,wasi
capi-llvm:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features llvm-backend,wasi
capi-emscripten:
cargo build --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features singlepass-backend,emscripten
# We use cranelift as the default backend for the capi for now
capi: capi-cranelift
test-capi-singlepass: capi-singlepass
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features singlepass-backend,wasi
test-capi-cranelift: capi-cranelift
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features cranelift-backend,wasi
test-capi-llvm: capi-llvm
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features llvm-backend,wasi
test-capi-emscripten: capi-emscripten
cargo test --manifest-path lib/runtime-c-api/Cargo.toml --release \
--no-default-features --features singlepass-backend,emscripten
test-capi: test-capi-singlepass test-capi-cranelift test-capi-llvm test-capi-emscripten
capi-test: test-capi
test-rest:
cargo test --release -p wasmer-runtime
cargo test --release -p wasmer-runtime-core
cargo test --release -p wasmer-wasi-experimental-io-devices
cargo test --release -p wasmer-win-exception-handler
# This doesn't work in windows, commented for now
# cargo test --release -p wasmer-kernel-loader
# cargo test --release -p kernel-net
test: $(backends) test-rest examples
test-android:
ci/run-docker.sh x86_64-linux-android --manifest-path=lib/singlepass-backend/Cargo.toml
ci/run-docker.sh x86_64-linux-android runtime_core
# Integration tests
integration-tests: release-clif examples
echo "Running Integration Tests"
./tests/integration_tests/lua/test.sh
./tests/integration_tests/nginx/test.sh
./tests/integration_tests/cowsay/test.sh
examples:
cargo build --release $(backend_features) --examples
test -f target/release/examples/callback && ./target/release/examples/callback || echo "skipping callback test"
test -f target/release/examples/plugin && ./target/release/examples/plugin || echo "skipping plugin test"
# Utils
lint:
cargo fmt --all -- --check
precommit: lint test
debug:
cargo build --release --features "debug trace"
install:
cargo install --path .
integration-tests: release
echo "Running Integration Tests"
./integration_tests/lua/test.sh
./integration_tests/nginx/test.sh
./integration_tests/cowsay/test.sh
# Checks
check-bench-singlepass:
cargo check --benches --all singlepass \
--exclude wasmer-clif-backend --exclude wasmer-llvm-backend --exclude wasmer-kernel-loader
check-bench-clif:
cargo check --benches --all cranelift \
--exclude wasmer-singlepass-backend --exclude wasmer-llvm-backend --exclude wasmer-kernel-loader
check-bench-llvm:
cargo check --benches --all llvm \
--exclude wasmer-singlepass-backend --exclude wasmer-clif-backend --exclude wasmer-kernel-loader
lint:
cargo fmt --all -- --check
cargo +nightly-2019-05-20 clippy --all
check-bench: check-bench-singlepass check-bench-llvm
precommit: lint test
check-kernel-net:
cargo check -p kernel-net --target=wasm32-wasi
build-install:
# checks that require a nightly version of Rust
check-nightly: check-kernel-net
# TODO: We wanted `--workspace --exclude wasmer-runtime`, but can't due
# to https://github.com/rust-lang/cargo/issues/6745 .
NOT_RUNTIME_CRATES = -p wasmer-clif-backend -p wasmer-singlepass-backend -p wasmer-middleware-common -p wasmer-runtime-core -p wasmer-emscripten -p wasmer-llvm-backend -p wasmer-wasi -p wasmer-kernel-loader
RUNTIME_CHECK = cargo check --manifest-path lib/runtime/Cargo.toml --no-default-features
check: check-bench
cargo check $(NOT_RUNTIME_CRATES)
cargo check --release $(NOT_RUNTIME_CRATES)
cargo check --all-features $(NOT_RUNTIME_CRATES)
cargo check --release --all-features $(NOT_RUNTIME_CRATES)
# wasmer-runtime doesn't work with all backends enabled at once.
#
# We test using manifest-path directly so as to disable the default.
# `--no-default-features` only disables the default features in the
# current package, not the package specified by `-p`. This is
# intentional.
#
# Test default features, test 'debug' feature only in non-release
# builds, test as many combined features as possible with each backend
# as default, and test a minimal set of features with only one backend
# at a time.
cargo check --manifest-path lib/runtime-core/Cargo.toml
cargo check --manifest-path lib/runtime/Cargo.toml
# Check some of the cases where deterministic execution could matter
cargo check --manifest-path lib/runtime/Cargo.toml --features "deterministic-execution"
cargo check --manifest-path lib/runtime/Cargo.toml --no-default-features \
--features=default-backend-singlepass,deterministic-execution
cargo check --manifest-path lib/runtime/Cargo.toml --no-default-features \
--features=default-backend-llvm,deterministic-execution
cargo check --release --manifest-path lib/runtime/Cargo.toml
$(RUNTIME_CHECK) \
--features=cranelift,cache,llvm,singlepass,default-backend-singlepass
$(RUNTIME_CHECK) --release \
--features=cranelift,cache,llvm,singlepass,default-backend-singlepass
$(RUNTIME_CHECK) \
--features=cranelift,cache,llvm,singlepass,default-backend-cranelift
$(RUNTIME_CHECK) --release \
--features=cranelift,cache,llvm,singlepass,default-backend-cranelift
$(RUNTIME_CHECK) \
--features=cranelift,cache,llvm,singlepass,default-backend-llvm
$(RUNTIME_CHECK) --release \
--features=cranelift,cache,llvm,singlepass,default-backend-llvm
$(RUNTIME_CHECK) \
--features=singlepass,default-backend-singlepass
$(RUNTIME_CHECK) --release \
--features=singlepass,default-backend-singlepass
$(RUNTIME_CHECK) \
--features=cranelift,default-backend-cranelift
$(RUNTIME_CHECK) --release \
--features=cranelift,default-backend-cranelift
$(RUNTIME_CHECK) \
--features=llvm,default-backend-llvm
$(RUNTIME_CHECK) --release \
--features=llvm,default-backend-llvm
--features=default-backend-singlepass,singlepass,cranelift,llvm,cache,deterministic-execution
# Release
release:
cargo build --release $(backend_features) --features experimental-io-devices,log/release_max_level_off
# Release with musl target
release-musl:
# backend-llvm is not included due to dependency on wabt.
# experimental-io-devices is not included due to missing x11-fb.
cargo build --release --target x86_64-unknown-linux-musl --features backend-singlepass,backend-cranelift,loader-kernel,log/release_max_level_off,wasi --no-default-features
# This way of releasing is deprecated, since backends are now detected
# automatically
release-clif: release
# This way of releasing is deprecated, since backends are now detected
# automatically
release-singlepass: release
# This way of releasing is deprecated, since backends are now detected
# automatically
release-llvm: release
bench-singlepass:
# NOTE this will run some benchmarks using clif; TODO: fix this
cargo bench --all singlepass \
--exclude wasmer-clif-backend --exclude wasmer-llvm-backend --exclude wasmer-kernel-loader
bench-clif:
cargo bench --all cranelift \
--exclude wasmer-singlepass-backend --exclude wasmer-llvm-backend --exclude wasmer-kernel-loader
bench-llvm:
# NOTE this will run some benchmarks using clif; TODO: fix this
cargo bench --all llvm \
--exclude wasmer-singlepass-backend --exclude wasmer-clif-backend --exclude wasmer-kernel-loader
build-install-package:
# This command doesn't build the binary, just packages it
mkdir -p ./install/bin
cp ./wapm-cli/target/release/wapm ./install/bin/
cp ./target/release/wasmer ./install/bin/
tar -C ./install -zcvf wasmer.tar.gz bin/wapm bin/wasmer
# Create the wax binary as symlink to wapm
cd ./install/bin/ && ln -sf wapm wax && chmod +x wax
tar -C ./install -zcvf wasmer.tar.gz bin
build-capi-package:
# This command doesn't build the C-API, just packages it
mkdir -p ./capi/
mkdir -p ./capi/include
mkdir -p ./capi/lib
ifeq ($(OS), Windows_NT)
cp target/release/wasmer_runtime_c_api.dll ./capi/lib/wasmer.dll
cp target/release/wasmer_runtime_c_api.lib ./capi/lib/wasmer.lib
else
ifeq ($(UNAME_S), Darwin)
cp target/release/libwasmer_runtime_c_api.dylib ./capi/lib/libwasmer.dylib
cp target/release/libwasmer_runtime_c_api.a ./capi/lib/libwasmer.a
# Fix the rpath for the dylib
install_name_tool -id "@rpath/libwasmer.dylib" ./capi/lib/libwasmer.dylib
else
cp target/release/libwasmer_runtime_c_api.so ./capi/lib/libwasmer.so
cp target/release/libwasmer_runtime_c_api.a ./capi/lib/libwasmer.a
endif
endif
find target/release/build -name 'wasmer.h*' -exec cp {} ./capi/include ';'
cp LICENSE ./capi/LICENSE
cp lib/runtime-c-api/doc/index.md ./capi/README.md
tar -C ./capi -zcvf wasmer-c-api.tar.gz lib include README.md LICENSE
WAPM_VERSION = v0.5.0
build-wapm:
git clone --branch $(WAPM_VERSION) https://github.com/wasmerio/wapm-cli.git
cargo build --release --manifest-path wapm-cli/Cargo.toml --features "telemetry update-notifications"
# For installing the contents locally
do-install:
tar -C ~/.wasmer -zxvf wasmer.tar.gz
test:
# We use one thread so the emscripten stdouts doesn't collide
cargo test --all --exclude wasmer-runtime-c-api --exclude wasmer-emscripten --exclude wasmer-spectests --exclude wasmer-singlepass-backend --exclude wasmer-wasi --exclude wasmer-middleware-common -- $(runargs)
# cargo test --all --exclude wasmer-emscripten -- --test-threads=1 $(runargs)
cargo test --manifest-path lib/spectests/Cargo.toml --features clif
cargo test --manifest-path lib/middleware-common/Cargo.toml --features clif
@if [ ! -z "${CIRCLE_JOB}" ]; then rm -f /home/circleci/project/target/debug/deps/libcranelift_wasm* && rm -f /Users/distiller/project/target/debug/deps/libcranelift_wasm*; fi;
cargo test --manifest-path lib/spectests/Cargo.toml --features llvm
cargo test --manifest-path lib/runtime/Cargo.toml --features llvm
cargo test --manifest-path lib/middleware-common/Cargo.toml --features llvm
cargo build -p wasmer-runtime-c-api
cargo test -p wasmer-runtime-c-api -- --nocapture
test-singlepass:
cargo test --manifest-path lib/spectests/Cargo.toml --features singlepass
cargo test --manifest-path lib/runtime/Cargo.toml --features singlepass
cargo test --manifest-path lib/middleware-common/Cargo.toml --features singlepass
test-emscripten-llvm:
cargo test --manifest-path lib/emscripten/Cargo.toml --features llvm -- --test-threads=1 $(runargs)
test-emscripten-clif:
cargo test --manifest-path lib/emscripten/Cargo.toml --features clif -- --test-threads=1 $(runargs)
test-emscripten-singlepass:
cargo test --manifest-path lib/emscripten/Cargo.toml --features singlepass -- --test-threads=1 $(runargs)
test-wasi-clif:
cargo test --manifest-path lib/wasi/Cargo.toml --features "clif" -- --test-threads=1 $(runargs)
test-wasi-singlepass:
cargo test --manifest-path lib/wasi/Cargo.toml --features "singlepass" -- --test-threads=1 $(runargs)
singlepass-debug-release:
cargo +nightly build --features backend:singlepass,debug --release
singlepass-release:
cargo +nightly build --features backend:singlepass --release
singlepass-build:
cargo +nightly build --features backend:singlepass,debug
release:
# If you are in OS-X, you will need mingw-w64 for cross compiling to windows
# brew install mingw-w64
cargo build --release
production-release:
cargo build --release --features backend:singlepass,backend:llvm,loader:kernel
debug-release:
cargo build --release --features debug
extra-debug-release:
cargo build --release --features extra-debug
publish-release:
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
# cargo install cargo-deps
# must install graphviz for `dot`
dep-graph:
cargo deps --optional-deps --filter wasmer-wasi wasmer-kernel-loader wasmer-dev-utils wasmer-llvm-backend wasmer-emscripten wasmer-runtime-core wasmer-runtime wasmer-middleware-common wasmer-singlepass-backend wasmer-clif-backend wasmer --manifest-path Cargo.toml | dot -Tpng > wasmer_depgraph.png
cargo deps --optional-deps --filter wasmer-wasi wasmer-kernel-loader wasmer-llvm-backend wasmer-emscripten wasmer-runtime-core wasmer-runtime wasmer-middleware-common wasmer-singlepass-backend wasmer-clif-backend wasmer --manifest-path Cargo.toml | dot -Tpng > wasmer_depgraph.png
docs-capi:
cd lib/runtime-c-api/ && doxygen doxyfile
docs: docs-capi
cargo doc --release --features=backend-singlepass,backend-cranelift,backend-llvm,docs,wasi,managed --workspace --document-private-items --no-deps
mkdir -p api-docs
mkdir -p api-docs/c
cp -R target/doc api-docs/crates
cp -R lib/runtime-c-api/doc/html api-docs/c/runtime-c-api
echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=rust/wasmer_runtime/index.html">' > api-docs/index.html
echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=wasmer_runtime/index.html">' > api-docs/crates/index.html
docs-publish:
git clone -b "gh-pages" --depth=1 https://wasmerbot:$(GITHUB_DOCS_TOKEN)@github.com/wasmerio/wasmer.git api-docs-repo
cp -R api-docs/* api-docs-repo/
cd api-docs-repo && git add index.html crates/* c/*
cd api-docs-repo && (git diff-index --quiet HEAD || git commit -m "Publishing GitHub Pages")
cd api-docs-repo && git push origin gh-pages

274
README.md
View File

@ -1,218 +1,128 @@
<p align="center">
<div align="center">
<a href="https://wasmer.io" target="_blank" rel="noopener noreferrer">
<img width="400" src="https://raw.githubusercontent.com/wasmerio/wasmer/master/logo.png" alt="Wasmer logo">
<img width="300" src="https://raw.githubusercontent.com/wasmerio/wasmer/master/assets/logo.png" alt="Wasmer logo">
</a>
</p>
<p>
<a href="https://dev.azure.com/wasmerio/wasmer/_build/latest?definitionId=3&branchName=master">
<img src="https://img.shields.io/azure-devops/build/wasmerio/wasmer/3.svg?style=flat-square" alt="Build Status">
</a>
<a href="https://slack.wasmer.io">
<img src="https://img.shields.io/static/v1?label=Slack&message=join%20chat&color=brighgreen&style=flat-square" alt="Slack channel">
</a>
<a href="https://github.com/wasmerio/wasmer/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/wasmerio/wasmer.svg?style=flat-square" alt="License">
</a>
</p>
<p align="center">
<a href="https://circleci.com/gh/wasmerio/wasmer/">
<img src="https://img.shields.io/circleci/project/github/wasmerio/wasmer/master.svg" alt="Build Status">
</a>
<a href="https://github.com/wasmerio/wasmer/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/wasmerio/wasmer.svg" alt="License">
</a>
<a href="https://spectrum.chat/wasmer">
<img src="https://withspectrum.github.io/badge/badge.svg" alt="Join the Wasmer Community">
</a>
</p>
<h3>
<a href="https://wasmer.io/">Website</a>
<span></span>
<a href="https://docs.wasmer.io">Docs</a>
<span></span>
<a href="https://medium.com/wasmer/">Blog</a>
<span></span>
<a href="https://twitter.com/wasmerio">Twitter</a>
<span></span>
<a href="https://slack.wasmer.io/">Community Chat</a>
</h3>
## Introduction
</div>
[Wasmer](https://wasmer.io/) is a standalone JIT WebAssembly runtime, aiming to be fully compatible with [WASI](https://github.com/WebAssembly/WASI) and [Emscripten](https://emscripten.org/).
<br />
Install Wasmer with:
[Wasmer](https://wasmer.io/) is a standalone [WebAssembly](https://webassembly.org/) runtime:
* **Universal**: Wasmer is available in *Linux, macOS and Windows* (for both Desktop and [ARM](https://medium.com/wasmer/running-webassembly-on-arm-7d365ed0e50c))
* **Fast**: Wasmer aims to run WebAssembly at near-native speed
* **Pluggable**: Wasmer can be used from almost **any programming language**
* **Safe**: supporting [WASI](https://github.com/WebAssembly/WASI) and [Emscripten](https://emscripten.org/)
It is used to run software fast, universally and safely: standalone applications and universal libraries.
## Contents
- [Quickstart](#quickstart)
- [Language Integrations](#language-integrations)
- [Contribute](#contribute)
- [Community](#community)
## Quickstart
Get started with Wasmer:
#### 1. Install Wasmer
```sh
curl https://get.wasmer.io -sSfL | sh
```
> Note: *Wasmer is also [available on Windows](https://github.com/wasmerio/wasmer/releases)*
Wasmer runtime can also be embedded in different languages, so you can use WebAssembly anywhere ✨:
* [🦀 **Rust**](https://github.com/wasmerio/wasmer-rust-example)
* [**C/C++**](https://github.com/wasmerio/wasmer-c-api)
* [**🐘 PHP**](https://github.com/wasmerio/php-ext-wasm)
* [**🐍 Python**](https://github.com/wasmerio/python-ext-wasm)
* [**💎 Ruby**](https://github.com/wasmerio/ruby-ext-wasm)
* [**🐹 Go**](https://github.com/wasmerio/go-ext-wasm)
### Usage
Wasmer can execute both the standard binary format (`.wasm`) and the text
format defined by the WebAssembly reference interpreter (`.wat`).
Once installed, you will be able to run any WebAssembly files (_including Lua, PHP, SQLite and nginx!_):
<details>
<summary><b>Alternative</b>: Install with Homebrew</summary>
<p>
```sh
# Run Lua
wasmer run examples/lua.wasm
# Run PHP
wasmer run examples/php.wasm
# Run SQLite
wasmer run examples/sqlite.wasm
# Run nginx
wasmer run examples/nginx/nginx.wasm -- -p examples/nginx -c nginx.conf
brew install wasmer
```
#### With WAPM
</p>
</details>
Installing Wasmer through `wasmer.io` includes
[wapm](https://github.com/wasmerio/wapm-cli), the WebAssembly package manager.
#### 2. Use Wasmer
Wapm allows you to easily download, run, and distribute WebAssembly binaries.
Download a WASM file, and use it universally! You can start with QuickJS: [qjs.wasm](https://registry-cdn.wapm.io/contents/_/quickjs/0.0.3/build/qjs.wasm)
```sh
# Install cowsay globally
wapm install -g cowsay
# Run cowsay
wapm run cowsay "Hello, world!"
```bash
wasmer qjs.wasm
```
For more information about wapm, check out the [website](https://www.wapm.io)
and this [example program](https://github.com/wapm-packages/rust-wasi-example).
#### 3. Next steps
## Code Structure
Here is what you can do next:
Wasmer is structured into different directories:
- [Use Wasmer from your Rust application](https://docs.wasmer.io/integrations/rust)
- [Publish a Wasm package on WAPM](https://docs.wasmer.io/ecosystem/wapm/publishing-your-package)
- [Read more about Wasmer](https://medium.com/wasmer/)
- [`src`](./src): code related to the Wasmer executable itself
- [`lib`](./lib): modularized libraries that Wasmer uses under the hood
- [`examples`](./examples): some useful examples to getting started with Wasmer
## Dependencies
### Language Integrations
Building Wasmer requires [rustup](https://rustup.rs/).
Wasmer runtime can be used as a library embedded in different languages, so you can **use WebAssembly anywhere** 🎉
To build on Windows, download and run [`rustup-init.exe`](https://win.rustup.rs/)
then follow the onscreen instructions.
| &nbsp; | Language | Docs | Author(s) | Maintenance | Release | Stars |
|-|-|-|-|-|-|-|
| ![Rust logo](./assets/languages/rust.svg) | [**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">![last release](https://img.shields.io/crates/v/wasmer-runtime?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer?style=flat-square) |
| ![C logo](./assets/languages/c.svg) | [**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">![last release](https://img.shields.io/github/v/release/wasmerio/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer?style=flat-square) |
| ![Python logo](./assets/languages/python.svg) | [**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">![last release](https://img.shields.io/pypi/v/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/python-ext-wasm?style=flat-square) |
| ![Go logo](./assets/languages/go.svg) | [**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">![last release](https://img.shields.io/github/v/release/wasmerio/go-ext-wasm?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/go-ext-wasm?style=flat-square) |
| ![PHP logo](./assets/languages/php.svg) | [**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">![last release](https://img.shields.io/github/v/release/wasmerio/php-ext-wasm?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/php-ext-wasm?style=flat-square) |
| ![Ruby logo](./assets/languages/ruby.svg) | [**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">![last release](https://img.shields.io/gem/v/wasmer?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/ruby-ext-wasm?style=flat-square) |
| ![Postgres logo](./assets/languages/postgres.svg) | [**Postgres**](https://github.com/wasmerio/postgres-ext-wasm) | | Wasmer | actively developed | <a href="https://github.com/wasmerio/postgres-ext-wasm" target="_blank">![last release](https://img.shields.io/github/v/release/wasmerio/postgres-ext-wasm?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/postgres-ext-wasm?style=flat-square) |
| ![JS Logo](./assets/languages/js.svg) | [**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">![last release](https://img.shields.io/npm/v/@wasmer/wasi?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/wasmerio/wasmer-js?style=flat-square) |
| ![C# logo](./assets/languages/csharp.svg) | [**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">![last release](https://img.shields.io/nuget/v/WasmerSharp?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/migueldeicaza/WasmerSharp?style=flat-square) |
| ![R logo](./assets/languages/r.svg) | [**R**](https://github.com/dirkschumacher/wasmr) | [Docs](https://github.com/dirkschumacher/wasmr#example) | [Dirk Schumacher](https://github.com/dirkschumacher) | actively developed | | ![number of Github stars](https://img.shields.io/github/stars/dirkschumacher/wasmr?style=flat-square) |
| ![Elixir logo](./assets/languages/elixir.png) | [**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">![last release](https://img.shields.io/hexpm/v/wasmex?style=flat-square)</a> | ![number of Github stars](https://img.shields.io/github/stars/tessi/wasmex?style=flat-square) |
| ❓ | [your language is missing?](https://github.com/wasmerio/wasmer/issues/new?assignees=&labels=%F0%9F%8E%89+enhancement&template=---feature-request.md&title=) | | | | |
To build on other systems, run:
```sh
curl https://sh.rustup.rs -sSf | sh
```
## Contribute
### Other dependencies
**We welcome any form of contribution, especially from new members of our community** 💜
Please select your operating system:
You can check how to build the Wasmer runtime in [our awesome docs](https://docs.wasmer.io/ecosystem/wasmer/building-from-source)!
- [macOS](#macos)
- [Debian-based Linuxes](#debian-based-linuxes)
- [FreeBSD](#freebsd)
- [Microsoft Windows](#windows-msvc)
### Testing
#### macOS
Test you want? The [Wasmer docs will show you how](https://docs.wasmer.io/ecosystem/wasmer/building-from-source/testing).
If you have [Homebrew](https://brew.sh/) installed:
## Community
```sh
brew install cmake
```
Wasmer has an amazing community developers and contributors. Welcome, please join us! 👋
Or, in case you have [MacPorts](https://www.macports.org/install.php):
### Channels
```sh
sudo port install cmake
```
#### Debian-based Linuxes
```sh
sudo apt install cmake pkg-config libssl-dev
```
#### FreeBSD
```sh
pkg install cmake
```
#### Windows (MSVC)
Windows support is _highly experimental_. Only simple Wasm programs may be run, and no syscalls are allowed. This means
nginx and Lua do not work on Windows. See [this issue](https://github.com/wasmerio/wasmer/issues/176) regarding Emscripten syscall polyfills for Windows.
1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15)
2. Install [Rust for Windows](https://win.rustup.rs)
3. Install [Python for Windows](https://www.python.org/downloads/release/python-2714/). The Windows x86-64 MSI installer is fine.
Make sure to enable "Add python.exe to Path" during installation.
4. Install [Git for Windows](https://git-scm.com/download/win). Allow it to add `git.exe` to your PATH (default
settings for the installer are fine).
5. Install [CMake](https://cmake.org/download/). Ensure CMake is in your PATH.
6. Install [LLVM 7.0](https://prereleases.llvm.org/win-snapshots/LLVM-7.0.0-r336178-win64.exe)
## Building
Wasmer is built with [Cargo](https://crates.io/), the Rust package manager.
```sh
# checkout code
git clone https://github.com/wasmerio/wasmer.git
cd wasmer
# install tools
# make sure that `python` is accessible.
cargo install --path .
```
## Testing
Thanks to [spec tests](https://github.com/wasmerio/wasmer/tree/master/lib/spectests/spectests) we can ensure 100% compatibility with the WebAssembly spec test suite.
Tests can be run with:
```sh
make test
```
If you need to regenerate the Rust tests from the spec tests
you can run:
```sh
make spectests
```
You can also run integration tests with:
```sh
make integration-tests
```
## Benchmarking
Benchmarks can be run with:
```sh
cargo bench --all
```
## Roadmap
Wasmer is an open project guided by strong principles, aiming to be modular, flexible and fast. It is open to the community to help set its direction.
Below are some of the goals of this project (in order of priority):
- [x] It should be 100% compatible with the [WebAssembly spec tests](https://github.com/wasmerio/wasmer/tree/master/lib/spectests/spectests)
- [x] It should be fast _(partially achieved)_
- [x] Support WASI - released in [0.3.0](https://github.com/wasmerio/wasmer/releases/tag/0.3.0)
- [ ] Support Emscripten calls _(in the works)_
- [ ] Support Rust ABI calls
- [ ] Support Go ABI calls
## Architecture
If you would like to know how Wasmer works under the hood, please see [ARCHITECTURE.md](./ARCHITECTURE.md).
## License
Wasmer is primarily distributed under the terms of the [MIT license](http://opensource.org/licenses/MIT) ([LICENSE](./LICENSE)).
[ATTRIBUTIONS](./ATTRIBUTIONS.md)
- [Slack](https://slack.wasmer.io/)
- [Twitter](https://twitter.com/wasmerio)
- [Facebook](https://www.facebook.com/wasmerio)
- [Email](mailto:hello@wasmer.io)

1
assets/languages/c.svg Executable file
View File

@ -0,0 +1 @@
<svg width="20" height="22" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 22"><defs><style>.cls-1{fill:#7f8b99;}.cls-2{fill:#a9b9cb;}.cls-3{fill:#fff;}</style></defs><title>c-logo-colored</title><path class="cls-1" d="M1,17.22l2.19,1.24L16.79,3.54,11,.26a2,2,0,0,0-2,0L1,4.78A2,2,0,0,0,0,6.52v9A2,2,0,0,0,1,17.22Z"/><path class="cls-2" d="M19,4.78,16.79,3.54,3.21,18.46,9,21.74a2,2,0,0,0,2,0l8-4.52a2,2,0,0,0,1-1.74v-9A2,2,0,0,0,19,4.78Z"/><path class="cls-3" d="M12.07,9.58l3.11,0A4.84,4.84,0,0,0,10.1,5.25,5.42,5.42,0,0,0,4.48,11a5.31,5.31,0,0,0,5.62,5.66c4,0,4.94-2.86,4.94-4.38h-3a1.73,1.73,0,0,1-2,1.75c-1.91,0-2.22-2.27-2.22-3,0-1.18.42-3,2.22-3A1.86,1.86,0,0,1,12.07,9.58Z"/></svg>

After

Width:  |  Height:  |  Size: 726 B

1
assets/languages/cpp.svg Executable file
View File

@ -0,0 +1 @@
<svg width="20" height="22" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 22"><defs><style>.cls-1{fill:#659ad2;}.cls-2{fill:#0e4580;}.cls-3{fill:#035a9d;}.cls-4{fill:#fff;}</style></defs><title>c++-logo-colored</title><path class="cls-1" d="M19.72,5.5A2,2,0,0,0,19,4.77L11,.25a2,2,0,0,0-2,0L1,4.77A2,2,0,0,0,0,6.52v9a2,2,0,0,0,.28,1Z"/><path class="cls-2" d="M.28,16.5a2,2,0,0,0,.74.73l8,4.52a2,2,0,0,0,2,0l8-4.52a2,2,0,0,0,.74-.73L10,11Z"/><path class="cls-3" d="M20,6.52a2,2,0,0,0-.28-1L10,11l9.72,5.5a2,2,0,0,0,.28-1Z"/><path class="cls-4" d="M16.67,10.69h-.74V10h-.75v.73h-.74v.73h.74v.72h.75v-.72h.74Z"/><path class="cls-4" d="M19.44,10.69H18.7V10H18v.73h-.74v.73H18v.72h.74v-.72h.74Z"/><path class="cls-4" d="M12.86,12.62a3.3,3.3,0,1,1,0-3.24l2.8-1.58a6.5,6.5,0,1,0,0,6.4Z"/></svg>

After

Width:  |  Height:  |  Size: 825 B

1
assets/languages/csharp.svg Executable file
View File

@ -0,0 +1 @@
<svg width="20" height="20" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><defs><style>.cls-1{fill:#0c9438;}.cls-2{fill:#219e38;opacity:0.85;}.cls-3{opacity:0.1;isolation:isolate;}.cls-4{fill:#fff;}</style></defs><title>csharp-logo-colored</title><path class="cls-1" d="M17.07,2.93a10,10,0,0,0-14.14,0L17.07,17.07A10,10,0,0,0,17.07,2.93Z"/><path class="cls-2" d="M2.93,2.93A10,10,0,0,0,17.07,17.07Z"/><path class="cls-3" d="M1,10.23a.76.76,0,0,1,0-.15c0,.15,0,.3,0,.45Z"/><path class="cls-4" d="M9.51,13.64a4.6,4.6,0,0,1-2.19.46,3.46,3.46,0,0,1-1.46-.25A3.66,3.66,0,0,1,4.63,13a4.05,4.05,0,0,1-1-2.84,4.34,4.34,0,0,1,.26-1.64,4.2,4.2,0,0,1,.88-1.41,4,4,0,0,1,1.32-.94A3.81,3.81,0,0,1,7.65,6a4.42,4.42,0,0,1,1.84.25v1A3.72,3.72,0,0,0,7.64,6.8,2.9,2.9,0,0,0,6.44,7a2.81,2.81,0,0,0-1,.69,3.4,3.4,0,0,0-.85,2.42,3.24,3.24,0,0,0,.79,2.29,2.68,2.68,0,0,0,.94.66,2.9,2.9,0,0,0,1.13.2,4,4,0,0,0,2.05-.53Z"/><path class="cls-4" d="M16.49,8.3l-.13.58H14.93l-.35,1.65h1.55l-.15.58H14.47L14,13.3h-.69l.47-2.19H12.39l-.46,2.19h-.68l.46-2.19H10.26l.11-.58h1.46l.33-1.65H10.64l.12-.58h1.52l.46-2.21h.69L13,8.3l1.38,0,.47-2.17h.66L15.05,8.3Zm-2.24.58H12.86l-.36,1.65h1.4Z"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/languages/elixir.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
assets/languages/go.svg Executable file
View File

@ -0,0 +1 @@
<svg width="32" height="12" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 12"><defs><style>.cls-1{fill:#38b6ac;}</style></defs><title>go-logo-colored</title><path class="cls-1" d="M2.4,3.62s-.07,0,0-.09l.33-.42A.25.25,0,0,1,2.86,3H8.43c.05,0,.08,0,0,.09l-.25.4a.24.24,0,0,1-.17.09Z"/><path class="cls-1" d="M.06,5.06C0,5.06,0,5,0,5l.32-.42a.3.3,0,0,1,.17-.08H7.62a.08.08,0,0,1,.08.1L7.57,5a.15.15,0,0,1-.14.1Z"/><path class="cls-1" d="M3.84,6.49c-.06,0-.09,0-.06-.09L4,6a.2.2,0,0,1,.16-.09H7.28A.09.09,0,0,1,7.37,6l0,.37a.13.13,0,0,1-.12.11Z"/><path class="cls-1" d="M31.94,4.55a4.86,4.86,0,0,0-2.2-3.49A5.72,5.72,0,0,0,25.31.25,6.56,6.56,0,0,0,21,2.87a6.74,6.74,0,0,0-1.08,2.05h-5a.43.43,0,0,0-.38.25c-.22.41-.6,1.24-.8,1.71-.11.27,0,.47.29.47h3c-.16.22-.28.41-.43.58a2.88,2.88,0,0,1-2.65,1A2.45,2.45,0,0,1,11.8,6.49a3.36,3.36,0,0,1,1.6-3,2.69,2.69,0,0,1,2.81-.23,2,2,0,0,1,.73.6c.2.23.22.21.45.15,1-.25,1.64-.45,2.62-.69.18,0,.24-.12.18-.25A5,5,0,0,0,18.39.87,5.48,5.48,0,0,0,14.26.11,6.88,6.88,0,0,0,9.9,2.82,6.12,6.12,0,0,0,8.58,7.41a4.93,4.93,0,0,0,2,3.47,5.49,5.49,0,0,0,4.18,1,6.45,6.45,0,0,0,4.44-2.66,6.88,6.88,0,0,0,.64-1.07,5,5,0,0,0,1.54,2.43A5.77,5.77,0,0,0,25.16,12c.41-.05.78-.06,1.19-.14a7.21,7.21,0,0,0,3.79-2A6.07,6.07,0,0,0,31.94,4.55Zm-5,4.1a2.83,2.83,0,0,1-2.55.09,2.58,2.58,0,0,1-1.42-2.95,3.37,3.37,0,0,1,2.72-2.73,2.58,2.58,0,0,1,3.18,2.09c0,.16,0,.32.05.52A3.44,3.44,0,0,1,26.9,8.65Z"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

8
assets/languages/js.svg Executable file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg width="20" height="20" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
<g>
<path d="M0,0 L256,0 L256,256 L0,256 L0,0 Z" fill="#F7DF1E"></path>
<path d="M67.311746,213.932292 L86.902654,202.076241 C90.6821079,208.777346 94.1202286,214.447137 102.367086,214.447137 C110.272203,214.447137 115.256076,211.354819 115.256076,199.326883 L115.256076,117.528787 L139.313575,117.528787 L139.313575,199.666997 C139.313575,224.58433 124.707759,235.925943 103.3984,235.925943 C84.1532952,235.925943 72.9819429,225.958603 67.3113397,213.93026" fill="#000000"></path>
<path d="M152.380952,211.354413 L171.969422,200.0128 C177.125994,208.433981 183.827911,214.619835 195.684368,214.619835 C205.652521,214.619835 212.009041,209.635962 212.009041,202.762159 C212.009041,194.513676 205.479416,191.592025 194.481168,186.78207 L188.468419,184.202565 C171.111213,176.81473 159.597308,167.53534 159.597308,147.944838 C159.597308,129.901308 173.344508,116.153295 194.825752,116.153295 C210.119924,116.153295 221.117765,121.48094 229.021663,135.400432 L210.29059,147.428775 C206.166146,140.040127 201.699556,137.119289 194.826159,137.119289 C187.78047,137.119289 183.312254,141.587098 183.312254,147.428775 C183.312254,154.646349 187.78047,157.568406 198.089956,162.036622 L204.103924,164.614095 C224.553448,173.378641 236.067352,182.313448 236.067352,202.418387 C236.067352,224.071924 219.055137,235.927975 196.200432,235.927975 C173.860978,235.927975 159.425829,225.274311 152.381359,211.354413" fill="#000000"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

1
assets/languages/php.svg Executable file
View File

@ -0,0 +1 @@
<svg width="27" height="14" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 14"><title>php-logo</title><path d="M2.14,2.94h4A3.05,3.05,0,0,1,8.69,4a3.59,3.59,0,0,1,.53,2.82,5.59,5.59,0,0,1-.47,1.61,4.6,4.6,0,0,1-1,1.42,3.31,3.31,0,0,1-1.6,1,6.9,6.9,0,0,1-1.76.22H2.64L2.08,14H0ZM3.88,4.7,3,9.33h.39a7.55,7.55,0,0,0,2.39-.29c.63-.22,1.06-1,1.28-2.25.18-1.08,0-1.7-.54-1.87a6.6,6.6,0,0,0-2-.23l-.35,0H3.87Z"/><path d="M11.59,0h2.06l-.59,2.94h1.86a3.72,3.72,0,0,1,2.27.65c.51.41.66,1.19.45,2.35l-1,5.13h-2.1l1-4.9a1.44,1.44,0,0,0-.09-1.1,1.26,1.26,0,0,0-1-.32l-1.66,0L11.5,11.07H9.43Z"/><path d="M19.85,2.94h4A3.08,3.08,0,0,1,26.41,4a3.59,3.59,0,0,1,.52,2.82,5.56,5.56,0,0,1-.46,1.61,4.81,4.81,0,0,1-1,1.42,3.31,3.31,0,0,1-1.6,1,6.79,6.79,0,0,1-1.76.22H20.36L19.79,14H17.71ZM21.6,4.7l-.9,4.63h.39a7.51,7.51,0,0,0,2.39-.29q1-.33,1.29-2.25c.17-1.08,0-1.7-.54-1.87a6.67,6.67,0,0,0-2-.23l-.34,0h-.32Z"/></svg>

After

Width:  |  Height:  |  Size: 938 B

View File

@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="21px" height="22px" viewBox="0 0 432.071 445.383" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g id="orginal" style="fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;">
</g>
<g id="Layer_x0020_3" style="fill-rule:nonzero;clip-rule:nonzero;fill:none;stroke:#FFFFFF;stroke-width:12.4651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;">
<path style="fill:#000000;stroke:#000000;stroke-width:37.3953;stroke-linecap:butt;stroke-linejoin:miter;" d="M323.205,324.227c2.833-23.601,1.984-27.062,19.563-23.239l4.463,0.392c13.517,0.615,31.199-2.174,41.587-7c22.362-10.376,35.622-27.7,13.572-23.148c-50.297,10.376-53.755-6.655-53.755-6.655c53.111-78.803,75.313-178.836,56.149-203.322 C352.514-5.534,262.036,26.049,260.522,26.869l-0.482,0.089c-9.938-2.062-21.06-3.294-33.554-3.496c-22.761-0.374-40.032,5.967-53.133,15.904c0,0-161.408-66.498-153.899,83.628c1.597,31.936,45.777,241.655,98.47,178.31 c19.259-23.163,37.871-42.748,37.871-42.748c9.242,6.14,20.307,9.272,31.912,8.147l0.897-0.765c-0.281,2.876-0.157,5.689,0.359,9.019c-13.572,15.167-9.584,17.83-36.723,23.416c-27.457,5.659-11.326,15.734-0.797,18.367c12.768,3.193,42.305,7.716,62.268-20.224 l-0.795,3.188c5.325,4.26,4.965,30.619,5.72,49.452c0.756,18.834,2.017,36.409,5.856,46.771c3.839,10.36,8.369,37.05,44.036,29.406c29.809-6.388,52.6-15.582,54.677-101.107"/>
<path style="fill:#336791;stroke:none;" d="M402.395,271.23c-50.302,10.376-53.76-6.655-53.76-6.655c53.111-78.808,75.313-178.843,56.153-203.326c-52.27-66.785-142.752-35.2-144.262-34.38l-0.486,0.087c-9.938-2.063-21.06-3.292-33.56-3.496c-22.761-0.373-40.026,5.967-53.127,15.902 c0,0-161.411-66.495-153.904,83.63c1.597,31.938,45.776,241.657,98.471,178.312c19.26-23.163,37.869-42.748,37.869-42.748c9.243,6.14,20.308,9.272,31.908,8.147l0.901-0.765c-0.28,2.876-0.152,5.689,0.361,9.019c-13.575,15.167-9.586,17.83-36.723,23.416 c-27.459,5.659-11.328,15.734-0.796,18.367c12.768,3.193,42.307,7.716,62.266-20.224l-0.796,3.188c5.319,4.26,9.054,27.711,8.428,48.969c-0.626,21.259-1.044,35.854,3.147,47.254c4.191,11.4,8.368,37.05,44.042,29.406c29.809-6.388,45.256-22.942,47.405-50.555 c1.525-19.631,4.976-16.729,5.194-34.28l2.768-8.309c3.192-26.611,0.507-35.196,18.872-31.203l4.463,0.392c13.517,0.615,31.208-2.174,41.591-7c22.358-10.376,35.618-27.7,13.573-23.148z"/>
<path d="M215.866,286.484c-1.385,49.516,0.348,99.377,5.193,111.495c4.848,12.118,15.223,35.688,50.9,28.045c29.806-6.39,40.651-18.756,45.357-46.051c3.466-20.082,10.148-75.854,11.005-87.281"/>
<path d="M173.104,38.256c0,0-161.521-66.016-154.012,84.109c1.597,31.938,45.779,241.664,98.473,178.316c19.256-23.166,36.671-41.335,36.671-41.335"/>
<path d="M260.349,26.207c-5.591,1.753,89.848-34.889,144.087,34.417c19.159,24.484-3.043,124.519-56.153,203.329"/>
<path style="stroke-linejoin:bevel;" d="M348.282,263.953c0,0,3.461,17.036,53.764,6.653c22.04-4.552,8.776,12.774-13.577,23.155c-18.345,8.514-59.474,10.696-60.146-1.069c-1.729-30.355,21.647-21.133,19.96-28.739c-1.525-6.85-11.979-13.573-18.894-30.338 c-6.037-14.633-82.796-126.849,21.287-110.183c3.813-0.789-27.146-99.002-124.553-100.599c-97.385-1.597-94.19,119.762-94.19,119.762"/>
<path d="M188.604,274.334c-13.577,15.166-9.584,17.829-36.723,23.417c-27.459,5.66-11.326,15.733-0.797,18.365c12.768,3.195,42.307,7.718,62.266-20.229c6.078-8.509-0.036-22.086-8.385-25.547c-4.034-1.671-9.428-3.765-16.361,3.994z"/>
<path d="M187.715,274.069c-1.368-8.917,2.93-19.528,7.536-31.942c6.922-18.626,22.893-37.255,10.117-96.339c-9.523-44.029-73.396-9.163-73.436-3.193c-0.039,5.968,2.889,30.26-1.067,58.548c-5.162,36.913,23.488,68.132,56.479,64.938"/>
<path style="fill:#FFFFFF;stroke-width:4.155;stroke-linecap:butt;stroke-linejoin:miter;" d="M172.517,141.7c-0.288,2.039,3.733,7.48,8.976,8.207c5.234,0.73,9.714-3.522,9.998-5.559c0.284-2.039-3.732-4.285-8.977-5.015c-5.237-0.731-9.719,0.333-9.996,2.367z"/>
<path style="fill:#FFFFFF;stroke-width:2.0775;stroke-linecap:butt;stroke-linejoin:miter;" d="M331.941,137.543c0.284,2.039-3.732,7.48-8.976,8.207c-5.238,0.73-9.718-3.522-10.005-5.559c-0.277-2.039,3.74-4.285,8.979-5.015c5.239-0.73,9.718,0.333,10.002,2.368z"/>
<path d="M350.676,123.432c0.863,15.994-3.445,26.888-3.988,43.914c-0.804,24.748,11.799,53.074-7.191,81.435"/>
<path style="stroke-width:3;" d="M0,60.232"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

1
assets/languages/python.svg Executable file
View File

@ -0,0 +1 @@
<svg width="20" height="20" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><defs><style>.cls-1{fill:#387ab0;}.cls-2{fill:#feca3d;}</style></defs><title>python-logo-colored</title><path class="cls-1" d="M9.93,0C4.87,0,5.18,2.21,5.18,2.21V4.5H10v.7H3.25S0,4.82,0,10s2.84,5,2.84,5H4.53V12.56A2.71,2.71,0,0,1,7.32,9.7h4.79A2.58,2.58,0,0,0,14.8,7.08V2.67S15.23,0,9.93,0ZM7.26,1.53a.88.88,0,1,1-.87.88A.88.88,0,0,1,7.26,1.53Z"/><path class="cls-2" d="M10.07,20c5.06,0,4.75-2.21,4.75-2.21V15.5H10v-.7h6.76S20,15.18,20,10s-2.84-5-2.84-5H15.47V7.44a2.71,2.71,0,0,1-2.79,2.86H7.89A2.58,2.58,0,0,0,5.2,12.92v4.41S4.77,20,10.07,20Zm2.67-1.53a.88.88,0,1,1,.87-.88A.88.88,0,0,1,12.74,18.47Z"/></svg>

After

Width:  |  Height:  |  Size: 726 B

14
assets/languages/r.svg Normal file
View File

@ -0,0 +1,14 @@
<svg width="24" height="18" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid" viewBox="0 0 724 561">
<defs>
<linearGradient id="gradientFill-1" x1="0" x2="1" y1="0" y2="1" gradientUnits="objectBoundingBox" spreadMethod="pad">
<stop offset="0" stop-color="rgb(203,206,208)" stop-opacity="1"/>
<stop offset="1" stop-color="rgb(132,131,139)" stop-opacity="1"/>
</linearGradient>
<linearGradient id="gradientFill-2" x1="0" x2="1" y1="0" y2="1" gradientUnits="objectBoundingBox" spreadMethod="pad">
<stop offset="0" stop-color="rgb(39,109,195)" stop-opacity="1"/>
<stop offset="1" stop-color="rgb(22,92,170)" stop-opacity="1"/>
</linearGradient>
</defs>
<path d="M361.453,485.937 C162.329,485.937 0.906,377.828 0.906,244.469 C0.906,111.109 162.329,3.000 361.453,3.000 C560.578,3.000 722.000,111.109 722.000,244.469 C722.000,377.828 560.578,485.937 361.453,485.937 ZM416.641,97.406 C265.289,97.406 142.594,171.314 142.594,262.484 C142.594,353.654 265.289,427.562 416.641,427.562 C567.992,427.562 679.687,377.033 679.687,262.484 C679.687,147.971 567.992,97.406 416.641,97.406 Z" fill="url(#gradientFill-1)" fill-rule="evenodd"/>
<path d="M550.000,377.000 C550.000,377.000 571.822,383.585 584.500,390.000 C588.899,392.226 596.510,396.668 602.000,402.500 C607.378,408.212 610.000,414.000 610.000,414.000 L696.000,559.000 L557.000,559.062 L492.000,437.000 C492.000,437.000 478.690,414.131 470.500,407.500 C463.668,401.969 460.755,400.000 454.000,400.000 C449.298,400.000 420.974,400.000 420.974,400.000 L421.000,558.974 L298.000,559.026 L298.000,152.938 L545.000,152.938 C545.000,152.938 657.500,154.967 657.500,262.000 C657.500,369.033 550.000,377.000 550.000,377.000 ZM496.500,241.024 L422.037,240.976 L422.000,310.026 L496.500,310.002 C496.500,310.002 531.000,309.895 531.000,274.877 C531.000,239.155 496.500,241.024 496.500,241.024 Z" fill="url(#gradientFill-2)" fill-rule="evenodd"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

1
assets/languages/ruby.svg Executable file
View File

@ -0,0 +1 @@
<svg width="20" height="20" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><defs><style>.cls-1{fill:#b11917;}</style></defs><title>ruby-logo-colored</title><path class="cls-1" d="M2,12.84l-.42-1C1.21,11,.86,10.15.51,9.3a.08.08,0,0,1,0-.1C1.23,8,2,6.73,2.67,5.49a.61.61,0,0,1,.12-.16l3.9-3.65a.74.74,0,0,1,.21-.13L10.2.33a.11.11,0,0,1,.1,0l2.77,2s0,0,0,.09c-.47,1.48-.93,3-1.4,4.44a.41.41,0,0,1,0,.09L6.39,11.82l-.09,0L2,12.83Z"/><path class="cls-1" d="M5.12,19.94Q6,16.38,6.9,12.83l6.78,2.63-.07,0A22.89,22.89,0,0,1,11,17.58a14.7,14.7,0,0,1-4.29,2,13.17,13.17,0,0,1-1.54.33Z"/><path class="cls-1" d="M12.68,7.55l6.67-.15c-.08.19-.14.37-.22.55a18.59,18.59,0,0,1-2.54,4.3c-.54.7-1.11,1.35-1.69,2l0,0Z"/><path class="cls-1" d="M7.39,12.08l4.48-4.19,2.21,6.79Z"/><path class="cls-1" d="M15.29,15.19l0,0,.05-.05c.59-.64,1.17-1.29,1.71-2A21.07,21.07,0,0,0,19.43,9.4L19.64,9h0q-.37,4.79-.73,9.55"/><path class="cls-1" d="M19.73,6.08l-5.34-3.9,0,0L17.61.38a.06.06,0,0,1,.06,0,3.5,3.5,0,0,1,2,2A4.49,4.49,0,0,1,20,3.54a6.5,6.5,0,0,1-.12,1.92C19.81,5.66,19.77,5.86,19.73,6.08Z"/><path class="cls-1" d="M18.46,19.09,9,19.74a21.13,21.13,0,0,0,5.66-4l.42.38"/><path class="cls-1" d="M12.66,6.67c.4-1.27.8-2.53,1.19-3.8l5,3.65h0Z"/><path class="cls-1" d="M4.32,19.48c-.67-1.94-1.43-3.87-2.11-5.81L6,12.83c-.56,2.23-1.12,4.44-1.67,6.65Z"/><path class="cls-1" d="M1.64,14.4c.64,1.87,1.29,3.73,1.94,5.6l-.3,0A4.44,4.44,0,0,1,2,19.53,3.32,3.32,0,0,1,.54,18.1,4.57,4.57,0,0,1,.15,17a.19.19,0,0,1,0-.08l1.45-2.49Z"/><path class="cls-1" d="M11.33,0h5.15l0,0L13.67,1.58s-.06,0-.09,0L11.36,0Z"/><path class="cls-1" d="M0,15.47V10.35l0,.08c.39.94.79,1.89,1.18,2.84a.08.08,0,0,1,0,.1L0,15.42A.13.13,0,0,1,0,15.47Z"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

1
assets/languages/rust.svg Executable file
View File

@ -0,0 +1 @@
<svg width="22" height="22" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><title>rust-logo</title><path d="M21.85,10.73l-.92-.57,0-.27.79-.74a.34.34,0,0,0,.1-.3.33.33,0,0,0-.2-.23l-1-.38A2,2,0,0,0,20.49,8l.64-.88a.34.34,0,0,0,0-.31.31.31,0,0,0-.24-.19l-1.07-.18c0-.08-.08-.16-.13-.24l.45-1a.31.31,0,0,0-.3-.45l-1.08,0-.18-.21.25-1.06a.31.31,0,0,0-.38-.38l-1.06.25a1.73,1.73,0,0,0-.21-.17l0-1.09a.32.32,0,0,0-.14-.28.31.31,0,0,0-.31,0l-1,.45-.24-.13L15.4,1.08a.31.31,0,0,0-.19-.24.34.34,0,0,0-.31,0L14,1.51l-.26-.08-.38-1a.33.33,0,0,0-.23-.2.34.34,0,0,0-.3.1l-.74.79-.27,0L11.27.15a.32.32,0,0,0-.54,0l-.57.92-.27,0L9.15.31a.32.32,0,0,0-.53.1l-.38,1L8,1.51,7.1.87a.32.32,0,0,0-.5.21L6.42,2.15l-.24.13-1-.45a.31.31,0,0,0-.31,0,.32.32,0,0,0-.14.28l0,1.09-.21.17L3.52,3.14a.31.31,0,0,0-.38.38l.25,1.06-.17.21-1.09,0a.32.32,0,0,0-.28.14.31.31,0,0,0,0,.31l.45,1-.13.24L1.08,6.6a.31.31,0,0,0-.24.19.34.34,0,0,0,0,.31L1.51,8a2,2,0,0,0-.08.26l-1,.38a.33.33,0,0,0-.2.23.34.34,0,0,0,.1.3l.79.74,0,.27-.92.57a.32.32,0,0,0,0,.54l.92.57,0,.27-.79.74a.34.34,0,0,0-.1.3.33.33,0,0,0,.2.23l1,.38a2,2,0,0,0,.08.26l-.64.88a.34.34,0,0,0,0,.31.31.31,0,0,0,.24.19l1.07.18.13.24-.45,1a.31.31,0,0,0,0,.31.32.32,0,0,0,.28.14l1.09,0a1.73,1.73,0,0,0,.17.21l-.25,1.06a.31.31,0,0,0,.38.38l1.06-.25.21.17,0,1.09a.32.32,0,0,0,.14.28.31.31,0,0,0,.31,0l1-.45.24.13.18,1.07a.31.31,0,0,0,.19.24.34.34,0,0,0,.31,0L8,20.49l.26.08.38,1a.33.33,0,0,0,.23.2.34.34,0,0,0,.3-.1l.74-.79.27,0,.57.92a.32.32,0,0,0,.54,0l.57-.92.27,0,.74.79a.34.34,0,0,0,.3.1.33.33,0,0,0,.23-.2l.38-1,.26-.08.88.64a.34.34,0,0,0,.31,0,.31.31,0,0,0,.19-.24l.18-1.07.24-.13,1,.45a.31.31,0,0,0,.31,0,.32.32,0,0,0,.14-.28l0-1.09a1.73,1.73,0,0,0,.21-.17l1.06.25a.31.31,0,0,0,.38-.38l-.25-1.06.18-.21,1.08,0a.31.31,0,0,0,.3-.45l-.45-1c.05-.08.09-.16.13-.24l1.07-.18a.31.31,0,0,0,.24-.19.34.34,0,0,0,0-.31L20.49,14a2,2,0,0,0,.08-.26l1-.38a.33.33,0,0,0,.2-.23.34.34,0,0,0-.1-.3l-.79-.74,0-.27.92-.57a.32.32,0,0,0,0-.54Zm-6.18,7.66a.65.65,0,0,1,.27-1.28.66.66,0,0,1,.5.78A.64.64,0,0,1,15.67,18.39Zm-.32-2.12a.59.59,0,0,0-.7.46l-.33,1.53A8,8,0,0,1,11,19a8.16,8.16,0,0,1-3.39-.74L7.28,16.7a.58.58,0,0,0-.7-.46l-1.35.29a7.88,7.88,0,0,1-.7-.83H11.1c.08,0,.12,0,.12-.08V13.3c0-.07,0-.08-.12-.08H9.18V11.74h2.08a1.32,1.32,0,0,1,1.28,1.11c.08.33.26,1.38.38,1.72s.63,1.13,1.17,1.13h3.39a10.43,10.43,0,0,1-.74.88ZM6.26,18.36a.64.64,0,0,1-.77-.5.65.65,0,0,1,.5-.78.65.65,0,0,1,.27,1.28ZM3.77,8.25a.65.65,0,1,1-.86-.33A.64.64,0,0,1,3.77,8.25ZM3,10.07l1.41-.63a.59.59,0,0,0,.3-.79L4.42,8H5.56v5.14H3.26A8.54,8.54,0,0,1,3,10.07Zm6.18-.5V8.05h2.71c.14,0,1,.16,1,.8s-.65.72-1.18.72ZM19,10.93c0,.2,0,.4,0,.6H18.2c-.09,0-.12.05-.12.13V12c0,.89-.5,1.09-.94,1.14s-.89-.18-.95-.44a2.81,2.81,0,0,0-1.31-2.2,3,3,0,0,0,1.65-2.29,2.59,2.59,0,0,0-1.26-2.12,3.63,3.63,0,0,0-1.73-.57H5A8.07,8.07,0,0,1,9.51,3l1,1.06a.6.6,0,0,0,.85,0L12.48,3A8.07,8.07,0,0,1,18,6.94l-.77,1.74a.59.59,0,0,0,.3.79l1.48.66A7,7,0,0,1,19,10.93Zm-8.53-8.8a.66.66,0,0,1,.93,0,.65.65,0,0,1,0,.92.66.66,0,0,1-.93,0A.65.65,0,0,1,10.51,2.13Zm7.65,6.15A.65.65,0,0,1,19,8a.65.65,0,1,1-.86.33Z"/></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="20px" height="18px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 36" version="1.1">
<defs>
<linearGradient id="a" x2="50%" x1="50%" y2="100%">
<stop stop-color="#F88A36" offset="0"/>
<stop stop-color="#FD2020" offset="1"/>
</linearGradient>
</defs>
<path d="m29.885 33.047c-4.667 2.696-11.084 2.973-17.54 0.206-5.2273-2.224-9.5646-6.117-12.345-10.565 1.3346 1.112 2.8916 2.002 4.5598 2.78 6.6672 3.125 13.333 2.911 18.024 0.008-0.003-0.003-0.005-0.005-0.007-0.008-6.673-5.116-12.345-11.789-16.571-17.238-0.8901-0.8898-1.5574-2.002-2.2247-3.0029 5.1159 4.671 13.235 10.565 16.126 12.234-6.116-6.451-11.566-14.458-11.344-14.236 9.676 9.787 18.685 15.348 18.685 15.348 0.298 0.168 0.528 0.308 0.713 0.433 0.195-0.496 0.366-1.011 0.51-1.545 1.557-5.672-0.222-12.123-4.115-17.461 9.008 5.4495 14.347 15.681 12.122 24.245-0.058 0.231-0.121 0.459-0.189 0.683 0.026 0.031 0.052 0.063 0.078 0.096 4.448 5.561 3.225 11.455 2.669 10.343-2.413-4.722-6.88-3.278-9.151-2.32z" fill="url(#a)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

340
azure-pipelines.yml Normal file
View File

@ -0,0 +1,340 @@
name: $(Build.SourceBranch)-$(date:yyyyMMdd)$(rev:.r)
# The Different jobs (lint, test, build to run)
jobs:
- job: changelog
steps:
- bash: |
git --no-pager diff --name-only HEAD $(git merge-base HEAD master) --exit-code CHANGELOG.md
displayName: Changelog Updated
- job: lint
pool:
vmImage: "macos-10.14"
steps:
- checkout: self
- template: .azure/install-rust.yml
- script: |
rustup component add rustfmt
displayName: Lint dependencies
- script: cargo fmt --all -- --check
displayName: Lint
variables:
rust_toolchain: '1.41.1'
- job: clippy_lint
pool:
vmImage: "ubuntu-16.04"
steps:
- checkout: self
- 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:
poolName: "Azure Pipelines"
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
android:
poolName: "Azure Pipelines"
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
ANDROID: true
mac:
poolName: "Azure Pipelines"
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
# By default schannel checks revocation of certificates unlike some other SSL
# backends, but we've historically had problems on CI where a revocation
# server goes down presumably. See #43333 for more info
CARGO_HTTP_CHECK_REVOKE: false
arm:
poolName: "Packet"
rust_toolchain: nightly-2019-12-19
windows:
poolName: "Azure Pipelines"
imageName: "vs2017-win2016"
rust_toolchain: '1.41.1'
pool:
name: $(poolName)
vmImage: $(imageName)
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
hostname
uname -a
displayName: System info (*nix)
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: |
cat /proc/cpuinfo
cat /proc/meminfo
displayName: System info - Extended (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
sysctl -a | grep machdep.cpu
displayName: System info - Extended (Mac)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: make test
displayName: Tests (*nix)
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')), not(variables['ANDROID']))
- bash: make test-android
displayName: Tests (Android)
condition: and(succeeded(), variables['ANDROID'])
- bash: make spectests
displayName: Tests (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), not(variables['ANDROID']))
- job: Check
pool:
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
make check
make check-nightly
displayName: Check with Flags
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- job: Build_CLI
strategy:
matrix:
linux:
poolName: "Azure Pipelines"
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
poolName: "Azure Pipelines"
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
MACOSX_DEPLOYMENT_TARGET: 10.10
arm:
poolName: "Packet"
rust_toolchain: nightly-2019-12-19
windows:
poolName: "Azure Pipelines"
imageName: "vs2017-win2016"
rust_toolchain: '1.41.1'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
name: $(poolName)
vmImage: $(imageName)
condition: |
or(
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying'),
startsWith(variables['Build.SourceBranch'], 'refs/tags')
)
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- template: .azure/install-innosetup.yml
- bash: |
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: make release
displayName: Build
- bash: sudo apt-get install musl-tools && make release-musl
displayName: Build (Linux Musl)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OSArchitecture'], 'X64'))
- bash: |
make build-wapm
displayName: Build WAPM
condition: |
startsWith(variables['Build.SourceBranch'], 'refs/tags')
- bash: |
make build-install-package
cp ./wasmer.tar.gz ./artifacts/$(./scripts/binary-name.sh)
displayName: Build Distribution (*nix)
condition: |
and(
succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/tags'),
not(eq(variables['Agent.OS'], 'Windows_NT'))
)
- bash: |
cd ./src/installer
iscc wasmer.iss
cp WasmerInstaller.exe ../../artifacts/wasmer-windows.exe
displayName: Build Distribution (Windows)
condition: |
and(
succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/tags'),
eq(variables['Agent.OS'], 'Windows_NT')
)
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: cli-$(Agent.OS)-$(Agent.OSArchitecture)
- job: Build_Library
strategy:
matrix:
linux:
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
MACOSX_DEPLOYMENT_TARGET: 10.10
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.41.1'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
vmImage: $(imageName)
condition: |
or(
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying'),
startsWith(variables['Build.SourceBranch'], 'refs/tags')
)
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: |
make test-capi
displayName: Test c-api
condition: and(succeeded(), eq(variables['Agent.OSArchitecture'], 'X64'), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: |
make capi
displayName: Build c-api
- bash: |
make build-capi-package
cp ./wasmer-c-api.tar.gz ./artifacts/$(./scripts/capi-name.sh)
displayName: Build c-api artifacts (Unix)
condition: |
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Windows_NT'))
)
- bash: |
make build-capi-package
cp ./wasmer-c-api.tar.gz ./artifacts/wasmer-c-api-windows.tar.gz
displayName: Build c-api artifacts (Windows)
condition: |
and(
succeeded(),
eq(variables['Agent.OS'], 'Windows_NT')
)
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: library-$(Agent.OS)-$(Agent.OSArchitecture)
- job: Build_Docs
pool:
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
sudo apt-get install doxygen graphviz
displayName: Install doxygen
- bash: |
make docs
displayName: Build docs
- publish: $(System.DefaultWorkingDirectory)/api-docs
artifact: api-docs
displayName: Save Docs artifact
- job: Publish
dependsOn:
- Build_CLI
- Build_Library
condition: |
startsWith(variables['Build.SourceBranch'], 'refs/tags')
steps:
# - download: current
- task: DownloadPipelineArtifact@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
ls $ARTIFACT_STAGING_DIRECTORY
displayName: List Artifacts
env:
ARTIFACT_STAGING_DIRECTORY: $(Build.ArtifactStagingDirectory)
- script: VERSION_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG"
displayName: Set the tag name as an environment variable
- task: GithubRelease@0
displayName: "Create GitHub Release with artifacts"
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
inputs:
gitHubConnection: 'wasmer'
repositoryName: 'wasmerio/wasmer'
action: 'create'
target: '$(Build.SourceVersion)'
title: '$(VERSION_TAG)'
addChangeLog: false
tagSource: 'auto'
# TODO: automate it all by getting the release notes from somewhere else and using the `releaseNotesFile` key
isDraft: false
isPreRelease: false
assets: '$(Build.ArtifactStagingDirectory)/**'
assetUploadMode: 'replace' # Don't delete previously uploaded assets (default)
- job: Publish_Docs
dependsOn:
- Build_Docs
displayName: Deploy API Documentation to GitHub
pool:
vmImage: "ubuntu-16.04"
condition: in(variables['Build.SourceBranch'], 'refs/heads/master')
steps:
- checkout: self
- task: DownloadPipelineArtifact@2
inputs:
artifactName: api-docs
targetPath: $(System.DefaultWorkingDirectory)/api-docs
- bash: |
git config --global user.email "bot@wasmer.io"
git config --global user.name "wasmerbot"
make docs-publish
env:
RUST_DOCS_DIR: $(Pipeline.Workspace)/api-docs
GITHUB_DOCS_TOKEN: $(GITHUB_DOCS_TOKEN)
SOURCE_VERSION: $(Build.SourceVersion)
# We only run the pipelines on PRs to Master
pr:
- master
# Otherwise, we test in any of these branches (master or bors related)
trigger:
- master
- staging
- trying
- refs/tags/*

View File

@ -133,23 +133,22 @@ static WAT_GAS: &'static str = r#"
(elem (i32.const 0) $f2))
"#;
#[cfg(feature = "llvm")]
#[cfg(feature = "backend-llvm")]
fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
use wasmer_llvm_backend::code::LLVMModuleCodeGenerator;
use wasmer_llvm_backend::ModuleCodeGenerator;
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
let c: StreamingCompiler<LLVMModuleCodeGenerator, _, _, _, _> =
StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new();
if metering {
chain.push(Metering::new(limit));
}
chain
});
let c: StreamingCompiler<ModuleCodeGenerator, _, _, _, _> = StreamingCompiler::new(move || {
let mut chain = MiddlewareChain::new();
if metering {
chain.push(Metering::new(limit));
}
chain
});
c
}
#[cfg(feature = "singlepass")]
#[cfg(feature = "backend-singlepass")]
fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
@ -163,16 +162,16 @@ fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
c
}
#[cfg(not(any(feature = "llvm", feature = "clif", feature = "singlepass")))]
fn get_compiler(_limit: u64, metering: bool) -> impl Compiler {
panic!("compiler not specified, activate a compiler via features");
use wasmer_clif_backend::CraneliftCompiler;
CraneliftCompiler::new()
}
#[cfg(not(any(
feature = "backend-llvm",
feature = "backend-cranelift",
feature = "backend-singlepass"
)))]
compile_error!("compiler not specified, activate a compiler via features");
#[cfg(feature = "clif")]
#[cfg(feature = "backend-cranelift")]
fn get_compiler(_limit: u64, metering: bool) -> impl Compiler {
panic!("cranelift does not implement metering");
unimplemented!("cranelift does not implement metering");
use wasmer_clif_backend::CraneliftCompiler;
CraneliftCompiler::new()
}
@ -194,8 +193,8 @@ fn bench_metering(c: &mut Criterion) {
let wasm_binary = wat2wasm(WAT).unwrap();
let module = compile_with(&wasm_binary, &compiler).unwrap();
let import_object = imports! {};
let mut instance = module.instantiate(&import_object).unwrap();
let add_to: Func<(i32, i32), i32> = instance.func("add_to").unwrap();
let instance = module.instantiate(&import_object).unwrap();
let add_to: Func<(i32, i32), i32> = instance.exports.get("add_to").unwrap();
b.iter(|| black_box(add_to.call(100, 4)))
})
.with_function("Gas Metering", |b| {
@ -207,8 +206,8 @@ fn bench_metering(c: &mut Criterion) {
"gas" => Func::new(gas),
},
};
let mut gas_instance = gas_module.instantiate(&gas_import_object).unwrap();
let gas_add_to: Func<(i32, i32), i32> = gas_instance.func("add_to").unwrap();
let gas_instance = gas_module.instantiate(&gas_import_object).unwrap();
let gas_add_to: Func<(i32, i32), i32> = gas_instance.exports.get("add_to").unwrap();
b.iter(|| black_box(gas_add_to.call(100, 4)))
})
.with_function("Built-in Metering", |b| {
@ -220,11 +219,14 @@ fn bench_metering(c: &mut Criterion) {
.instantiate(&metering_import_object)
.unwrap();
metering::set_points_used(&mut metering_instance, 0u64);
let metering_add_to: Func<(i32, i32), i32> = metering_instance.func("add_to").unwrap();
let metering_add_to: Func<(i32, i32), i32> =
metering_instance.exports.get("add_to").unwrap();
b.iter(|| black_box(metering_add_to.call(100, 4)))
}),
);
}
#[cfg(not(feature = "backend-cranelift"))]
criterion_group!(benches, bench_metering);
#[cfg(not(feature = "backend-cranelift"))]
criterion_main!(benches);

View File

@ -1,10 +1,6 @@
status = [
"ci/circleci: lint",
"ci/circleci: test",
"ci/circleci: test-macos",
"ci/circleci: test-rust-nightly",
"continuous-integration/appveyor/branch"
"wasmerio.wasmer"
]
required_approvals = 1
timeout_sec = 900
timeout_sec = 7200
delete_merged_branches = true

137
build.rs Normal file
View File

@ -0,0 +1,137 @@
//! A kind of meta-build.rs that can be configured to do different things.
//!
//! Please try to keep this file as clean as possible.
use generate_emscripten_tests;
use generate_wasi_tests;
use std::env;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
use test_generator::{
build_ignores_from_textfile, emscripten_processor, test_directory, test_directory_module,
wasi_processor, wast_processor, with_backends, with_test_module, Testsuite,
};
static EMTESTS_ENV_VAR: &str = "WASM_EMSCRIPTEN_GENERATE_EMTESTS";
static WASITESTS_ENV_VAR: &str = "WASM_WASI_GENERATE_WASITESTS";
static WASITESTS_SET_UP_TOOLCHAIN: &str = "WASM_WASI_SET_UP_TOOLCHAIN";
static WASITESTS_GENERATE_ALL: &str = "WASI_TEST_GENERATE_ALL";
fn is_truthy_env(name: &str) -> bool {
env::var(name).map(|n| n == "1").unwrap_or_default()
}
fn main() -> anyhow::Result<()> {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=test/ignores.txt");
println!("cargo:rerun-if-env-changed={}", EMTESTS_ENV_VAR);
println!("cargo:rerun-if-env-changed={}", WASITESTS_ENV_VAR);
println!("cargo:rerun-if-env-changed={}", WASITESTS_SET_UP_TOOLCHAIN);
println!("cargo:rerun-if-env-changed={}", WASITESTS_GENERATE_ALL);
let wasi_versions = if is_truthy_env(WASITESTS_GENERATE_ALL) {
generate_wasi_tests::ALL_WASI_VERSIONS
} else {
generate_wasi_tests::LATEST_WASI_VERSION
};
// Install the Rust WASI toolchains for each of the versions
if is_truthy_env(WASITESTS_SET_UP_TOOLCHAIN) {
generate_wasi_tests::install_toolchains(wasi_versions);
}
// Generate the WASI Wasm files
if is_truthy_env(WASITESTS_ENV_VAR) {
generate_wasi_tests::build(wasi_versions);
}
// Generate Emscripten Wasm files
if is_truthy_env(EMTESTS_ENV_VAR) {
generate_emscripten_tests::build();
}
let out_dir = PathBuf::from(
env::var_os("OUT_DIR").expect("The OUT_DIR environment variable must be set"),
);
let ignores = build_ignores_from_textfile("tests/ignores.txt".into())?;
// Spectests test generation
let mut spectests = Testsuite {
buffer: String::new(),
path: vec![],
ignores: ignores.clone(),
};
let backends = vec!["singlepass", "cranelift", "llvm"];
with_backends(&mut spectests, &backends, |mut spectests| {
with_test_module(&mut spectests, "spec", |mut spectests| {
let _spec_tests = test_directory(spectests, "tests/spectests", wast_processor)?;
with_test_module(&mut spectests, "custom", |spectests| {
let _spec_tests = test_directory(spectests, "tests/custom", wast_processor)?;
Ok(())
})?;
Ok(())
})?;
Ok(())
})?;
// Emscripten tests generation
let mut emtests = Testsuite {
buffer: String::new(),
path: vec![],
ignores: ignores.clone(),
};
with_backends(&mut emtests, &backends, |mut emtests| {
with_test_module(&mut emtests, "emscripten", |emtests| {
let _emscripten_tests = test_directory(
emtests,
"tests/emscripten_resources/emtests",
emscripten_processor,
)?;
Ok(())
})?;
Ok(())
})?;
// WASI tests generation
let mut wasitests = Testsuite {
buffer: String::new(),
path: vec![],
ignores: ignores.clone(),
};
with_backends(&mut wasitests, &backends, |mut wasitests| {
with_test_module(&mut wasitests, "wasi", |wasitests| {
test_directory_module(
wasitests,
"tests/wasi_test_resources/unstable",
wasi_processor,
)?;
test_directory_module(
wasitests,
"tests/wasi_test_resources/snapshot1",
wasi_processor,
)?;
Ok(())
})?;
Ok(())
})?;
let spectests_output = out_dir.join("generated_spectests.rs");
fs::write(&spectests_output, spectests.buffer)?;
let emtests_output = out_dir.join("generated_emtests.rs");
fs::write(&emtests_output, emtests.buffer)?;
let wasitests_output = out_dir.join("generated_wasitests.rs");
fs::write(&wasitests_output, wasitests.buffer)?;
// Write out our auto-generated tests and opportunistically format them with
// `rustfmt` if it's installed.
// Note: We need drop because we don't want to run `unwrap` or `expect` as
// the command might fail, but we don't care about it's result.
drop(Command::new("rustfmt").arg(&spectests_output).status());
drop(Command::new("rustfmt").arg(&emtests_output).status());
drop(Command::new("rustfmt").arg(&wasitests_output).status());
Ok(())
}

3
ci/README.md Normal file
View File

@ -0,0 +1,3 @@
# About this directory
This directory is originally copied from [rust-lang/libc/ci](https://github.com/rust-lang/libc/tree/master/ci).

19
ci/android-install-ndk.sh Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env sh
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
NDK=android-ndk-r19c
curl --retry 20 -O https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
unzip -q -d ndk ${NDK}-linux-x86_64.zip
mv ./ndk/"$NDK"/* ./ndk/
rm -rf ./${NDK}-linux-x86_64.zip

73
ci/android-install-sdk.sh Normal file
View File

@ -0,0 +1,73 @@
#!/usr/bin/env sh
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
# Prep the SDK and emulator
#
# Note that the update process requires that we accept a bunch of licenses, and
# we can't just pipe `yes` into it for some reason, so we take the same strategy
# located in https://github.com/appunite/docker by just wrapping it in a script
# which apparently magically accepts the licenses.
SDK=4333796
mkdir sdk
curl --retry 20 https://dl.google.com/android/repository/sdk-tools-linux-${SDK}.zip -O
unzip -q -d sdk sdk-tools-linux-${SDK}.zip
case "$1" in
arm | armv7)
api=24
image="system-images;android-${api};google_apis;armeabi-v7a"
;;
aarch64)
api=24
image="system-images;android-${api};google_apis;arm64-v8a"
;;
i686)
api=28
image="system-images;android-${api};default;x86"
;;
x86_64)
api=28
image="system-images;android-${api};default;x86_64"
;;
*)
echo "invalid arch: $1"
exit 1
;;
esac;
# Try to fix warning about missing file.
# See https://askubuntu.com/a/1078784
mkdir -p /root/.android/
echo '### User Sources for Android SDK Manager' >> /root/.android/repositories.cfg
echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg
# Print all available packages
# yes | ./sdk/tools/bin/sdkmanager --list --verbose
# --no_https avoids
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
#
# | grep -v = || true removes the progress bar output from the sdkmanager
# which produces an insane amount of output.
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
yes | ./sdk/tools/bin/sdkmanager --no_https \
"emulator" \
"platform-tools" \
"platforms;android-${api}" \
"${image}" | grep -v = || true
echo "no" |
./sdk/tools/bin/avdmanager create avd \
--name "${1}" \
--package "${image}" | grep -v = || true

56
ci/android-sysimage.sh Normal file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
set -ex
URL=https://dl.google.com/android/repository/sys-img/android
main() {
local arch="${1}"
local name="${2}"
local dest=/system
local td
td="$(mktemp -d)"
apt-get install --no-install-recommends e2tools
pushd "${td}"
curl --retry 5 -O "${URL}/${name}"
unzip -q "${name}"
local system
system="$(find . -name system.img)"
mkdir -p ${dest}/{bin,lib,lib64}
# Extract android linker and libraries to /system
# This allows android executables to be run directly (or with qemu)
if [ "${arch}" = "x86_64" ] || [ "${arch}" = "arm64" ]; then
e2cp -p "${system}:/bin/linker64" "${dest}/bin/"
e2cp -p "${system}:/lib64/libdl.so" "${dest}/lib64/"
e2cp -p "${system}:/lib64/libc.so" "${dest}/lib64/"
e2cp -p "${system}:/lib64/libm.so" "${dest}/lib64/"
else
e2cp -p "${system}:/bin/linker" "${dest}/bin/"
e2cp -p "${system}:/lib/libdl.so" "${dest}/lib/"
e2cp -p "${system}:/lib/libc.so" "${dest}/lib/"
e2cp -p "${system}:/lib/libm.so" "${dest}/lib/"
fi
# clean up
apt-get purge --auto-remove -y e2tools
popd
rm -rf "${td}"
}
main "${@}"

View File

@ -0,0 +1,53 @@
FROM ubuntu:19.10
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python \
unzip \
expect \
openjdk-8-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
libc6-dev \
make \
cmake # cmake is necessary to build wabt
WORKDIR /android/
COPY android* /android/
ENV ANDROID_ARCH=aarch64
ENV PATH=$PATH:/android/sdk/tools:/android/sdk/platform-tools
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
ENV ANDROID_NDK_HOME=/android/ndk
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin \
CARGO_TARGET_AARCH64_LINUX_ANDROID_AR=aarch64-linux-android-ar \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android28-clang++ \
CC_aarch64_linux_android=aarch64-linux-android28-clang \
CXX_aarch64_linux_android=aarch64-linux-android28-clang++ \
CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \
HOME=/tmp
ADD runtest-android.rs /tmp/runtest.rs
ENTRYPOINT [ \
"bash", \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
"SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
]

View File

@ -0,0 +1,32 @@
FROM ubuntu:19.10
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
g++ \
libc-dev \
python \
unzip \
make \
cmake # cmake is necessary to build wabt
WORKDIR /android/
ENV ANDROID_ARCH=x86_64
COPY android-install-ndk.sh /android/
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
ENV ANDROID_NDK_HOME=/android/ndk/
# We do not run x86_64-linux-android tests on an android emulator.
# See ci/android-sysimage.sh for informations about how tests are run.
COPY android-sysimage.sh /android/
RUN bash /android/android-sysimage.sh x86_64 x86_64-24_r07.zip
ENV PATH=$PATH:/rust/bin:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin \
CARGO_TARGET_X86_64_LINUX_ANDROID_AR=x86_64-linux-android-ar \
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android28-clang++ \
CC_x86_64_linux_android=x86_64-linux-android28-clang \
CXX_x86_64_linux_android=x86_64-linux-android28-clang++ \
LD_LIBRARY_PATH=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/ \
HOME=/tmp

35
ci/run-docker.sh Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env sh
# Small script to run tests for a target (or all targets) inside all the
# respective docker images.
set -e
echo "${HOME}"
pwd
TARGET="${1}"
shift
echo "Building docker container for target $target"
# use -f so we can use ci/ as build context
image_tag=test-"$TARGET"
docker build -t "$image_tag" -f "ci/docker/${TARGET}/Dockerfile" ci/
mkdir -p target
set -x
docker run \
--rm \
--user "$(id -u)":"$(id -g)" \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
--volume "$(dirname "$(dirname "$(command -v cargo)")")":/cargo \
--volume "$(rustc --print sysroot)":/rust:ro \
--volume "$(pwd)":/checkout:ro \
--volume "$(pwd)"/target:/checkout/target \
--init \
--workdir /checkout \
"$image_tag" \
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec cargo test --target ${TARGET} $@"

60
ci/runtest-android.rs Normal file
View File

@ -0,0 +1,60 @@
use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;
fn main() {
let args = env::args_os()
.skip(1)
.filter(|arg| arg != "--quiet")
.collect::<Vec<_>>();
assert_eq!(args.len(), 1);
let test = PathBuf::from(&args[0]);
// required to run an executable depending on wabt-rs
let android_ndk_home = env::var("ANDROID_NDK_HOME").expect("Can't get ANDROID_NDK_HOME!");
let path = format!("{}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so", android_ndk_home);
let libcpp_shared = Path::new(&path);
let dst = Path::new("/data/local/tmp");
let dst_exec = Path::new("/data/local/tmp").join(test.file_name().unwrap());
let status = Command::new("adb")
.arg("wait-for-device")
.status()
.expect("failed to run: adb wait-for-device");
assert!(status.success());
let status = Command::new("adb")
.arg("push")
.arg(&test)
.arg(&libcpp_shared)
.arg(&dst)
.status()
.expect("failed to run: adb pushr");
assert!(status.success());
let output = Command::new("adb")
.arg("shell")
.arg("LD_LIBRARY_PATH=/data/local/tmp/")
.arg(&dst_exec)
.output()
.expect("failed to run: adb shell");
assert!(status.success());
println!(
"status: {}\nstdout ---\n{}\nstderr ---\n{}",
output.status,
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr)
);
let stdout = String::from_utf8_lossy(&output.stdout);
stdout
.lines()
.find(|l| {
(l.starts_with("PASSED ") && l.contains(" tests")) || l.starts_with("test result: ok")
})
.unwrap_or_else(|| {
panic!("failed to find successful test run");
});
}

View File

@ -1,39 +0,0 @@
# Dockerfile Documentation
The `Dockerfile` included in the project root directory could be used for development purposes or to build a small image containing the `wasmer` executable.
The `wasmer-build-env` stage in the Dockerfile contains the dependencies needed to compile Wasmer including LLVM.
The `wasmer-debug-env` stage adds the `valgrind` profiling tool to the `wasmer-build-env` stage.
The `wasmer-build` stage in the Dockerfile will copy the current directory, assuming the build context is the `wasmer` project, and build the project using `cargo build --release`.
The `wasmer` stage will copy the resulting `wasmer` executable from the `wasmer-build` stage into a new base image to create a smaller image containing `wasmer`.
## Example Usages
### Wasmer image
1. From the `wasmer` project directory, build the image:
`docker build -t wasmer --target=wasmer .`
2. List options:
`docker run wasmer --help`
3. Mount a directory, and run an example wasm file:
`docker run -v /Users/admin/Documents/wasmer-workspace:/root/wasmer-workspace wasmer run /root/wasmer-workspace/examples/hello.wasm`
### Profiling
1. Build `wasmer-debug-env`:
`docker build --tag=wasmer-debug-env --target wasmer-debug-env .`
2. Mount a directory from the host and run interactively:
`docker run -it -v /Users/admin/Documents/wasmer-workspace:/home/circleci/wasmer-workspace wasmer-debug-env /bin/bash`
3. Inside the container, build `wasmer` and run profiling tool:
```
cd /home/circleci/wasmer-workspace/wasmer`
cargo build
valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes --simulate-cache=yes target/debug/wasmer run test.wasm
```
The `callgrind.out` can be viewed with the `qcachegrind` tool on Mac OS (`brew install qcachegrind`).

View File

@ -0,0 +1,5 @@
# Call back guest
This is part of the `callback` example. This Wasm module passes host imports and its own functions to the Wasm host to execute.
See `examples/callback.rs` for the host

View File

@ -0,0 +1,24 @@
extern "C" {
fn call_guest_fn(f: u32) -> u32;
fn call_guest_fn2(f: u32) -> u32;
fn host_callback() -> u32;
}
#[no_mangle]
fn test_callback() -> u32 {
42
}
#[no_mangle]
fn test_callback2() -> u32 {
45
}
fn main() {
unsafe { call_guest_fn(test_callback as usize as u32) };
unsafe { call_guest_fn(host_callback as usize as u32) };
unsafe { call_guest_fn(test_callback2 as usize as u32) };
unsafe { call_guest_fn2(test_callback2 as usize as u32) };
unsafe { call_guest_fn2(test_callback as usize as u32) };
unsafe { call_guest_fn2(host_callback as usize as u32) };
}

Binary file not shown.

45
examples/callback.rs Normal file
View File

@ -0,0 +1,45 @@
/// This example demonstrates the use of callbacks: calling functions (Host and Wasm)
/// passed to us from the Wasm via hostcall
use wasmer::{compiler::compile, func, imports, vm::Ctx, Func};
use wasmer_runtime_core::{structures::TypedIndex, types::TableIndex};
static WASM: &'static str = "examples/callback-guest/callback-guest.wasm";
/// This function matches our arbitrarily decided callback signature
/// in this example we'll only call functions that take no arguments and return one value
fn host_callback(_ctx: &mut Ctx) -> u32 {
55
}
fn call_guest_fn(ctx: &mut Ctx, guest_fn: u32) -> u32 {
// We get a TableIndex from our raw value passed in
let guest_fn_typed = TableIndex::new(guest_fn as usize);
// and use it to call the corresponding function
let result = ctx.call_with_table_index(guest_fn_typed, &[]).unwrap();
println!("Guest fn {} returned {:?}", guest_fn, result);
0
}
fn main() {
let wasm_bytes =
std::fs::read(WASM).expect(&format!("Could not read in WASM plugin at {}", WASM));
let imports = imports! {
"env" => {
"call_guest_fn" => func!(call_guest_fn),
"call_guest_fn2" => func!(call_guest_fn),
"host_callback" => func!(host_callback),
},
};
let module = compile(&wasm_bytes[..]).unwrap();
let instance = module
.instantiate(&imports)
.expect("failed to instantiate wasm module");
let entry_point: Func<(u32, u32), u32> = instance.exports.get("main").unwrap();
entry_point.call(0, 0).expect("START");
}

20
examples/fib.wat Normal file
View File

@ -0,0 +1,20 @@
(module
(func $main (result i32)
(call $fib (i32.const 40))
)
(func $fib (param $n i32) (result i32)
(if (i32.eq (get_local $n) (i32.const 0))
(then (return (i32.const 1)))
)
(if (i32.eq (get_local $n) (i32.const 1))
(then (return (i32.const 1)))
)
(i32.add
(call $fib (i32.sub (get_local $n) (i32.const 1)))
(call $fib (i32.sub (get_local $n) (i32.const 2)))
)
)
(export "main" (func $main))
)

View File

@ -0,0 +1,9 @@
[package]
name = "hello_world"
version = "0.1.0"
authors = ["losfair <zhy20000919@hotmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -0,0 +1,7 @@
fn main() {
for i in 0..8 {
let s = format!("Hello, {}", i);
println!("{}", s);
}
panic!("OK");
}

74
examples/iterative_hash/Cargo.lock generated Normal file
View File

@ -0,0 +1,74 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "blake2"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "byte-tools"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "crypto-mac"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
"subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "digest"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "generic-array"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "iterative_hash"
version = "0.1.0"
dependencies = [
"blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "opaque-debug"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "subtle"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "typenum"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91721a6330935673395a0607df4d49a9cb90ae12d259f1b3e0a3f6e1d486872e"
"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
"checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5"
"checksum digest 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f47366984d3ad862010e22c7ce81a7dbcaebbdfb37241a620f8b6596ee135c"
"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
"checksum opaque-debug 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409"
"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
"checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169"

View File

@ -0,0 +1,12 @@
[package]
name = "iterative_hash"
version = "0.1.0"
authors = ["losfair <zhy20000919@hotmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[workspace]
[dependencies]
blake2 = "0.8"

View File

@ -0,0 +1,29 @@
use blake2::{Blake2b, Digest};
use std::time::{Duration, SystemTime};
fn main() {
let mut data: Vec<u8> = b"test".to_vec();
let now = SystemTime::now();
let mut last_millis: u128 = 0;
let mut round_count: usize = 0;
let mut record_count: usize = 0;
for i in 0.. {
let mut hasher = Blake2b::new();
hasher.input(&data);
let out = hasher.result();
data = out.to_vec();
if i != 0 && i % 1000 == 0 {
let millis = now.elapsed().unwrap().as_millis();
let diff = millis - last_millis;
if diff >= 100 {
record_count += 1;
println!("{}", ((i - round_count) as u128) * 1000000 / diff );
last_millis = millis;
round_count = i;
}
}
}
}

57
examples/many_params.wat Normal file
View File

@ -0,0 +1,57 @@
;; Test case for correctness of reading state with the presence of parameters passed on (machine) stack.
;; Usage: Run with a backend with support for OSR. Interrupt execution randomly.
;; Should see the stack frame for `$foo` to have locals `[0] = 1, [1] = 2, [2] = 3, [3] = 4, [4] = 5, [5] = 6, [6] = 7, [7] = 8` with high probability.
;; If the logic for reading stack parameters is broken, it's likely to see `[0] = 1, [1] = 2, [2] = 3, [3] = 4, [4] = 5, [5] = ?, [6] = ?, [7] = ?`.
(module
(import "wasi_unstable" "proc_exit" (func $__wasi_proc_exit (param i32)))
(func $long_running
(local $count i32)
(loop
(if (i32.eq (get_local $count) (i32.const 1000000)) (then (return)))
(set_local $count (i32.add (i32.const 1) (get_local $count)))
(br 0)
)
(unreachable)
)
(func $foo (param i32) (param i64) (param i32) (param i32) (param i32) (param i64) (param i64) (param i64) (result i32)
(set_local 2 (i32.const 3))
(call $long_running)
(i32.add
(i32.mul (i32.const 2) (get_local 0))
(i32.add
(i32.mul (i32.const 3) (i32.wrap/i64 (get_local 1)))
(i32.add
(i32.mul (i32.const 5) (get_local 2))
(i32.add
(i32.mul (i32.const 7) (get_local 3))
(i32.add
(i32.mul (i32.const 11) (get_local 4))
(i32.add
(i32.mul (i32.const 13) (i32.wrap/i64 (get_local 5)))
(i32.add
(i32.mul (i32.const 17) (i32.wrap/i64 (get_local 6)))
(i32.mul (i32.const 19) (i32.wrap/i64 (get_local 7)))
)
)
)
)
)
)
)
)
(func $_start (export "_start")
(local $count i32)
(loop
(if (i32.eq (get_local $count) (i32.const 10000)) (then (return)))
(set_local $count (i32.add (i32.const 1) (get_local $count)))
(call $foo (i32.const 1) (i64.const 2) (i32.const 30) (i32.const 4) (i32.const 5) (i64.const 6) (i64.const 7) (i64.const 8))
(if (i32.ne (i32.const 455))
(then unreachable)
)
(br 0)
)
(unreachable)
)
)

View File

@ -0,0 +1,11 @@
extern "C" {
fn it_works() -> i32;
}
#[no_mangle]
pub fn plugin_entrypoint(n: i32) -> i32 {
let result = unsafe { it_works() };
result + n
}
fn main() {}

Binary file not shown.

BIN
examples/parallel-guest.wasm Executable file

Binary file not shown.

View File

@ -0,0 +1,11 @@
[package]
name = "parallel-guest"
version = "0.1.0"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
license = "MIT"
edition = "2018"
publish = false
[dependencies]
md5 = "0.6"
lazy_static = "1"

View File

@ -0,0 +1,82 @@
#[macro_use]
extern crate lazy_static;
extern "C" {
fn get_hashed_password(ptr: u32, len: u32) -> u32;
fn print_char(c: u32);
}
fn print_str(s: &str) {
for c in s.chars() {
unsafe { print_char(c as u32) };
}
unsafe { print_char(b'\n' as u32) };
}
fn load_hashed_password() -> Option<String> {
let mut buffer = String::with_capacity(32);
for _ in 0..32 {
buffer.push(0 as char);
}
let result =
unsafe { get_hashed_password(buffer.as_mut_ptr() as u32, buffer.capacity() as u32) };
if result == 0 {
Some(buffer)
} else {
None
}
}
lazy_static! {
static ref HASHED_PASSWORD: String = load_hashed_password().unwrap();
}
static PASSWORD_CHARS: &'static [u8] = b"abcdefghijklmnopqrstuvwxyz0123456789";
// for simplicty we define a scheme for mapping numbers onto passwords
fn num_to_password(mut num: u64) -> String {
let mut extra_zero = num == 0;
let mut out = String::new();
while num > 0 {
out.push(PASSWORD_CHARS[num as usize % PASSWORD_CHARS.len()] as char);
extra_zero = extra_zero || num == PASSWORD_CHARS.len() as u64;
num /= PASSWORD_CHARS.len() as u64;
}
if extra_zero {
out.push(PASSWORD_CHARS[0] as char);
}
out
}
#[repr(C)]
struct RetStr {
ptr: u32,
len: u32,
}
// returns a (pointer, len) to the password or null
#[no_mangle]
fn check_password(from: u64, to: u64) -> u64 {
for i in from..to {
let password = num_to_password(i);
let digest = md5::compute(&password);
let hash_as_str = format!("{:x}", digest);
if hash_as_str == *HASHED_PASSWORD {
let ret = RetStr {
ptr: password.as_ptr() as usize as u32,
len: password.len() as u32,
};
// leak the data so ending the function doesn't corrupt it, if we cared the host could free it after
std::mem::forget(password);
return unsafe { std::mem::transmute(ret) };
}
}
return 0;
}
fn main() {}

View File

@ -0,0 +1,14 @@
[package]
name = "parallel"
version = "0.1.0"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
repository = "https://github.com/wasmerio/wasmer"
publish = false
license = "MIT"
[dependencies]
rayon = "1.2"
time = "0.1"
wasmer-runtime = { path = "../../lib/runtime" }
wasmer-runtime-core = { path = "../../lib/runtime-core" }

View File

@ -0,0 +1,5 @@
# Parallel Wasmer example
This example shows executing independent code from multiple threads on an "embarassingly parallel" problem
This is a toy example of cracking md5 hashes. This is not a benchmark. This example is not optimized, it will compare poorly to an implementation that is.

View File

@ -0,0 +1,140 @@
use rayon::prelude::*;
use wasmer_runtime::{
compile_with, compiler_for_backend, func, imports, instantiate, Backend, Func,
};
use wasmer_runtime_core::{
memory::ptr::{Array, WasmPtr},
vm::Ctx,
};
static PLUGIN_LOCATION: &'static str = "../parallel-guest.wasm";
fn get_hashed_password(ctx: &mut Ctx, ptr: WasmPtr<u8, Array>, len: u32) -> u32 {
// "hard" password - 7 characters
//let password = b"2ab96390c7dbe3439de74d0c9b0b1767";
// "easy" password - 5 characters
let password = b"ab56b4d92b40713acc5af89985d4b786";
let memory = ctx.memory(0);
if let Some(writer) = ptr.deref(memory, 0, len) {
for (i, byte) in password.iter().enumerate() {
writer[i].set(*byte)
}
0
} else {
u32::max_value()
}
}
#[repr(C)]
struct RetStr {
ptr: u32,
len: u32,
}
fn print_char(_cxt: &mut Ctx, c: u32) {
print!("{}", c as u8 as char);
}
fn main() {
let wasm_bytes = std::fs::read(PLUGIN_LOCATION).expect(&format!(
"Could not read in WASM plugin at {}",
PLUGIN_LOCATION
));
let imports = imports! {
"env" => {
"get_hashed_password" => func!(get_hashed_password),
"print_char" => func!(print_char),
},
};
let compiler = compiler_for_backend(Backend::default()).unwrap();
let module = compile_with(&wasm_bytes[..], compiler.as_ref()).unwrap();
println!("Parallel");
let start_ts = time::SteadyTime::now();
for outer in 0..1000u64 {
let start = outer * 1000;
let end = start + 1000;
let out = (start..=end)
.into_par_iter()
.filter_map(|i| {
let instance = module
.clone()
.instantiate(&imports)
.expect("failed to instantiate wasm module");
let check_password: Func<(u64, u64), u64> =
instance.exports.get("check_password").unwrap();
let j = i * 10000;
let result = check_password.call(j, j + 10000).unwrap();
print!(".");
use std::io::Write;
std::io::stdout().flush().unwrap();
if result != 0 {
let res: RetStr = unsafe { std::mem::transmute(result) };
let ctx = instance.context();
let memory = ctx.memory(0);
let wasm_ptr: WasmPtr<u8, Array> = WasmPtr::new(res.ptr);
let password_str = wasm_ptr
.get_utf8_string(memory, res.len)
.unwrap()
.to_string();
Some(password_str)
} else {
None
}
})
.find_first(|_: &String| true);
if out.is_some() {
let end_ts = time::SteadyTime::now();
let delta = end_ts - start_ts;
println!(
"Password cracked: \"{}\" in {}.{:03}",
out.unwrap(),
delta.num_seconds(),
(delta.num_milliseconds() % 1000),
);
break;
}
}
println!("Serial:");
let start_ts = time::SteadyTime::now();
let instance =
instantiate(&wasm_bytes[..], &imports).expect("failed to instantiate wasm module");
let check_password: Func<(u64, u64), u64> = instance.exports.get("check_password").unwrap();
let mut out: Option<RetStr> = None;
for i in (0..=u64::max_value()).step_by(10000) {
let result = check_password.call(i, i + 10000).unwrap();
print!(".");
use std::io::Write;
std::io::stdout().flush().unwrap();
if result != 0 {
out = Some(unsafe { std::mem::transmute(result) });
break;
}
}
println!("");
if let Some(res) = out {
let ctx = instance.context();
let memory = ctx.memory(0);
let wasm_ptr: WasmPtr<u8, Array> = WasmPtr::new(res.ptr);
let password_str = wasm_ptr.get_utf8_string(memory, res.len).unwrap();
let end_ts = time::SteadyTime::now();
let delta = end_ts - start_ts;
println!(
"Password cracked: \"{}\" in {}.{:03}",
password_str,
delta.num_seconds(),
(delta.num_milliseconds() % 1000),
);
} else {
println!("Password not found!");
}
}

BIN
examples/particle-repel-simd.wasm Executable file

Binary file not shown.

BIN
examples/particle-repel.wasm Executable file

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,7 @@
name = "plugin-for-example"
version = "0.1.0"
authors = ["The Wasmer Engineering Team <enigneering@wasmer.io>"]
license = "MIT"
edition = "2018"
[dependencies]

View File

@ -1,6 +1,11 @@
use wasmer_runtime::{func, imports, instantiate};
use wasmer_runtime_core::vm::Ctx;
use wasmer_wasi::generate_import_object;
use serde::{Deserialize, Serialize};
use wasmer::compiler::compile;
use wasmer::{func, imports, vm::Ctx, Func};
use wasmer_wasi::{
generate_import_object_for_version,
state::{self, WasiFile, WasiFsError},
types,
};
static PLUGIN_LOCATION: &'static str = "examples/plugin-for-example.wasm";
@ -9,15 +14,135 @@ fn it_works(_ctx: &mut Ctx) -> i32 {
5
}
#[derive(Debug, Serialize, Deserialize)]
pub struct LoggingWrapper {
pub wasm_module_name: String,
}
// std io trait boiler plate so we can implement WasiFile
// LoggingWrapper is a write-only type so we just want to immediately
// fail when reading or Seeking
impl std::io::Read for LoggingWrapper {
fn read(&mut self, _buf: &mut [u8]) -> std::io::Result<usize> {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"can not read from logging wrapper",
))
}
fn read_to_end(&mut self, _buf: &mut Vec<u8>) -> std::io::Result<usize> {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"can not read from logging wrapper",
))
}
fn read_to_string(&mut self, _buf: &mut String) -> std::io::Result<usize> {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"can not read from logging wrapper",
))
}
fn read_exact(&mut self, _buf: &mut [u8]) -> std::io::Result<()> {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"can not read from logging wrapper",
))
}
}
impl std::io::Seek for LoggingWrapper {
fn seek(&mut self, _pos: std::io::SeekFrom) -> std::io::Result<u64> {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"can not seek logging wrapper",
))
}
}
impl std::io::Write for LoggingWrapper {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
let stdout = std::io::stdout();
let mut out = stdout.lock();
out.write(b"[")?;
out.write(self.wasm_module_name.as_bytes())?;
out.write(b"]: ")?;
out.write(buf)
}
fn flush(&mut self) -> std::io::Result<()> {
std::io::stdout().flush()
}
fn write_all(&mut self, buf: &[u8]) -> std::io::Result<()> {
let stdout = std::io::stdout();
let mut out = stdout.lock();
out.write(b"[")?;
out.write(self.wasm_module_name.as_bytes())?;
out.write(b"]: ")?;
out.write_all(buf)
}
fn write_fmt(&mut self, fmt: std::fmt::Arguments) -> std::io::Result<()> {
let stdout = std::io::stdout();
let mut out = stdout.lock();
out.write(b"[")?;
out.write(self.wasm_module_name.as_bytes())?;
out.write(b"]: ")?;
out.write_fmt(fmt)
}
}
// the WasiFile methods aren't relevant for a write-only Stdout-like implementation
// we must use typetag and serde so that our trait objects can be safely Serialized and Deserialized
#[typetag::serde]
impl WasiFile for LoggingWrapper {
fn last_accessed(&self) -> u64 {
0
}
fn last_modified(&self) -> u64 {
0
}
fn created_time(&self) -> u64 {
0
}
fn size(&self) -> u64 {
0
}
fn set_len(&mut self, _len: u64) -> Result<(), WasiFsError> {
Ok(())
}
fn unlink(&mut self) -> Result<(), WasiFsError> {
Ok(())
}
fn bytes_available(&self) -> Result<usize, WasiFsError> {
// return an arbitrary amount
Ok(1024)
}
}
/// Called by the program when it wants to set itself up
fn initialize(ctx: &mut Ctx) {
let state = unsafe { state::get_wasi_state(ctx) };
let wasi_file_inner = LoggingWrapper {
wasm_module_name: "example module name".to_string(),
};
// swap stdout with our new wasifile
let _old_stdout = state
.fs
.swap_file(types::__WASI_STDOUT_FILENO, Box::new(wasi_file_inner))
.unwrap();
}
fn main() {
// Load the plugin data
let wasm_bytes = std::fs::read(PLUGIN_LOCATION).expect(&format!(
"Could not read in WASM plugin at {}",
PLUGIN_LOCATION
));
let module = compile(&wasm_bytes).expect("wasm compilation");
// get the version of the WASI module in a non-strict way, meaning we're
// allowed to have extra imports
let wasi_version = wasmer_wasi::get_wasi_version(&module, false)
.expect("WASI version detected from Wasm module");
// WASI imports
let mut base_imports = generate_import_object(vec![], vec![], vec![], vec![]);
let mut base_imports =
generate_import_object_for_version(wasi_version, vec![], vec![], vec![], vec![]);
// env is the default namespace for extern functions
let custom_imports = imports! {
"env" => {
@ -27,11 +152,14 @@ fn main() {
// The WASI imports object contains all required import functions for a WASI module to run.
// Extend this imports with our custom imports containing "it_works" function so that our custom wasm code may run.
base_imports.extend(custom_imports);
let instance =
instantiate(&wasm_bytes[..], &base_imports).expect("failed to instantiate wasm module");
let mut instance = module
.instantiate(&base_imports)
.expect("failed to instantiate wasm module");
// set up logging by replacing stdout
initialize(instance.context_mut());
// get a reference to the function "plugin_entrypoint" which takes an i32 and returns an i32
let entry_point = instance.func::<(i32), i32>("plugin_entrypoint").unwrap();
let entry_point: Func<i32, i32> = instance.exports.get("plugin_entrypoint").unwrap();
// call the "entry_point" function in WebAssembly with the number "2" as the i32 argument
let result = entry_point.call(2).expect("failed to execute plugin");
println!("result: {}", result);

View File

@ -1,53 +1,20 @@
use wabt::wat2wasm;
use wasmer_runtime_core::{
backend::Compiler,
error,
global::Global,
memory::Memory,
prelude::*,
table::Table,
use wasmer_runtime::{
compile, error, func, imports,
types::{ElementType, MemoryDescriptor, TableDescriptor, Value},
units::Pages,
Ctx, Global, Memory, Table,
};
#[cfg(feature = "clif")]
fn get_compiler() -> impl Compiler {
use wasmer_clif_backend::CraneliftCompiler;
CraneliftCompiler::new()
}
#[cfg(feature = "llvm")]
fn get_compiler() -> impl Compiler {
use wasmer_llvm_backend::LLVMCompiler;
LLVMCompiler::new()
}
#[cfg(feature = "singlepass")]
fn get_compiler() -> impl Compiler {
use wasmer_singlepass_backend::SinglePassCompiler;
SinglePassCompiler::new()
}
#[cfg(not(any(feature = "llvm", feature = "clif", feature = "singlepass")))]
fn get_compiler() -> impl Compiler {
panic!("compiler not specified, activate a compiler via features");
use wasmer_clif_backend::CraneliftCompiler;
CraneliftCompiler::new()
}
static EXAMPLE_WASM: &'static [u8] = include_bytes!("simple.wasm");
fn main() -> error::Result<()> {
let wasm_binary = wat2wasm(IMPORT_MODULE.as_bytes()).expect("WAST not valid or malformed");
let inner_module = wasmer_runtime_core::compile_with(&wasm_binary, &get_compiler())?;
let inner_module = compile(&wasm_binary)?;
let memory = Memory::new(MemoryDescriptor {
minimum: Pages(1),
maximum: Some(Pages(1)),
shared: false,
})
.unwrap();
let memory_desc = MemoryDescriptor::new(Pages(1), Some(Pages(1)), false).unwrap();
let memory = Memory::new(memory_desc).unwrap();
let global = Global::new(Value::I32(42));
@ -75,7 +42,7 @@ fn main() -> error::Result<()> {
"env" => inner_instance,
};
let outer_module = wasmer_runtime_core::compile_with(EXAMPLE_WASM, &get_compiler())?;
let outer_module = compile(EXAMPLE_WASM)?;
let outer_instance = outer_module.instantiate(&outer_imports)?;
let ret = outer_instance.call("main", &[Value::I32(42)])?;
println!("ret: {:?}", ret);
@ -83,7 +50,7 @@ fn main() -> error::Result<()> {
Ok(())
}
fn print_num(ctx: &mut vm::Ctx, n: i32) -> Result<i32, ()> {
fn print_num(ctx: &mut Ctx, n: i32) -> Result<i32, ()> {
println!("print_num({})", n);
let memory: &Memory = ctx.memory(0);

View File

@ -0,0 +1,67 @@
#[link(wasm_import_module = "wasmer_suspend")]
extern "C" {
fn suspend();
}
use std::collections::BTreeMap;
#[derive(Default)]
struct Node {
count: usize,
children: BTreeMap<char, Node>,
}
impl Node {
fn insert(&mut self, mut s: impl Iterator<Item = char>) {
match s.next() {
Some(x) => {
self.children.entry(x).or_default().insert(s);
}
None => {
self.count += 1;
}
}
}
fn for_each_dyn(&self, cb: &dyn Fn(&str, usize), prefix: &mut String) {
if self.count > 0 {
cb(&prefix, self.count);
}
for (k, v) in self.children.iter() {
prefix.push(*k);
v.for_each_dyn(cb, prefix);
prefix.pop().unwrap();
}
}
}
fn main() {
let mut root = Node::default();
root.insert("Ava".chars());
root.insert("Alexander".chars());
root.insert("Aiden".chars());
root.insert("Bella".chars());
root.insert("Brianna".chars());
root.insert("Brielle".chars());
root.insert("Charlotte".chars());
root.insert("Chloe".chars());
root.insert("Camila".chars());
println!("Tree ready, suspending.");
unsafe {
suspend();
}
root.for_each_dyn(
&|seq, count| {
println!("{}: {}", seq, count);
unsafe {
suspend();
}
},
&mut "".into(),
);
println!("[END]");
}

4
fuzz/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
target
corpus
artifacts

33
fuzz/Cargo.toml Normal file
View File

@ -0,0 +1,33 @@
[package]
name = "wasmer-fuzz"
version = "0.0.1"
authors = ["Automatically generated"]
publish = false
[package.metadata]
cargo-fuzz = true
[dependencies]
wasmer-runtime = { path = "../lib/runtime" }
wasmer-runtime-core = { path = "../lib/runtime-core" }
wasmer = { path = "../" }
wasmer-llvm-backend = { path = "../lib/llvm-backend" }
wasmer-singlepass-backend = { path = "../lib/singlepass-backend" }
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "simple_instantiate"
path = "fuzz_targets/simple_instantiate.rs"
[[bin]]
name = "validate_wasm"
path = "fuzz_targets/validate_wasm.rs"
[[bin]]
name = "compile_wasm"
path = "fuzz_targets/compile_wasm.rs"

59
fuzz/README.md Normal file
View File

@ -0,0 +1,59 @@
This directory contains the fuzz tests for wasmer. To fuzz, we use the `cargo-fuzz` package.
## Installation
You may need to install the `cargo-fuzz` package to get the `cargo fuzz` subcommand. Use
```sh
$ cargo install cargo-fuzz
```
`cargo-fuzz` is documented in the [Rust Fuzz Book](https://rust-fuzz.github.io/book/cargo-fuzz.html).
## Running a fuzzer (simple_instantiate, validate_wasm, compile_wasm)
Once `cargo-fuzz` is installed, you can run the `simple_instantiate` fuzzer with
```sh
cargo fuzz run simple_instantiate
```
or the `validate_wasm` fuzzer
```sh
cargo fuzz run validate_wasm
```
or the `compile_wasm` fuzzer
```sh
cargo fuzz run compile_wasm
```
You should see output that looks something like this:
```
INFO: Seed: 3276026494
INFO: 8 files found in wasmer/fuzz/corpus/simple_instantiate
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: seed corpus: files: 8 min: 1b max: 1b total: 8b rss: 133Mb
#9 INITED ft: 3 corp: 3/3b lim: 4 exec/s: 0 rss: 142Mb
#23 NEW ft: 4 corp: 4/5b lim: 4 exec/s: 0 rss: 142Mb L: 2/2 MS: 4 ChangeByte-InsertByte-ShuffleBytes-ChangeBit-
#25 NEW ft: 5 corp: 5/6b lim: 4 exec/s: 0 rss: 142Mb L: 1/2 MS: 2 ChangeBinInt-ChangeBit-
#27 NEW ft: 6 corp: 6/9b lim: 4 exec/s: 0 rss: 142Mb L: 3/3 MS: 2 InsertByte-ChangeByte-
#190 REDUCE ft: 6 corp: 6/7b lim: 4 exec/s: 0 rss: 142Mb L: 1/2 MS: 3 ChangeBit-EraseBytes-CrossOver-
#205 REDUCE ft: 7 corp: 7/11b lim: 4 exec/s: 0 rss: 142Mb L: 4/4 MS: 5 ShuffleBytes-CrossOver-InsertByte-ChangeBinInt-CrossOver-
```
It will continue to generate random inputs forever, until it finds a bug or is terminated. The testcases for bugs it finds go into `fuzz/artifacts/simple_instantiate` and you can rerun the fuzzer on a single input by passing it on the command line `cargo fuzz run simple_instantiate my_testcase.wasm`.
## Seeding the corpus, optional
The fuzzer works best when it has examples of small Wasm files to start with. Using `wast2json` from [wabt](https://github.com/WebAssembly/wabt), we can easily produce `.wasm` files out of the WebAssembly spec tests.
```sh
mkdir spec-test-corpus
for i in lib/spectests/spectests/*.wast; do wast2json --enable-all $i -o spec-test-corpus/$(basename $i).json; done
mv spec-test-corpus/*.wasm fuzz/corpus/simple_instantiate/
rm -r spec-test-corpus
```
The corpus directory is created on the first run of the fuzzer. If it doesn't exist, run it first and then seed the corpus. The fuzzer will pick up new files added to the corpus while it is running.
## Trophy case
- [x] https://github.com/wasmerio/wasmer/issues/558

View File

@ -0,0 +1,25 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate wasmer_runtime;
extern crate wasmer_runtime_core;
extern crate wasmer_llvm_backend;
extern crate wasmer_singlepass_backend;
use wasmer_runtime::{compile, compile_with};
use wasmer_runtime_core::backend::Compiler;
fn get_llvm_compiler() -> impl Compiler {
use wasmer_llvm_backend::LLVMCompiler;
LLVMCompiler::new()
}
fn get_singlepass_compiler() -> impl Compiler {
use wasmer_singlepass_backend::SinglePassCompiler;
SinglePassCompiler::new()
}
fuzz_target!(|data: &[u8]| {
let _ = compile_with(data, &get_llvm_compiler());
let _ = compile(data);
let _ = compile_with(data, &get_singlepass_compiler());
});

View File

@ -0,0 +1,11 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate wasmer_runtime;
use wasmer_runtime::{imports, instantiate};
fuzz_target!(|data: &[u8]| {
let import_object = imports! {};
instantiate(data, &import_object);
});

View File

@ -0,0 +1,20 @@
#![no_main]
#[macro_use]
extern crate libfuzzer_sys;
extern crate wasmer_bin;
extern crate wasmer_runtime_core;
use wasmer_runtime_core::backend::Features;
fuzz_target!(|data: &[u8]| {
let _ = wasmer_bin::utils::is_wasm_binary(data);
let _ = wasmer_runtime_core::validate_and_report_errors_with_features(
&data,
Features {
// Modify these values to explore additional parts of wasmer.
simd: false,
threads: false,
},
);
});

View File

@ -24,6 +24,7 @@ Wasmer intends to support different integrations:
- [WASI](./wasi): run WebAssembly files with the [WASI ABI](https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/).
- [Emscripten](./emscripten): run Emscripten-generated WebAssembly files, such as [Lua](../examples/lua.wasm) or [nginx](../examples/nginx/nginx.wasm).
- **Your own ABI**: Do you want to create your own ABI? Here's a [repo showcasing how](https://github.com/wasmerio/wasmer-rust-customabi-example)!
- Go ABI: _we will work on this soon! Want to give us a hand? ✋_
- Blazor: _research period, see [tracking issue](https://github.com/wasmerio/wasmer/issues/97)_

46
lib/api/Cargo.toml Normal file
View File

@ -0,0 +1,46 @@
[package]
name = "wasmer"
version = "0.17.0"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
publish = true
description = "The high-level public API of the Wasmer WebAssembly runtime"
readme = "README.md"
license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1", features = ["derive"] }
wasmer-runtime-core = { version = "0.17.0", path = "../runtime-core" }
[dependencies.wasmer-singlepass-backend]
path = "../singlepass-backend"
version = "0.17.0"
optional = true
[dependencies.wasmer-llvm-backend]
path = "../llvm-backend"
version = "0.17.0"
optional = true
[dependencies.wasmer-clif-backend]
path = "../clif-backend"
version = "0.17.0"
optional = true
[features]
# Note: we should have default backends depending on the architecture
# This target-directed-features is available in nightly
# https://github.com/rust-lang/cargo/issues/7914
default = ["cranelift", "default-backend-cranelift"]
singlepass = ["wasmer-singlepass-backend"]
llvm = ["wasmer-llvm-backend"]
cranelift = ["wasmer-clif-backend"]
default-backend-singlepass = ["singlepass"]
default-backend-llvm = ["llvm"]
default-backend-cranelift = ["cranelift"]
deterministic-execution = ["wasmer-singlepass-backend/deterministic-execution", "wasmer-runtime-core/deterministic-execution"]

5
lib/api/README.md Normal file
View File

@ -0,0 +1,5 @@
# Wasmer
Wasmer is a universal WebAssembly runtime.
This crate is not ready to be used directly yet. If you're interested in using the Wasmer runtime, checkout the [wasmer-runtime](https://crates.io/crates/wasmer-runtime) crate!

411
lib/api/src/lib.rs Normal file
View File

@ -0,0 +1,411 @@
#![deny(
dead_code,
// missing_docs,
nonstandard_style,
unused_imports,
unused_mut,
unused_variables,
unused_unsafe,
unreachable_patterns
)]
// Aspirational. I hope to have no unsafe code in this crate.
#![forbid(unsafe_code)]
#![doc(html_favicon_url = "https://wasmer.io/static/icons/favicon.ico")]
#![doc(html_logo_url = "https://avatars3.githubusercontent.com/u/44205449?s=200&v=4")]
//! TODO: Write high value, high-level API intro docs here
//! Intro/background information
//!
//! quick links to places in this document/other crates/standards etc.
//!
//! example code, link to projects using it
//!
//! more info, what to do if you run into problems
#[macro_use]
extern crate serde;
pub use crate::module::*;
pub use wasmer_runtime_core::instance::{DynFunc, Instance};
pub use wasmer_runtime_core::memory::Memory;
pub use wasmer_runtime_core::table::Table;
pub use wasmer_runtime_core::typed_func::DynamicFunc;
pub use wasmer_runtime_core::Func;
pub use wasmer_runtime_core::{func, imports};
pub mod module {
//! Types and functions for WebAssembly modules.
//!
//! # Usage
//! ## Create a Module
//!
//! ```
//! ```
//!
//! ## Get the exports from a Module
//! ```
//! # use wasmer::*;
//! # fn get_exports(module: &Module) {
//! let exports: Vec<ExportDescriptor> = module.exports().collect();
//! # }
//! ```
// TODO: verify that this is the type we want to export, with extra methods on it
pub use wasmer_runtime_core::module::Module;
// should this be in here?
pub use wasmer_runtime_core::types::{ExportDescriptor, ExternDescriptor, ImportDescriptor};
// TODO: implement abstract module API
}
pub mod memory {
//! Types and functions for Wasm linear memory.
pub use wasmer_runtime_core::memory::{Atomically, Memory, MemoryView};
}
pub mod wasm {
//! Various types exposed by the Wasmer Runtime relating to Wasm.
//!
//! TODO: Add index with links to sub sections
//
//! # Globals
//!
//! # Tables
pub use wasmer_runtime_core::backend::Features;
pub use wasmer_runtime_core::export::Export;
pub use wasmer_runtime_core::global::Global;
pub use wasmer_runtime_core::instance::{DynFunc, Instance};
pub use wasmer_runtime_core::memory::Memory;
pub use wasmer_runtime_core::module::Module;
pub use wasmer_runtime_core::table::Table;
pub use wasmer_runtime_core::types::{ExportDescriptor, ExternDescriptor, ImportDescriptor};
pub use wasmer_runtime_core::types::{
FuncSig, GlobalDescriptor, MemoryDescriptor, TableDescriptor, Type, Value,
};
pub use wasmer_runtime_core::Func;
}
pub mod vm {
//! Various types exposed by the Wasmer Runtime relating to the VM.
pub use wasmer_runtime_core::vm::Ctx;
}
pub mod compiler {
//! Types and functions for compiling wasm;
use crate::module::Module;
pub use wasmer_runtime_core::backend::{
BackendCompilerConfig, Compiler, CompilerConfig, Features,
};
pub use wasmer_runtime_core::compile_with;
#[cfg(unix)]
pub use wasmer_runtime_core::fault::{pop_code_version, push_code_version};
pub use wasmer_runtime_core::state::CodeVersion;
/// Enum used to select which compiler should be used to generate code.
#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq, Eq)]
pub enum Backend {
#[cfg(feature = "singlepass")]
/// Singlepass backend
Singlepass,
#[cfg(feature = "cranelift")]
/// Cranelift backend
Cranelift,
#[cfg(feature = "llvm")]
/// LLVM backend
LLVM,
/// Auto backend
Auto,
}
impl Backend {
/// Get a list of the currently enabled (via feature flag) backends.
pub fn variants() -> &'static [&'static str] {
&[
#[cfg(feature = "singlepass")]
"singlepass",
#[cfg(feature = "cranelift")]
"cranelift",
#[cfg(feature = "llvm")]
"llvm",
"auto",
]
}
/// Stable string representation of the backend.
/// It can be used as part of a cache key, for example.
pub fn to_string(&self) -> &'static str {
match self {
#[cfg(feature = "singlepass")]
Backend::Singlepass => "singlepass",
#[cfg(feature = "cranelift")]
Backend::Cranelift => "cranelift",
#[cfg(feature = "llvm")]
Backend::LLVM => "llvm",
Backend::Auto => "auto",
}
}
}
impl Default for Backend {
fn default() -> Self {
#[cfg(all(feature = "default-backend-singlepass", not(feature = "docs")))]
return Backend::Singlepass;
#[cfg(any(feature = "default-backend-cranelift", feature = "docs"))]
return Backend::Cranelift;
#[cfg(all(feature = "default-backend-llvm", not(feature = "docs")))]
return Backend::LLVM;
}
}
impl std::str::FromStr for Backend {
type Err = String;
fn from_str(s: &str) -> Result<Backend, String> {
match s.to_lowercase().as_str() {
#[cfg(feature = "singlepass")]
"singlepass" => Ok(Backend::Singlepass),
#[cfg(feature = "cranelift")]
"cranelift" => Ok(Backend::Cranelift),
#[cfg(feature = "llvm")]
"llvm" => Ok(Backend::LLVM),
"auto" => Ok(Backend::Auto),
_ => Err(format!("The backend {} doesn't exist", s)),
}
}
}
/// Compile WebAssembly binary code into a [`Module`].
/// This function is useful if it is necessary to
/// compile a module before it can be instantiated
/// (otherwise, the [`instantiate`] function should be used).
///
/// [`Module`]: struct.Module.html
/// [`instantiate`]: fn.instantiate.html
///
/// # Params:
/// * `wasm`: A `&[u8]` containing the
/// binary code of the wasm module you want to compile.
/// # Errors:
/// If the operation fails, the function returns `Err(error::CompileError::...)`.
pub fn compile(wasm: &[u8]) -> crate::error::CompileResult<Module> {
wasmer_runtime_core::compile_with(&wasm[..], &default_compiler())
}
/// The same as `compile` but takes a `CompilerConfig` for the purpose of
/// changing the compiler's behavior
pub fn compile_with_config(
wasm: &[u8],
compiler_config: CompilerConfig,
) -> crate::error::CompileResult<Module> {
wasmer_runtime_core::compile_with_config(&wasm[..], &default_compiler(), compiler_config)
}
/// The same as `compile_with_config` but takes a `Compiler` for the purpose of
/// changing the backend.
pub fn compile_with_config_with(
wasm: &[u8],
compiler_config: CompilerConfig,
compiler: &dyn Compiler,
) -> crate::error::CompileResult<Module> {
wasmer_runtime_core::compile_with_config(&wasm[..], compiler, compiler_config)
}
/// Copied from runtime core; TODO: figure out what we want to do here
pub fn default_compiler() -> impl Compiler {
#[cfg(any(
all(
feature = "default-backend-llvm",
not(feature = "docs"),
any(
feature = "default-backend-cranelift",
feature = "default-backend-singlepass"
)
),
all(
not(feature = "docs"),
feature = "default-backend-cranelift",
feature = "default-backend-singlepass"
)
))]
compile_error!(
"The `default-backend-X` features are mutually exclusive. Please choose just one"
);
#[cfg(all(feature = "default-backend-llvm", not(feature = "docs")))]
use wasmer_llvm_backend::LLVMCompiler as DefaultCompiler;
#[cfg(all(feature = "default-backend-singlepass", not(feature = "docs")))]
use wasmer_singlepass_backend::SinglePassCompiler as DefaultCompiler;
#[cfg(any(feature = "default-backend-cranelift", feature = "docs"))]
use wasmer_clif_backend::CraneliftCompiler as DefaultCompiler;
DefaultCompiler::new()
}
/// Get the `Compiler` as a trait object for the given `Backend`.
/// Returns `Option` because support for the requested `Compiler` may
/// not be enabled by feature flags.
///
/// To get a list of the enabled backends as strings, call `Backend::variants()`.
pub fn compiler_for_backend(backend: Backend) -> Option<Box<dyn Compiler>> {
match backend {
#[cfg(feature = "cranelift")]
Backend::Cranelift => Some(Box::new(wasmer_clif_backend::CraneliftCompiler::new())),
#[cfg(any(feature = "singlepass"))]
Backend::Singlepass => Some(Box::new(
wasmer_singlepass_backend::SinglePassCompiler::new(),
)),
#[cfg(feature = "llvm")]
Backend::LLVM => Some(Box::new(wasmer_llvm_backend::LLVMCompiler::new())),
Backend::Auto => {
#[cfg(feature = "default-backend-singlepass")]
return Some(Box::new(
wasmer_singlepass_backend::SinglePassCompiler::new(),
));
#[cfg(feature = "default-backend-cranelift")]
return Some(Box::new(wasmer_clif_backend::CraneliftCompiler::new()));
#[cfg(feature = "default-backend-llvm")]
return Some(Box::new(wasmer_llvm_backend::LLVMCompiler::new()));
}
}
}
}
pub mod codegen {
//! Types and functions for generating native code.
pub use wasmer_runtime_core::codegen::ModuleCodeGenerator;
}
// TODO: `import` or `imports`?
pub mod import {
//! Types and functions for Wasm imports.
pub use wasmer_runtime_core::import::{
ImportObject, ImportObjectIterator, LikeNamespace, Namespace,
};
pub use wasmer_runtime_core::types::{ExternDescriptor, ImportDescriptor};
pub use wasmer_runtime_core::{func, imports};
}
pub mod export {
//! Types and functions for Wasm exports.
pub use wasmer_runtime_core::export::Export;
pub use wasmer_runtime_core::types::{ExportDescriptor, ExternDescriptor};
}
pub mod units {
//! Various unit types.
pub use wasmer_runtime_core::units::{Bytes, Pages};
}
pub mod types {
//! Types used in the Wasm runtime and conversion functions.
pub use wasmer_runtime_core::types::{
ElementType, FuncDescriptor, FuncSig, GlobalDescriptor, GlobalInit, MemoryDescriptor,
TableDescriptor, Type, Value, ValueType,
};
}
pub mod error {
//! Various error types returned by Wasmer APIs.
pub use wasmer_runtime_core::backend::ExceptionCode;
pub use wasmer_runtime_core::error::{
CallError, CompileError, CompileResult, CreationError, Error, LinkError, ResolveError,
RuntimeError,
};
#[derive(Debug)]
pub enum CompileFromFileError {
CompileError(CompileError),
IoError(std::io::Error),
}
impl std::fmt::Display for CompileFromFileError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
CompileFromFileError::CompileError(ce) => write!(f, "{}", ce),
CompileFromFileError::IoError(ie) => write!(f, "{}", ie),
}
}
}
impl std::error::Error for CompileFromFileError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
CompileFromFileError::CompileError(ce) => Some(ce),
CompileFromFileError::IoError(ie) => Some(ie),
}
}
}
impl From<CompileError> for CompileFromFileError {
fn from(other: CompileError) -> Self {
CompileFromFileError::CompileError(other)
}
}
impl From<std::io::Error> for CompileFromFileError {
fn from(other: std::io::Error) -> Self {
CompileFromFileError::IoError(other)
}
}
}
/// Idea for generic trait; consider rename; it will need to be moved somewhere else
pub trait CompiledModule {
fn new(bytes: impl AsRef<[u8]>) -> error::CompileResult<Module>;
fn new_with_compiler(
bytes: impl AsRef<[u8]>,
compiler: Box<dyn compiler::Compiler>,
) -> error::CompileResult<Module>;
fn from_binary(bytes: impl AsRef<[u8]>) -> error::CompileResult<Module>;
fn from_binary_unchecked(bytes: impl AsRef<[u8]>) -> error::CompileResult<Module>;
fn from_file(file: impl AsRef<std::path::Path>) -> Result<Module, error::CompileFromFileError>;
fn validate(bytes: impl AsRef<[u8]>) -> error::CompileResult<()>;
}
// this implementation should be moved
impl CompiledModule for Module {
fn new(bytes: impl AsRef<[u8]>) -> error::CompileResult<Module> {
let bytes = bytes.as_ref();
wasmer_runtime_core::compile_with(bytes, &compiler::default_compiler())
}
fn new_with_compiler(
bytes: impl AsRef<[u8]>,
compiler: Box<dyn compiler::Compiler>,
) -> error::CompileResult<Module> {
let bytes = bytes.as_ref();
wasmer_runtime_core::compile_with(bytes, &*compiler)
}
fn from_binary(bytes: impl AsRef<[u8]>) -> error::CompileResult<Module> {
let bytes = bytes.as_ref();
wasmer_runtime_core::compile_with(bytes, &compiler::default_compiler())
}
fn from_binary_unchecked(bytes: impl AsRef<[u8]>) -> error::CompileResult<Module> {
// TODO: optimize this
Self::from_binary(bytes)
}
fn from_file(file: impl AsRef<std::path::Path>) -> Result<Module, error::CompileFromFileError> {
use std::fs;
use std::io::Read;
let path = file.as_ref();
let mut f = fs::File::open(path)?;
// TODO: ideally we can support a streaming compilation API and not have to read in the entire file
let mut bytes = vec![];
f.read_to_end(&mut bytes)?;
Ok(Module::from_binary(bytes.as_slice())?)
}
fn validate(bytes: impl AsRef<[u8]>) -> error::CompileResult<()> {
// TODO: optimize this
let _ = Self::from_binary(bytes)?;
Ok(())
}
}

View File

@ -1,40 +1,44 @@
[package]
name = "wasmer-clif-backend"
version = "0.5.3"
version = "0.17.0"
description = "Wasmer runtime Cranelift compiler backend"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer"
keywords = ["wasm", "webassembly", "compiler", "JIT", "AOT"]
categories = ["wasm"]
edition = "2018"
readme = "README.md"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.5.3" }
cranelift-native = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
cranelift-codegen = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
cranelift-entity = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
cranelift-frontend = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
cranelift-wasm = { git = "https://github.com/wasmerio/cranelift.git", rev = "2ada531d79b34a9e6c94c81f2615677e22d68780" }
hashbrown = "0.1"
target-lexicon = "0.4.0"
wasmparser = "0.32.1"
byteorder = "1"
nix = "0.13.0"
libc = "0.2.49"
rayon = "1.0"
wasmer-runtime-core = { path = "../runtime-core", version = "0.17.0" }
cranelift-native = "0.59.0"
cranelift-codegen = "0.59.0"
cranelift-entity = "0.59.0"
cranelift-frontend = { package = "wasmer-clif-fork-frontend", version = "0.59.0" }
cranelift-wasm = { package = "wasmer-clif-fork-wasm", version = "0.59.0" }
target-lexicon = "0.10"
wasmparser = "0.51.3"
byteorder = "1.3.2"
nix = "0.15.0"
libc = "0.2.60"
rayon = "1.1"
wasm-debug = { optional = true, version = "0.2" }
# Dependencies for caching.
[dependencies.serde]
version = "1.0"
features = ["rc"]
[dependencies.serde_derive]
version = "1.0"
[dependencies.serde_bytes]
version = "0.10"
version = "0.11"
[dependencies.serde-bench]
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.5.3" }
wasmer-win-exception-handler = { path = "../win-exception-handler", version = "0.17.0" }
[features]
debug = ["wasmer-runtime-core/debug"]
generate-debug-information = ["wasm-debug"]

View File

@ -1,21 +1,21 @@
<p align="center">
<a href="https://wasmer.io" target="_blank" rel="noopener noreferrer">
<img width="400" src="https://raw.githubusercontent.com/wasmerio/wasmer/master/logo.png" alt="Wasmer logo">
<img width="300" src="https://raw.githubusercontent.com/wasmerio/wasmer/master/assets/logo.png" alt="Wasmer logo">
</a>
</p>
<p align="center">
<a href="https://circleci.com/gh/wasmerio/wasmer/">
<img src="https://img.shields.io/circleci/project/github/wasmerio/wasmer/master.svg" alt="Build Status">
<a href="https://dev.azure.com/wasmerio/wasmer/_build/latest?definitionId=3&branchName=master">
<img src="https://img.shields.io/azure-devops/build/wasmerio/wasmer/3.svg?style=flat-square" alt="Build Status">
</a>
<a href="https://github.com/wasmerio/wasmer/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/wasmerio/wasmer.svg" alt="License">
<img src="https://img.shields.io/github/license/wasmerio/wasmer.svg?style=flat-square" alt="License">
</a>
<a href="https://spectrum.chat/wasmer">
<img src="https://withspectrum.github.io/badge/badge.svg" alt="Join the Wasmer Community">
</a>
<a href="https://crates.io/crates/wasmer-clif-backend">
<img src="https://img.shields.io/crates/d/wasmer-clif-backend.svg" alt="Number of downloads from crates.io">
<img src="https://img.shields.io/crates/d/wasmer-clif-backend.svg?style=flat-square" alt="Number of downloads from crates.io">
</a>
<a href="https://docs.rs/wasmer-clif-backend">
<img src="https://docs.rs/wasmer-clif-backend/badge.svg" alt="Read our API documentation">
@ -28,4 +28,26 @@ Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully
compatible with Emscripten, Rust and Go. [Learn
more](https://github.com/wasmerio/wasmer).
This crate represents the Cranelift backend.
This crate represents the Cranelift backend integration for Wasmer.
## Usage
### Usage in Wasmer Standalone
If you are using the `wasmer` CLI, you can specify the backend with:
```sh
wasmer run program.wasm --backend=cranelift
```
### Usage in Wasmer Embedded
If you are using Wasmer Embedded, you can specify
the Cranelift backend to the [`compile_with` function](https://docs.rs/wasmer-runtime-core/*/wasmer_runtime_core/fn.compile_with.html):
```rust
use wasmer_clif_backend::CraneliftCompiler;
// ...
let module = wasmer_runtime_core::compile_with(&wasm_binary[..], &CraneliftCompiler::new());
```

View File

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

View File

@ -7,18 +7,19 @@ use crate::{
};
use cranelift_codegen::entity::EntityRef;
use cranelift_codegen::ir::{self, Ebb, Function, InstBuilder};
use cranelift_codegen::ir::{self, Block, Function, InstBuilder};
use cranelift_codegen::isa::CallConv;
use cranelift_codegen::{cursor::FuncCursor, isa};
use cranelift_frontend::{FunctionBuilder, Position, Variable};
use cranelift_wasm::{self, FuncTranslator};
use cranelift_wasm::{self, FuncTranslator, ModuleTranslationState};
use cranelift_wasm::{get_vmctx_value_label, translate_operator};
use cranelift_wasm::{FuncEnvironment, ReturnMode, WasmError};
use cranelift_wasm::{FuncEnvironment, ReturnMode, TargetEnvironment, WasmError};
use std::mem;
use std::sync::{Arc, RwLock};
use wasmer_runtime_core::error::CompileError;
use wasmer_runtime_core::{
backend::{Backend, CacheGen, Token},
backend::{CacheGen, CompilerConfig, Token},
cache::{Artifact, Error as CacheError},
codegen::*,
memory::MemoryType,
@ -32,8 +33,10 @@ use wasmer_runtime_core::{
};
use wasmparser::Type as WpType;
static BACKEND_ID: &str = "cranelift";
pub struct CraneliftModuleCodeGenerator {
isa: Box<isa::TargetIsa>,
isa: Option<Box<dyn isa::TargetIsa>>,
signatures: Option<Arc<Map<SigIndex, FuncSig>>>,
pub clif_signatures: Map<SigIndex, ir::Signature>,
function_signatures: Option<Arc<Map<FuncIndex, SigIndex>>>,
@ -44,9 +47,8 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
for CraneliftModuleCodeGenerator
{
fn new() -> Self {
let isa = get_isa();
CraneliftModuleCodeGenerator {
isa,
isa: None,
clif_signatures: Map::new(),
functions: vec![],
function_signatures: None,
@ -54,8 +56,12 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
}
}
fn backend_id() -> Backend {
Backend::Cranelift
fn new_with_target(_: Option<String>, _: Option<String>, _: Option<String>) -> Self {
unimplemented!("cross compilation is not available for clif backend")
}
fn backend_id() -> &'static str {
BACKEND_ID
}
fn check_precondition(&mut self, _module_info: &ModuleInfo) -> Result<(), CodegenError> {
@ -65,6 +71,7 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
fn next_function(
&mut self,
module_info: Arc<RwLock<ModuleInfo>>,
loc: WasmSpan,
) -> Result<&mut CraneliftFunctionCodeGenerator, CodegenError> {
// define_function_body(
@ -89,13 +96,21 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
func,
func_translator,
next_local: 0,
clif_signatures: self.clif_signatures.clone(),
module_info: Arc::clone(&module_info),
target_config: self.isa.frontend_config().clone(),
position: Position::default(),
func_env: FunctionEnvironment {
module_info: Arc::clone(&module_info),
target_config: self.isa.as_ref().unwrap().frontend_config().clone(),
clif_signatures: self.clif_signatures.clone(),
},
loc,
};
debug_assert_eq!(func_env.func.dfg.num_ebbs(), 0, "Function must be empty");
let generate_debug_info = module_info.read().unwrap().generate_debug_info;
if generate_debug_info {
func_env.func.collect_debug_info();
}
debug_assert_eq!(func_env.func.dfg.num_blocks(), 0, "Function must be empty");
debug_assert_eq!(func_env.func.dfg.num_insts(), 0, "Function must be empty");
let mut builder = FunctionBuilder::new(
@ -104,188 +119,27 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
&mut func_env.position,
);
// TODO srcloc
//builder.set_srcloc(cur_srcloc(&reader));
builder.set_srcloc(ir::SourceLoc::new(loc.start()));
let entry_block = builder.create_ebb();
builder.append_ebb_params_for_function_params(entry_block);
let entry_block = builder.create_block();
builder.append_block_params_for_function_params(entry_block);
builder.switch_to_block(entry_block); // This also creates values for the arguments.
builder.seal_block(entry_block);
// Make sure the entry block is inserted in the layout before we make any callbacks to
// `environ`. The callback functions may need to insert things in the entry block.
builder.ensure_inserted_ebb();
builder.ensure_inserted_block();
declare_wasm_parameters(&mut builder, entry_block);
// Set up the translation state with a single pushed control block representing the whole
// function and its return values.
let exit_block = builder.create_ebb();
builder.append_ebb_params_for_function_returns(exit_block);
let exit_block = builder.create_block();
builder.append_block_params_for_function_returns(exit_block);
func_env
.func_translator
.state
.initialize(&builder.func.signature, exit_block);
#[cfg(feature = "debug")]
{
use cranelift_codegen::cursor::{Cursor, FuncCursor};
use cranelift_codegen::ir::InstBuilder;
let entry_ebb = func.layout.entry_block().unwrap();
let ebb = func.dfg.make_ebb();
func.layout.insert_ebb(ebb, entry_ebb);
let mut pos = FuncCursor::new(&mut func).at_first_insertion_point(ebb);
let params = pos.func.dfg.ebb_params(entry_ebb).to_vec();
let new_ebb_params: Vec<_> = params
.iter()
.map(|&param| {
pos.func
.dfg
.append_ebb_param(ebb, pos.func.dfg.value_type(param))
})
.collect();
let start_debug = {
let signature = pos.func.import_signature(ir::Signature {
call_conv: self.target_config().default_call_conv,
params: vec![
ir::AbiParam::special(ir::types::I64, ir::ArgumentPurpose::VMContext),
ir::AbiParam::new(ir::types::I32),
],
returns: vec![],
});
let name = ir::ExternalName::testcase("strtdbug");
pos.func.import_function(ir::ExtFuncData {
name,
signature,
colocated: false,
})
};
let end_debug = {
let signature = pos.func.import_signature(ir::Signature {
call_conv: self.target_config().default_call_conv,
params: vec![ir::AbiParam::special(
ir::types::I64,
ir::ArgumentPurpose::VMContext,
)],
returns: vec![],
});
let name = ir::ExternalName::testcase("enddbug");
pos.func.import_function(ir::ExtFuncData {
name,
signature,
colocated: false,
})
};
let i32_print = {
let signature = pos.func.import_signature(ir::Signature {
call_conv: self.target_config().default_call_conv,
params: vec![
ir::AbiParam::special(ir::types::I64, ir::ArgumentPurpose::VMContext),
ir::AbiParam::new(ir::types::I32),
],
returns: vec![],
});
let name = ir::ExternalName::testcase("i32print");
pos.func.import_function(ir::ExtFuncData {
name,
signature,
colocated: false,
})
};
let i64_print = {
let signature = pos.func.import_signature(ir::Signature {
call_conv: self.target_config().default_call_conv,
params: vec![
ir::AbiParam::special(ir::types::I64, ir::ArgumentPurpose::VMContext),
ir::AbiParam::new(ir::types::I64),
],
returns: vec![],
});
let name = ir::ExternalName::testcase("i64print");
pos.func.import_function(ir::ExtFuncData {
name,
signature,
colocated: false,
})
};
let f32_print = {
let signature = pos.func.import_signature(ir::Signature {
call_conv: self.target_config().default_call_conv,
params: vec![
ir::AbiParam::special(ir::types::I64, ir::ArgumentPurpose::VMContext),
ir::AbiParam::new(ir::types::F32),
],
returns: vec![],
});
let name = ir::ExternalName::testcase("f32print");
pos.func.import_function(ir::ExtFuncData {
name,
signature,
colocated: false,
})
};
let f64_print = {
let signature = pos.func.import_signature(ir::Signature {
call_conv: self.target_config().default_call_conv,
params: vec![
ir::AbiParam::special(ir::types::I64, ir::ArgumentPurpose::VMContext),
ir::AbiParam::new(ir::types::F64),
],
returns: vec![],
});
let name = ir::ExternalName::testcase("f64print");
pos.func.import_function(ir::ExtFuncData {
name,
signature,
colocated: false,
})
};
let vmctx = pos
.func
.special_param(ir::ArgumentPurpose::VMContext)
.expect("missing vmctx parameter");
let func_index = pos.ins().iconst(
ir::types::I32,
func_index.index() as i64 + self.module.info.imported_functions.len() as i64,
);
pos.ins().call(start_debug, &[vmctx, func_index]);
for param in new_ebb_params.iter().cloned() {
match pos.func.dfg.value_type(param) {
ir::types::I32 => pos.ins().call(i32_print, &[vmctx, param]),
ir::types::I64 => pos.ins().call(i64_print, &[vmctx, param]),
ir::types::F32 => pos.ins().call(f32_print, &[vmctx, param]),
ir::types::F64 => pos.ins().call(f64_print, &[vmctx, param]),
_ => unimplemented!(),
};
}
pos.ins().call(end_debug, &[vmctx]);
pos.ins().jump(entry_ebb, new_ebb_params.as_slice());
}
self.functions.push(func_env);
Ok(self.functions.last_mut().unwrap())
}
@ -293,19 +147,33 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
fn finalize(
self,
module_info: &ModuleInfo,
) -> Result<(Caller, Box<dyn CacheGen>), CodegenError> {
let mut func_bodies: Map<LocalFuncIndex, ir::Function> = Map::new();
) -> Result<
(
Caller,
Option<wasmer_runtime_core::codegen::DebugMetadata>,
Box<dyn CacheGen>,
),
CodegenError,
> {
let mut func_bodies: Map<LocalFuncIndex, (ir::Function, WasmSpan)> = Map::new();
for f in self.functions.into_iter() {
func_bodies.push(f.func);
func_bodies.push((f.func, f.loc));
}
let (func_resolver_builder, handler_data) =
FuncResolverBuilder::new(&*self.isa, func_bodies, module_info)?;
let (func_resolver_builder, debug_metadata, handler_data) =
FuncResolverBuilder::new(&**self.isa.as_ref().unwrap(), func_bodies, module_info)?;
let trampolines = Arc::new(Trampolines::new(&*self.isa, module_info));
let trampolines = Arc::new(Trampolines::new(&**self.isa.as_ref().unwrap(), module_info));
let signatures_empty = Map::new();
let signatures = if self.signatures.is_some() {
&self.signatures.as_ref().unwrap()
} else {
&signatures_empty
};
let (func_resolver, backend_cache) = func_resolver_builder.finalize(
&self.signatures.as_ref().unwrap(),
signatures,
Arc::clone(&trampolines),
handler_data.clone(),
)?;
@ -317,13 +185,24 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
Ok((
Caller::new(handler_data, trampolines, func_resolver),
debug_metadata,
cache_gen,
))
}
fn feed_compiler_config(&mut self, config: &CompilerConfig) -> Result<(), CodegenError> {
self.isa = Some(get_isa(Some(config)));
Ok(())
}
fn feed_signatures(&mut self, signatures: Map<SigIndex, FuncSig>) -> Result<(), CodegenError> {
self.signatures = Some(Arc::new(signatures));
let call_conv = self.isa.frontend_config().default_call_conv;
let call_conv = self
.isa
.as_ref()
.unwrap()
.frontend_config()
.default_call_conv;
for (_sig_idx, func_sig) in self.signatures.as_ref().unwrap().iter() {
self.clif_signatures
.push(convert_func_sig(func_sig, call_conv));
@ -339,7 +218,7 @@ impl ModuleCodeGenerator<CraneliftFunctionCodeGenerator, Caller, CodegenError>
Ok(())
}
fn feed_import_function(&mut self) -> Result<(), CodegenError> {
fn feed_import_function(&mut self, _sigindex: SigIndex) -> Result<(), CodegenError> {
Ok(())
}
@ -384,10 +263,10 @@ pub struct CraneliftFunctionCodeGenerator {
func: Function,
func_translator: FuncTranslator,
next_local: usize,
pub clif_signatures: Map<SigIndex, ir::Signature>,
module_info: Arc<RwLock<ModuleInfo>>,
target_config: isa::TargetFrontendConfig,
position: Position,
func_env: FunctionEnvironment,
/// Where the function lives in the Wasm module as a span of bytes
loc: WasmSpan,
}
pub struct FunctionEnvironment {
@ -396,7 +275,7 @@ pub struct FunctionEnvironment {
clif_signatures: Map<SigIndex, ir::Signature>,
}
impl FuncEnvironment for FunctionEnvironment {
impl TargetEnvironment for FunctionEnvironment {
/// Gets configuration information needed for compiling functions
fn target_config(&self) -> isa::TargetFrontendConfig {
self.target_config
@ -414,6 +293,13 @@ impl FuncEnvironment for FunctionEnvironment {
self.target_config().pointer_bytes()
}
/// Return Cranelift reference type.
fn reference_type(&self) -> ir::Type {
ir::types::R64
}
}
impl FuncEnvironment for FunctionEnvironment {
/// Sets up the necessary preamble definitions in `func` to access the global identified
/// by `index`.
///
@ -583,7 +469,7 @@ impl FuncEnvironment for FunctionEnvironment {
let local_memory_bound = func.create_global_value(ir::GlobalValueData::Load {
base: local_memory_ptr,
offset: (vm::LocalMemory::offset_bound() as i32).into(),
global_type: ptr_type,
global_type: ir::types::I32,
readonly: false,
});
@ -691,7 +577,7 @@ impl FuncEnvironment for FunctionEnvironment {
let table_count = func.create_global_value(ir::GlobalValueData::Load {
base: table_struct_ptr,
offset: (vm::LocalTable::offset_count() as i32).into(),
global_type: ptr_type,
global_type: ir::types::I32,
// The table length can change, so it can't be readonly.
readonly: false,
});
@ -813,7 +699,8 @@ impl FuncEnvironment for FunctionEnvironment {
colocated: false,
});
pos.ins().symbol_value(ir::types::I64, sig_index_global)
let val = pos.ins().symbol_value(ir::types::I64, sig_index_global);
pos.ins().ireduce(ir::types::I32, val)
// let dynamic_sigindices_array_ptr = pos.ins().load(
// ptr_type,
@ -844,7 +731,9 @@ impl FuncEnvironment for FunctionEnvironment {
}
/// Generates a call IR with `callee` and `call_args` and inserts it at `pos`
/// TODO: add support for imported functions
///
/// It's about generating code that calls a local or imported function; in
/// WebAssembly: `(call $foo)`.
fn translate_call(
&mut self,
mut pos: FuncCursor,
@ -916,20 +805,31 @@ impl FuncEnvironment for FunctionEnvironment {
readonly: true,
});
let imported_vmctx_addr = pos.func.create_global_value(ir::GlobalValueData::Load {
base: imported_func_struct_addr,
offset: (vm::ImportedFunc::offset_vmctx() as i32).into(),
global_type: ptr_type,
readonly: true,
});
let imported_func_ctx_addr =
pos.func.create_global_value(ir::GlobalValueData::Load {
base: imported_func_struct_addr,
offset: (vm::ImportedFunc::offset_func_ctx() as i32).into(),
global_type: ptr_type,
readonly: true,
});
let imported_func_ctx_vmctx_addr =
pos.func.create_global_value(ir::GlobalValueData::Load {
base: imported_func_ctx_addr,
offset: (vm::FuncCtx::offset_vmctx() as i32).into(),
global_type: ptr_type,
readonly: true,
});
let imported_func_addr = pos.ins().global_value(ptr_type, imported_func_addr);
let imported_vmctx_addr = pos.ins().global_value(ptr_type, imported_vmctx_addr);
let imported_func_ctx_vmctx_addr = pos
.ins()
.global_value(ptr_type, imported_func_ctx_vmctx_addr);
let sig_ref = pos.func.dfg.ext_funcs[callee].signature;
let mut args = Vec::with_capacity(call_args.len() + 1);
args.push(imported_vmctx_addr);
args.push(imported_func_ctx_vmctx_addr);
args.extend(call_args.iter().cloned());
Ok(pos
@ -938,7 +838,6 @@ impl FuncEnvironment for FunctionEnvironment {
}
}
}
/// Generates code corresponding to wasm `memory.grow`.
///
/// `index` refers to the linear memory to query.
@ -1067,6 +966,159 @@ impl FuncEnvironment for FunctionEnvironment {
Ok(*pos.func.dfg.inst_results(call_inst).first().unwrap())
}
fn translate_memory_copy(
&mut self,
_pos: FuncCursor,
_clif_mem_index: cranelift_wasm::MemoryIndex,
_heap: ir::Heap,
_dst: ir::Value,
_src: ir::Value,
_len: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("memory.copy not yet implemented");
}
fn translate_memory_fill(
&mut self,
_pos: FuncCursor,
_clif_mem_index: cranelift_wasm::MemoryIndex,
_heap: ir::Heap,
_dst: ir::Value,
_val: ir::Value,
_len: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("memory.fill not yet implemented");
}
fn translate_memory_init(
&mut self,
_pos: FuncCursor,
_clif_mem_index: cranelift_wasm::MemoryIndex,
_heap: ir::Heap,
_seg_index: u32,
_dst: ir::Value,
_src: ir::Value,
_len: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("memory.init not yet implemented");
}
fn translate_data_drop(
&mut self,
_pos: FuncCursor,
_seg_index: u32,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("data.drop not yet implemented");
}
fn translate_table_size(
&mut self,
_pos: FuncCursor,
_index: cranelift_wasm::TableIndex,
_table: ir::Table,
) -> cranelift_wasm::WasmResult<ir::Value> {
unimplemented!("table.size not yet implemented");
}
fn translate_table_copy(
&mut self,
_pos: FuncCursor,
_dst_table_index: cranelift_wasm::TableIndex,
_dst_table: ir::Table,
_src_table_index: cranelift_wasm::TableIndex,
_src_table: ir::Table,
_dst: ir::Value,
_src: ir::Value,
_len: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("table.copy not yet implemented");
}
fn translate_table_init(
&mut self,
_pos: FuncCursor,
_seg_index: u32,
_table_index: cranelift_wasm::TableIndex,
_table: ir::Table,
_dst: ir::Value,
_src: ir::Value,
_len: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("table.init not yet implemented");
}
fn translate_elem_drop(
&mut self,
_pos: FuncCursor,
_seg_index: u32,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("elem.drop not yet implemented");
}
fn translate_table_grow(
&mut self,
_pos: FuncCursor,
_table_index: u32,
_delta: ir::Value,
_init_value: ir::Value,
) -> cranelift_wasm::WasmResult<ir::Value> {
unimplemented!("table.grow not yet implemented");
}
fn translate_table_get(
&mut self,
_pos: FuncCursor,
_table_index: u32,
_index: ir::Value,
) -> cranelift_wasm::WasmResult<ir::Value> {
unimplemented!("table.get not yet implemented");
}
fn translate_table_set(
&mut self,
_pos: FuncCursor,
_table_index: u32,
_value: ir::Value,
_index: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("table.set not yet implemented");
}
fn translate_table_fill(
&mut self,
_pos: FuncCursor,
_table_index: u32,
_dst: ir::Value,
_val: ir::Value,
_len: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("table.fill not yet implemented");
}
fn translate_ref_func(
&mut self,
_pos: FuncCursor,
_func_index: u32,
) -> cranelift_wasm::WasmResult<ir::Value> {
unimplemented!("ref.func not yet implemented");
}
fn translate_custom_global_get(
&mut self,
_pos: FuncCursor,
_global_index: cranelift_wasm::GlobalIndex,
) -> cranelift_wasm::WasmResult<ir::Value> {
unimplemented!("custom global.get not yet implemented");
}
fn translate_custom_global_set(
&mut self,
_pos: FuncCursor,
_global_index: cranelift_wasm::GlobalIndex,
_val: ir::Value,
) -> cranelift_wasm::WasmResult<()> {
unimplemented!("custom global.set not yet implemented");
}
}
impl FunctionEnvironment {
@ -1108,9 +1160,21 @@ impl FunctionCodeGenerator<CodegenError> for CraneliftFunctionCodeGenerator {
Ok(())
}
fn feed_local(&mut self, ty: WpType, n: usize) -> Result<(), CodegenError> {
fn feed_local(&mut self, ty: WpType, n: usize, loc: u32) -> Result<(), CodegenError> {
let mut next_local = self.next_local;
cranelift_wasm::declare_locals(&mut self.builder(), n as u32, ty, &mut next_local)?;
let mut builder = FunctionBuilder::new(
&mut self.func,
&mut self.func_translator.func_ctx,
&mut self.position,
);
builder.set_srcloc(ir::SourceLoc::new(loc));
cranelift_wasm::declare_locals(
&mut builder,
n as u32,
ty,
&mut next_local,
&mut self.func_env,
)?;
self.next_local = next_local;
Ok(())
}
@ -1119,7 +1183,12 @@ impl FunctionCodeGenerator<CodegenError> for CraneliftFunctionCodeGenerator {
Ok(())
}
fn feed_event(&mut self, event: Event, _module_info: &ModuleInfo) -> Result<(), CodegenError> {
fn feed_event(
&mut self,
event: Event,
_module_info: &ModuleInfo,
source_loc: u32,
) -> Result<(), CodegenError> {
let op = match event {
Event::Wasm(x) => x,
Event::WasmOwned(ref x) => x,
@ -1131,11 +1200,6 @@ impl FunctionCodeGenerator<CodegenError> for CraneliftFunctionCodeGenerator {
//let builder = self.builder.as_mut().unwrap();
//let func_environment = FuncEnv::new();
//let state = TranslationState::new();
let mut function_environment = FunctionEnvironment {
module_info: Arc::clone(&self.module_info),
target_config: self.target_config.clone(),
clif_signatures: self.clif_signatures.clone(),
};
if self.func_translator.state.control_stack.is_empty() {
return Ok(());
@ -1146,8 +1210,18 @@ impl FunctionCodeGenerator<CodegenError> for CraneliftFunctionCodeGenerator {
&mut self.func_translator.func_ctx,
&mut self.position,
);
let state = &mut self.func_translator.state;
translate_operator(op, &mut builder, state, &mut function_environment)?;
builder.func.collect_debug_info();
builder.set_srcloc(ir::SourceLoc::new(source_loc));
let module_state = ModuleTranslationState::new();
let func_state = &mut self.func_translator.state;
translate_operator(
&module_state,
op,
&mut builder,
func_state,
&mut self.func_env,
)?;
Ok(())
}
@ -1166,7 +1240,7 @@ impl FunctionCodeGenerator<CodegenError> for CraneliftFunctionCodeGenerator {
//
// If the exit block is unreachable, it may not have the correct arguments, so we would
// generate a return instruction that doesn't match the signature.
if state.reachable {
if state.reachable() {
debug_assert!(builder.is_pristine());
if !builder.is_unreachable() {
match return_mode {
@ -1176,6 +1250,8 @@ impl FunctionCodeGenerator<CodegenError> for CraneliftFunctionCodeGenerator {
}
}
builder.finalize();
// Discard any remaining values on the stack. Either we just returned them,
// or the end of the function is unreachable.
state.stack.clear();
@ -1235,13 +1311,16 @@ fn generate_signature(
}
fn pointer_type(mcg: &CraneliftModuleCodeGenerator) -> ir::Type {
ir::Type::int(u16::from(mcg.isa.frontend_config().pointer_bits())).unwrap()
ir::Type::int(u16::from(
mcg.isa.as_ref().unwrap().frontend_config().pointer_bits(),
))
.unwrap()
}
/// Declare local variables for the signature parameters that correspond to WebAssembly locals.
///
/// Return the number of local variables declared.
fn declare_wasm_parameters(builder: &mut FunctionBuilder, entry_block: Ebb) -> usize {
fn declare_wasm_parameters(builder: &mut FunctionBuilder, entry_block: Block) -> usize {
let sig_len = builder.func.signature.params.len();
let mut next_local = 0;
for i in 0..sig_len {
@ -1254,11 +1333,11 @@ fn declare_wasm_parameters(builder: &mut FunctionBuilder, entry_block: Ebb) -> u
builder.declare_var(local, param_type.value_type);
next_local += 1;
let param_value = builder.ebb_params(entry_block)[i];
let param_value = builder.block_params(entry_block)[i];
builder.def_var(local, param_value);
}
if param_type.purpose == ir::ArgumentPurpose::VMContext {
let param_value = builder.ebb_params(entry_block)[i];
let param_value = builder.block_params(entry_block)[i];
builder.set_val_label(param_value, get_vmctx_value_label());
}
}

View File

@ -1,4 +1,19 @@
#![deny(unused_imports, unused_variables, unused_unsafe, unreachable_patterns)]
//! The Wasmer Cranelift Backend crate is used to compile wasm binary code via parse events from the
//! Wasmer runtime common parser code into machine code.
//!
#![deny(
dead_code,
missing_docs,
nonstandard_style,
unused_imports,
unused_mut,
unused_variables,
unused_unsafe,
unreachable_patterns
)]
#![doc(html_favicon_url = "https://wasmer.io/static/icons/favicon.ico")]
#![doc(html_logo_url = "https://avatars3.githubusercontent.com/u/44205449?s=200&v=4")]
mod cache;
mod code;
@ -14,6 +29,7 @@ use cranelift_codegen::{
settings::{self, Configurable},
};
use target_lexicon::Triple;
use wasmer_runtime_core::{backend::CompilerConfig, codegen::SimpleStreamingCompilerGen};
#[macro_use]
extern crate serde_derive;
@ -21,18 +37,35 @@ extern crate serde_derive;
extern crate rayon;
extern crate serde;
fn get_isa() -> Box<isa::TargetIsa> {
fn get_isa(config: Option<&CompilerConfig>) -> Box<dyn isa::TargetIsa> {
let flags = {
let mut builder = settings::builder();
builder.set("opt_level", "best").unwrap();
builder.set("jump_tables_enabled", "false").unwrap();
builder.set("opt_level", "speed_and_size").unwrap();
builder.set("enable_jump_tables", "false").unwrap();
if cfg!(not(test)) {
builder.set("enable_verifier", "false").unwrap();
let enable_verifier: bool;
if let Some(config) = config {
if config.nan_canonicalization {
builder.set("enable_nan_canonicalization", "true").unwrap();
}
enable_verifier = config.enable_verification;
} else {
// Set defaults if no config found.
// NOTE: cfg(test) probably does nothing when not running `cargo test`
// on this crate
enable_verifier = cfg!(test) || cfg!(debug_assertions);
}
builder
.set(
"enable_verifier",
if enable_verifier { "true" } else { "false" },
)
.unwrap();
let flags = settings::Flags::new(builder);
debug_assert_eq!(flags.opt_level(), settings::OptLevel::Best);
debug_assert_eq!(flags.opt_level(), settings::OptLevel::SpeedAndSize);
flags
};
isa::lookup(Triple::host()).unwrap().finish(flags)
@ -41,8 +74,8 @@ fn get_isa() -> Box<isa::TargetIsa> {
/// The current version of this crate
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
use wasmer_runtime_core::codegen::SimpleStreamingCompilerGen;
/// Streaming compiler implementation for the Cranelift backed. Compiles web assembly binary into
/// machine code.
pub type CraneliftCompiler = SimpleStreamingCompilerGen<
code::CraneliftModuleCodeGenerator,
code::CraneliftFunctionCodeGenerator,

View File

@ -76,8 +76,10 @@ pub extern "C" fn nearbyintf64(x: f64) -> f64 {
}
}
/// A declaration for the stack probe function in Rust's standard library, for
/// catching callstack overflow.
extern "C" {
pub fn __rust_probestack();
}
// FIXME: Is there a replacement on AArch64?
#[cfg(all(
any(target_os = "freebsd", target_os = "linux", target_os = "android"),
target_arch = "aarch64"
))]
#[no_mangle]
pub extern "C" fn __rust_probestack() {}

View File

@ -42,9 +42,8 @@ impl Module {
let runnable_module = Caller::new(handler_data, trampolines, func_resolver);
Ok(ModuleInner {
runnable_module: Box::new(runnable_module),
runnable_module: Arc::new(Box::new(runnable_module)),
cache_gen,
info,
})
}
@ -56,7 +55,7 @@ macro_rules! convert_clif_to_runtime_index {
($clif_index:ident, $runtime_index:ident) => {
impl From<Converter<cranelift_wasm::$clif_index>> for $runtime_index {
fn from(clif_index: Converter<cranelift_wasm::$clif_index>) -> Self {
$runtime_index::new(clif_index.0.index())
<$runtime_index as TypedIndex>::new(clif_index.0.index())
}
}
@ -107,7 +106,8 @@ impl From<Converter<ir::Type>> for Type {
ir::types::I64 => Type::I64,
ir::types::F32 => Type::F32,
ir::types::F64 => Type::F64,
_ => panic!("unsupported wasm type"),
ir::types::I32X4 => Type::V128,
_ => unimplemented!("unsupported wasm type"),
}
}
}
@ -119,6 +119,7 @@ impl From<Converter<Type>> for ir::Type {
Type::I64 => ir::types::I64,
Type::F32 => ir::types::F32,
Type::F64 => ir::types::F64,
Type::V128 => ir::types::I32X4,
}
}
}
@ -130,6 +131,7 @@ impl From<Converter<Type>> for ir::AbiParam {
Type::I64 => ir::AbiParam::new(ir::types::I64),
Type::F32 => ir::AbiParam::new(ir::types::F32),
Type::F64 => ir::AbiParam::new(ir::types::F64),
Type::V128 => ir::AbiParam::new(ir::types::I32X4),
}
}
}

View File

@ -98,14 +98,14 @@ pub struct RelocSink {
}
impl binemit::RelocSink for RelocSink {
fn reloc_ebb(
fn reloc_block(
&mut self,
_offset: binemit::CodeOffset,
_reloc: binemit::Reloc,
_ebb_offset: binemit::CodeOffset,
) {
// This should use the `offsets` field of `ir::Function`.
unimplemented!();
unimplemented!("RelocSink::reloc_ebb");
}
fn reloc_external(
&mut self,
@ -146,7 +146,7 @@ impl binemit::RelocSink for RelocSink {
DYNAMIC_MEM_GROW => VmCallKind::DynamicMemoryGrow,
DYNAMIC_MEM_SIZE => VmCallKind::DynamicMemorySize,
_ => unimplemented!(),
_ => unimplemented!("reloc_external VmCall::Local {}", index),
})),
IMPORT_NAMESPACE => RelocationType::VmCall(VmCall::Import(match index {
STATIC_MEM_GROW => VmCallKind::StaticMemoryGrow,
@ -157,10 +157,10 @@ impl binemit::RelocSink for RelocSink {
DYNAMIC_MEM_GROW => VmCallKind::DynamicMemoryGrow,
DYNAMIC_MEM_SIZE => VmCallKind::DynamicMemorySize,
_ => unimplemented!(),
_ => unimplemented!("reloc_external VmCall::Import {}", index),
})),
SIG_NAMESPACE => RelocationType::Signature(SigIndex::new(index as usize)),
_ => unimplemented!(),
_ => unimplemented!("reloc_external SigIndex {}", index),
};
self.external_relocs.push(ExternalRelocation {
reloc,
@ -202,13 +202,18 @@ impl binemit::RelocSink for RelocSink {
}
}
}
fn reloc_constant(&mut self, _: u32, _: cranelift_codegen::binemit::Reloc, _: u32) {
unimplemented!("RelocSink::reloc_constant")
}
fn reloc_jt(
&mut self,
_offset: binemit::CodeOffset,
_reloc: binemit::Reloc,
_jt: ir::JumpTable,
) {
unimplemented!();
unimplemented!("RelocSink::reloc_jt");
}
}

View File

@ -1,29 +1,32 @@
use crate::{cache::BackendCache, trampoline::Trampolines};
use crate::{
cache::BackendCache,
libcalls,
relocation::{
ExternalRelocation, LibCall, LocalRelocation, LocalTrapSink, Reloc, RelocSink,
RelocationType, TrapSink, VmCall, VmCallKind,
},
signal::HandlerData,
trampoline::Trampolines,
};
use byteorder::{ByteOrder, LittleEndian};
use cranelift_codegen::{
binemit::{Stackmap, StackmapSink},
ir, isa, CodegenError, Context, ValueLabelsRanges,
};
use rayon::prelude::*;
use byteorder::{ByteOrder, LittleEndian};
use cranelift_codegen::{ir, isa, Context};
use std::{
mem,
ptr::{write_unaligned, NonNull},
sync::Arc,
};
use wasmer_runtime_core::cache::Error as CacheError;
use wasmer_runtime_core::{
self,
backend::{
sys::{Memory, Protect},
SigRegistry,
},
cache::Error as CacheError,
codegen::WasmSpan,
error::{CompileError, CompileResult},
module::ModuleInfo,
structures::{Map, SliceMap, TypedIndex},
@ -58,6 +61,11 @@ pub struct FuncResolverBuilder {
import_len: usize,
}
pub struct NoopStackmapSink {}
impl StackmapSink for NoopStackmapSink {
fn add_stackmap(&mut self, _: u32, _: Stackmap) {}
}
impl FuncResolverBuilder {
pub fn new_from_backend_cache(
backend_cache: BackendCache,
@ -88,54 +96,184 @@ impl FuncResolverBuilder {
}
pub fn new(
isa: &isa::TargetIsa,
function_bodies: Map<LocalFuncIndex, ir::Function>,
isa: &dyn isa::TargetIsa,
function_bodies: Map<LocalFuncIndex, (ir::Function, WasmSpan)>,
info: &ModuleInfo,
) -> CompileResult<(Self, HandlerData)> {
) -> CompileResult<(
Self,
Option<wasmer_runtime_core::codegen::DebugMetadata>,
HandlerData,
)> {
let num_func_bodies = function_bodies.len();
let mut local_relocs = Map::with_capacity(num_func_bodies);
let mut external_relocs = Map::with_capacity(num_func_bodies);
let mut trap_sink = TrapSink::new();
let compiled_functions: Result<Vec<(Vec<u8>, (RelocSink, LocalTrapSink))>, CompileError> =
function_bodies
.into_vec()
.par_iter()
.map_init(
|| Context::new(),
|ctx, func| {
let mut code_buf = Vec::new();
ctx.func = func.to_owned();
let mut reloc_sink = RelocSink::new();
let mut local_trap_sink = LocalTrapSink::new();
let generate_debug_info = info.generate_debug_info;
let fb = function_bodies.iter().collect::<Vec<(_, _)>>();
ctx.compile_and_emit(
isa,
&mut code_buf,
&mut reloc_sink,
&mut local_trap_sink,
)
.map_err(|e| CompileError::InternalError { msg: e.to_string() })?;
ctx.clear();
Ok((code_buf, (reloc_sink, local_trap_sink)))
},
)
.collect();
#[cfg(feature = "generate-debug-information")]
use wasm_debug::types::CompiledFunctionData;
let compiled_functions = compiled_functions?;
#[cfg(not(feature = "generate-debug-information"))]
type CompiledFunctionData = ();
/// Data about the the compiled machine code.
type CompileMetadata = (
LocalFuncIndex,
Option<(CompiledFunctionData, ValueLabelsRanges, Vec<Option<i32>>)>,
RelocSink,
LocalTrapSink,
);
/// Compiled machine code and information about it
type CompileData = (Vec<u8>, CompileMetadata);
let compiled_functions: Result<Vec<CompileData>, CompileError> = fb
.par_iter()
.map_init(
|| Context::new(),
|ctx, (lfi, (func, _loc))| {
let mut code_buf = Vec::new();
ctx.func = func.to_owned();
let mut reloc_sink = RelocSink::new();
let mut local_trap_sink = LocalTrapSink::new();
let mut stackmap_sink = NoopStackmapSink {};
ctx.compile_and_emit(
isa,
&mut code_buf,
&mut reloc_sink,
&mut local_trap_sink,
&mut stackmap_sink,
)
.map_err(|e| match e {
CodegenError::Verifier(v) => CompileError::InternalError {
msg: format!("Verifier error: {}", v),
},
_ => CompileError::InternalError { msg: e.to_string() },
})?;
#[cfg(feature = "generate-debug-information")]
let debug_entry = if generate_debug_info {
let func = &ctx.func;
let encinfo = isa.encoding_info();
let mut blocks = func.layout.blocks().collect::<Vec<_>>();
blocks.sort_by_key(|block| func.offsets[*block]);
let instructions = blocks
.into_iter()
.flat_map(|block| {
func.inst_offsets(block, &encinfo)
.map(|(offset, inst, length)| {
let srcloc = func.srclocs[inst];
let val = srcloc.bits();
wasm_debug::types::CompiledInstructionData {
srcloc: wasm_debug::types::SourceLoc::new(val),
code_offset: offset as usize,
code_len: length as usize,
}
})
})
.collect::<Vec<_>>();
let stack_slots = ctx
.func
.stack_slots
.iter()
.map(|(_, ssd)| ssd.offset)
.collect::<Vec<Option<i32>>>();
let labels_ranges = ctx.build_value_labels_ranges(isa).unwrap_or_default();
let entry = CompiledFunctionData {
instructions,
start_srcloc: wasm_debug::types::SourceLoc::new(_loc.start()),
end_srcloc: wasm_debug::types::SourceLoc::new(_loc.end()),
// this not being 0 breaks inst-level debugging
body_offset: 0,
body_len: code_buf.len(),
};
Some((entry, labels_ranges, stack_slots))
} else {
None
};
#[cfg(not(feature = "generate-debug-information"))]
let debug_entry = None;
ctx.clear();
Ok((code_buf, (*lfi, debug_entry, reloc_sink, local_trap_sink)))
},
)
.collect();
let mut debug_metadata = if generate_debug_info {
Some(wasmer_runtime_core::codegen::DebugMetadata {
func_info: Map::new(),
inst_info: Map::new(),
pointers: vec![],
stack_slot_offsets: Map::new(),
})
} else {
None
};
let mut compiled_functions = compiled_functions?;
compiled_functions.sort_by(|a, b| (a.1).0.cmp(&(b.1).0));
let compiled_functions = compiled_functions;
let mut total_size = 0;
// We separate into two iterators, one iterable and one into iterable
let (code_bufs, sinks): (Vec<Vec<u8>>, Vec<(RelocSink, LocalTrapSink)>) =
let (code_bufs, sinks): (Vec<Vec<u8>>, Vec<CompileMetadata>) =
compiled_functions.into_iter().unzip();
for (code_buf, (reloc_sink, mut local_trap_sink)) in code_bufs.iter().zip(sinks.into_iter())
for (code_buf, (_, _debug_info, reloc_sink, mut local_trap_sink)) in
code_bufs.iter().zip(sinks.into_iter())
{
let rounded_size = round_up(code_buf.len(), mem::size_of::<usize>());
#[cfg(feature = "generate-debug-information")]
{
if let Some(ref mut dbg_metadata) = debug_metadata {
let (entry, vlr, stackslots) = _debug_info.unwrap();
dbg_metadata.func_info.push(entry);
let new_vlr = vlr
.into_iter()
.map(|(k, v)| {
(
wasm_debug::types::ValueLabel::from_u32(k.as_u32()),
v.into_iter()
.map(|item| wasm_debug::types::ValueLocRange {
start: item.start,
end: item.end,
loc: match item.loc {
cranelift_codegen::ir::ValueLoc::Unassigned => {
wasm_debug::types::ValueLoc::Unassigned
}
cranelift_codegen::ir::ValueLoc::Reg(ru) => {
wasm_debug::types::ValueLoc::Reg(ru)
}
cranelift_codegen::ir::ValueLoc::Stack(st) => {
wasm_debug::types::ValueLoc::Stack(
wasm_debug::types::StackSlot::from_u32(
st.as_u32(),
),
)
}
},
})
.collect::<Vec<wasm_debug::types::ValueLocRange>>(),
)
})
.collect::<wasm_debug::types::ValueLabelsRangesInner>();
dbg_metadata.inst_info.push(new_vlr);
dbg_metadata.stack_slot_offsets.push(stackslots);
}
}
// Clear the local trap sink and consolidate all trap info
// into a single location.
trap_sink.drain_local(total_size, &mut local_trap_sink);
// Round up each function's size to pointer alignment.
total_size += round_up(code_buf.len(), mem::size_of::<usize>());
total_size += rounded_size;
local_relocs.push(reloc_sink.local_relocs.into_boxed_slice());
external_relocs.push(reloc_sink.external_relocs.into_boxed_slice());
@ -167,7 +305,14 @@ impl FuncResolverBuilder {
let mut previous_end = 0;
for compiled in code_bufs.iter() {
let new_end = previous_end + round_up(compiled.len(), mem::size_of::<usize>());
let length = round_up(compiled.len(), mem::size_of::<usize>());
if let Some(ref mut dbg_metadata) = debug_metadata {
dbg_metadata.pointers.push((
(memory.as_ptr() as usize + previous_end) as *const u8,
length,
));
}
let new_end = previous_end + length;
unsafe {
memory.as_slice_mut()[previous_end..previous_end + compiled.len()]
.copy_from_slice(&compiled[..]);
@ -189,7 +334,7 @@ impl FuncResolverBuilder {
func_resolver_builder.relocate_locals();
Ok((func_resolver_builder, handler_data))
Ok((func_resolver_builder, debug_metadata, handler_data))
}
fn relocate_locals(&mut self) {
@ -241,25 +386,17 @@ impl FuncResolverBuilder {
#[cfg(not(target_os = "windows"))]
LibCall::Probestack => __rust_probestack as isize,
},
RelocationType::Intrinsic(ref name) => match name.as_str() {
"i32print" => i32_print as isize,
"i64print" => i64_print as isize,
"f32print" => f32_print as isize,
"f64print" => f64_print as isize,
"strtdbug" => start_debug as isize,
"enddbug" => end_debug as isize,
_ => Err(CompileError::InternalError {
msg: format!("unexpected intrinsic: {}", name),
})?,
},
RelocationType::Intrinsic(ref name) => Err(CompileError::InternalError {
msg: format!("unexpected intrinsic: {}", name),
})?,
RelocationType::VmCall(vmcall) => match vmcall {
VmCall::Local(kind) => match kind {
VmCallKind::StaticMemoryGrow => vmcalls::local_static_memory_grow as _,
VmCallKind::StaticMemorySize => vmcalls::local_static_memory_size as _,
VmCallKind::SharedStaticMemoryGrow => unimplemented!(),
VmCallKind::SharedStaticMemorySize => unimplemented!(),
VmCallKind::StaticMemoryGrow | VmCallKind::SharedStaticMemoryGrow => {
vmcalls::local_static_memory_grow as _
}
VmCallKind::StaticMemorySize | VmCallKind::SharedStaticMemorySize => {
vmcalls::local_static_memory_size as _
}
VmCallKind::DynamicMemoryGrow => {
vmcalls::local_dynamic_memory_grow as _
}
@ -268,16 +405,12 @@ impl FuncResolverBuilder {
}
},
VmCall::Import(kind) => match kind {
VmCallKind::StaticMemoryGrow => {
VmCallKind::StaticMemoryGrow | VmCallKind::SharedStaticMemoryGrow => {
vmcalls::imported_static_memory_grow as _
}
VmCallKind::StaticMemorySize => {
VmCallKind::StaticMemorySize | VmCallKind::SharedStaticMemorySize => {
vmcalls::imported_static_memory_size as _
}
VmCallKind::SharedStaticMemoryGrow => unimplemented!(),
VmCallKind::SharedStaticMemorySize => unimplemented!(),
VmCallKind::DynamicMemoryGrow => {
vmcalls::imported_dynamic_memory_grow as _
}
@ -366,28 +499,3 @@ impl FuncResolver {
fn round_up(n: usize, multiple: usize) -> usize {
(n + multiple - 1) & !(multiple - 1)
}
extern "C" fn i32_print(_ctx: &mut vm::Ctx, n: i32) {
eprint!(" i32: {},", n);
}
extern "C" fn i64_print(_ctx: &mut vm::Ctx, n: i64) {
eprint!(" i64: {},", n);
}
extern "C" fn f32_print(_ctx: &mut vm::Ctx, n: f32) {
eprint!(" f32: {},", n);
}
extern "C" fn f64_print(_ctx: &mut vm::Ctx, n: f64) {
eprint!(" f64: {},", n);
}
extern "C" fn start_debug(ctx: &mut vm::Ctx, func_index: u32) {
if let Some(symbol_map) = unsafe { ctx.borrow_symbol_map() } {
if let Some(fn_name) = symbol_map.get(&func_index) {
eprint!("func ({} ({})), args: [", fn_name, func_index);
return;
}
}
eprint!("func ({}), args: [", func_index);
}
extern "C" fn end_debug(_ctx: &mut vm::Ctx) {
eprintln!(" ]");
}

View File

@ -1,12 +1,15 @@
use crate::relocation::{TrapData, TrapSink};
use crate::resolver::FuncResolver;
use crate::trampoline::Trampolines;
use crate::{
relocation::{TrapData, TrapSink},
resolver::FuncResolver,
trampoline::Trampolines,
};
use libc::c_void;
use std::{any::Any, cell::Cell, ptr::NonNull, sync::Arc};
use std::{cell::Cell, ptr::NonNull, sync::Arc};
use wasmer_runtime_core::{
backend::RunnableModule,
error::RuntimeError,
module::ModuleInfo,
typed_func::{Wasm, WasmTrapInfo},
typed_func::{Trampoline, Wasm},
types::{LocalFuncIndex, SigIndex},
vm,
};
@ -24,12 +27,7 @@ pub use self::unix::*;
pub use self::windows::*;
thread_local! {
pub static TRAP_EARLY_DATA: Cell<Option<Box<dyn Any>>> = Cell::new(None);
}
pub enum CallProtError {
Trap(WasmTrapInfo),
Error(Box<dyn Any>),
pub static TRAP_EARLY_DATA: Cell<Option<RuntimeError>> = Cell::new(None);
}
pub struct Caller {
@ -59,13 +57,12 @@ impl RunnableModule for Caller {
fn get_trampoline(&self, _: &ModuleInfo, sig_index: SigIndex) -> Option<Wasm> {
unsafe extern "C" fn invoke(
trampoline: unsafe extern "C" fn(*mut vm::Ctx, NonNull<vm::Func>, *const u64, *mut u64),
trampoline: Trampoline,
ctx: *mut vm::Ctx,
func: NonNull<vm::Func>,
args: *const u64,
rets: *mut u64,
trap_info: *mut WasmTrapInfo,
user_error: *mut Option<Box<dyn Any>>,
error_out: *mut Option<RuntimeError>,
invoke_env: Option<NonNull<c_void>>,
) -> bool {
let handler_data = &*invoke_env.unwrap().cast().as_ptr();
@ -82,10 +79,7 @@ impl RunnableModule for Caller {
match res {
Err(err) => {
match err {
CallProtError::Trap(info) => *trap_info = info,
CallProtError::Error(data) => *user_error = Some(data),
}
*error_out = Some(err.into());
false
}
Ok(()) => true,
@ -106,7 +100,7 @@ impl RunnableModule for Caller {
})
}
unsafe fn do_early_trap(&self, data: Box<dyn Any>) -> ! {
unsafe fn do_early_trap(&self, data: RuntimeError) -> ! {
TRAP_EARLY_DATA.with(|cell| cell.set(Some(data)));
trigger_trap()
}

View File

@ -10,7 +10,7 @@
//! unless you have memory unsafety elsewhere in your code.
//!
use crate::relocation::{TrapCode, TrapData};
use crate::signal::{CallProtError, HandlerData};
use crate::signal::HandlerData;
use libc::{c_int, c_void, siginfo_t};
use nix::sys::signal::{
sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal, SIGBUS, SIGFPE, SIGILL, SIGSEGV,
@ -18,7 +18,8 @@ use nix::sys::signal::{
use std::cell::{Cell, UnsafeCell};
use std::ptr;
use std::sync::Once;
use wasmer_runtime_core::typed_func::WasmTrapInfo;
use wasmer_runtime_core::backend::ExceptionCode;
use wasmer_runtime_core::error::InvokeError;
extern "C" fn signal_trap_handler(
signum: ::nix::libc::c_int,
@ -65,7 +66,7 @@ pub unsafe fn trigger_trap() -> ! {
pub fn call_protected<T>(
handler_data: &HandlerData,
f: impl FnOnce() -> T,
) -> Result<T, CallProtError> {
) -> Result<T, InvokeError> {
unsafe {
let jmp_buf = SETJMP_BUFFER.with(|buf| buf.get());
let prev_jmp_buf = *jmp_buf;
@ -79,27 +80,38 @@ pub fn call_protected<T>(
*jmp_buf = prev_jmp_buf;
if let Some(data) = super::TRAP_EARLY_DATA.with(|cell| cell.replace(None)) {
Err(CallProtError::Error(data))
Err(InvokeError::EarlyTrap(Box::new(data)))
} else {
let (faulting_addr, inst_ptr) = CAUGHT_ADDRESSES.with(|cell| cell.get());
if let Some(TrapData {
trapcode,
srcloc: _,
}) = handler_data.lookup(inst_ptr)
{
Err(CallProtError::Trap(match Signal::from_c_int(signum) {
if let Some(TrapData { trapcode, srcloc }) = handler_data.lookup(inst_ptr) {
let code = match Signal::from_c_int(signum) {
Ok(SIGILL) => match trapcode {
TrapCode::BadSignature => WasmTrapInfo::IncorrectCallIndirectSignature,
TrapCode::IndirectCallToNull => WasmTrapInfo::CallIndirectOOB,
TrapCode::HeapOutOfBounds => WasmTrapInfo::MemoryOutOfBounds,
TrapCode::TableOutOfBounds => WasmTrapInfo::CallIndirectOOB,
_ => WasmTrapInfo::Unknown,
TrapCode::StackOverflow => ExceptionCode::MemoryOutOfBounds,
TrapCode::HeapOutOfBounds => ExceptionCode::MemoryOutOfBounds,
TrapCode::TableOutOfBounds => ExceptionCode::CallIndirectOOB,
TrapCode::OutOfBounds => ExceptionCode::MemoryOutOfBounds,
TrapCode::IndirectCallToNull => ExceptionCode::CallIndirectOOB,
TrapCode::BadSignature => ExceptionCode::IncorrectCallIndirectSignature,
TrapCode::IntegerOverflow => ExceptionCode::IllegalArithmetic,
TrapCode::IntegerDivisionByZero => ExceptionCode::IllegalArithmetic,
TrapCode::BadConversionToInteger => ExceptionCode::IllegalArithmetic,
TrapCode::UnreachableCodeReached => ExceptionCode::Unreachable,
_ => {
return Err(InvokeError::UnknownTrapCode {
trap_code: format!("{:?}", trapcode),
srcloc,
})
}
},
Ok(SIGSEGV) | Ok(SIGBUS) => WasmTrapInfo::MemoryOutOfBounds,
Ok(SIGFPE) => WasmTrapInfo::IllegalArithmetic,
_ => unimplemented!(),
}))
Ok(SIGSEGV) | Ok(SIGBUS) => ExceptionCode::MemoryOutOfBounds,
Ok(SIGFPE) => ExceptionCode::IllegalArithmetic,
_ => unimplemented!(
"ExceptionCode::Unknown signal:{:?}",
Signal::from_c_int(signum)
),
};
Err(InvokeError::TrapCode { srcloc, code })
} else {
let signal = match Signal::from_c_int(signum) {
Ok(SIGFPE) => "floating-point exception",
@ -110,8 +122,10 @@ pub fn call_protected<T>(
_ => "unknown trapped signal",
};
// When the trap-handler is fully implemented, this will return more information.
let s = format!("unknown trap at {:p} - {}", faulting_addr, signal);
Err(CallProtError::Error(Box::new(s)))
Err(InvokeError::UnknownTrap {
address: faulting_addr as usize,
signal,
})
}
}
} else {
@ -138,7 +152,99 @@ pub unsafe fn do_unwind(signum: i32, siginfo: *const c_void, ucontext: *const c_
longjmp(jmp_buf as *mut ::nix::libc::c_void, signum)
}
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
#[cfg(all(target_os = "freebsd", target_arch = "aarch64"))]
unsafe fn get_faulting_addr_and_ip(
_siginfo: *const c_void,
_ucontext: *const c_void,
) -> (*const c_void, *const c_void) {
(::std::ptr::null(), ::std::ptr::null())
}
#[cfg(all(target_os = "freebsd", target_arch = "x86_64"))]
unsafe fn get_faulting_addr_and_ip(
siginfo: *const c_void,
ucontext: *const c_void,
) -> (*const c_void, *const c_void) {
#[repr(C)]
pub struct ucontext_t {
uc_sigmask: libc::sigset_t,
uc_mcontext: mcontext_t,
uc_link: *mut ucontext_t,
uc_stack: libc::stack_t,
uc_flags: i32,
__spare__: [i32; 4],
}
#[repr(C)]
pub struct mcontext_t {
mc_onstack: u64,
mc_rdi: u64,
mc_rsi: u64,
mc_rdx: u64,
mc_rcx: u64,
mc_r8: u64,
mc_r9: u64,
mc_rax: u64,
mc_rbx: u64,
mc_rbp: u64,
mc_r10: u64,
mc_r11: u64,
mc_r12: u64,
mc_r13: u64,
mc_r14: u64,
mc_r15: u64,
mc_trapno: u32,
mc_fs: u16,
mc_gs: u16,
mc_addr: u64,
mc_flags: u32,
mc_es: u16,
mc_ds: u16,
mc_err: u64,
mc_rip: u64,
mc_cs: u64,
mc_rflags: u64,
mc_rsp: u64,
mc_ss: u64,
mc_len: i64,
mc_fpformat: i64,
mc_ownedfp: i64,
mc_fpstate: [i64; 64], // mc_fpstate[0] is a pointer to savefpu
mc_fsbase: u64,
mc_gsbase: u64,
mc_xfpustate: u64,
mc_xfpustate_len: u64,
mc_spare: [i64; 4],
}
let siginfo = siginfo as *const siginfo_t;
let si_addr = (*siginfo).si_addr;
let ucontext = ucontext as *const ucontext_t;
let rip = (*ucontext).uc_mcontext.mc_rip;
(si_addr, rip as _)
}
#[cfg(all(
any(target_os = "linux", target_os = "android"),
target_arch = "aarch64"
))]
unsafe fn get_faulting_addr_and_ip(
_siginfo: *const c_void,
_ucontext: *const c_void,
) -> (*const c_void, *const c_void) {
(::std::ptr::null(), ::std::ptr::null())
}
#[cfg(all(
any(target_os = "linux", target_os = "android"),
target_arch = "x86_64"
))]
unsafe fn get_faulting_addr_and_ip(
siginfo: *const c_void,
ucontext: *const c_void,
@ -228,7 +334,12 @@ unsafe fn get_faulting_addr_and_ip(
}
#[cfg(not(any(
all(target_os = "freebsd", target_arch = "aarch64"),
all(target_os = "freebsd", target_arch = "x86_64"),
all(target_os = "macos", target_arch = "x86_64"),
all(target_os = "linux", target_arch = "x86_64"),
all(target_os = "linux", target_arch = "aarch64"),
all(target_os = "android", target_arch = "x86_64"),
all(target_os = "android", target_arch = "aarch64"),
)))]
compile_error!("This crate doesn't yet support compiling on operating systems other than linux and macos and architectures other than x86_64");

Some files were not shown because too many files have changed in this diff Show More