Commit Graph

5594 Commits

Author SHA1 Message Date
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