20 Commits

Author SHA1 Message Date
Ivan Enderlin
c3c6fcbfdd 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
55a5b97443 feat(interface-types) Implement the string.size instruction. 2020-03-24 15:33:42 +01:00
Ivan Enderlin
7a2db276f3 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
9af32b273c 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
Ivan Enderlin
8bd3345a79 feat(interface-types) Remove the 'input lifetime on Instruction. 2020-03-10 10:37:09 +01:00
Ivan Enderlin
47b63bc9c6 Merge branch 'master' into feat-interface-types-instructions-string-and-memory 2020-03-10 10:33:56 +01:00
Ivan Enderlin
a93421f6c2 feat(interface-types) Rename write-utf8 to string-to-memory. 2020-03-10 10:25:58 +01:00
Ivan Enderlin
2d6b987791 feat(interface-types) read-utf8 is renamed memory-to-string. 2020-03-09 15:06:35 +01:00
Ivan Enderlin
f342670532 feat(interface-types) Rename call to call-core, and remove call-export. 2020-03-09 14:33:17 +01:00
Ivan Enderlin
55029b7c36 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
8dacaab080 feat(interface-types) Remove abandonned instructions. 2020-02-26 15:48:00 +01:00
Ivan Enderlin
09498ee286 fix(interface-types) arg.get's index is of type u32. 2020-02-26 15:42:29 +01:00
Ivan Enderlin
d4c01e8ddc test(interface-types) Fix all tests based on previous commits. 2020-02-26 15:32:14 +01:00
Ivan Enderlin
f9ef4a650b 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
Ivan Enderlin
410d8d4476 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
165a8ca585 feat(interface-types) Forwarded adapters have been removed. 2020-02-24 15:56:11 +01:00
Ivan Enderlin
1f2a5640a6 feat(interface-types) The “helper adapter” has been removed. 2020-02-24 15:49:03 +01:00
Ivan Enderlin
09e57b7156 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
Ivan Enderlin
fdcc511dd8 test(interface-types) Fix one bug and write the test suite. 2020-02-17 13:55:59 +01:00
Ivan Enderlin
50cbe79151 feat(interface-types) Add the binary encoder. 2020-02-17 13:55:59 +01:00