Commit Graph

19 Commits

Author SHA1 Message Date
Jef
1eb419cdda Implement memory.size/memory.grow, globals, call_indirect 2019-03-15 11:51:11 +01:00
Jef
45ccc591cd Fix br_if and br_table 2019-03-07 13:21:04 +01:00
Jef
a4e878da75 Add more store instructions 2019-03-06 14:03:40 +01:00
Jef
0cfc917c97 Fix some ugliness 2019-03-01 08:15:42 +01:00
Jef
f726a8f36d Add float operations 2019-02-25 15:35:45 +01:00
Jef
ab6b8e983a Add floats 2019-02-25 11:17:21 +01:00
Jef
830644e7d0 Remove printlns, make pushing stack arguments work properly 2019-02-19 15:44:04 +01:00
Jef
f1d9ccb9e8 Implement Microwasm 2019-02-19 14:51:30 +01:00
Jef
7e5c3c567f Signature checking for call_indirect, integrate with wasmtime 2019-02-08 11:46:25 +01:00
Jef
e57cec3b3f Do call_indirect properly, by accessing the table section 2019-01-18 13:01:42 +01:00
Jef
a7fa7da7d4 Support a proper vmctx that contains more than just memory offset 2019-01-16 16:34:24 +01:00
Jef
1b6952bb99 Implement vmctx as a hidden argument for cranelift compat 2019-01-15 12:27:55 +01:00
Jef
8312730377 Make calling functions safe 2019-01-14 18:45:14 +01:00
Jef
1eebc65c9e First baby steps to supporting memory accesses
Currently we don't actually sandbox the memory at all, so you can do evil things
like read and write the host's memory. We also don't support growing memory or
cranelift-compatible ABI that passes the memory offset as an argument.

We also always immediately allocate the buffer when encountering a memory section,
there is preliminary support for translating a buffer which can then have the real
offset replaced using relocations (and returning a different type when doing so)
but I haven't written the code that actually does relocation so it doesn't work yet.
2019-01-11 15:20:32 +01:00
Sergey Pepyakin
078486e080 Basic form of a function call 2018-12-07 19:16:42 +01:00
Sergey Pepyakin
5eb43f027a Introduce TranslationContext 2018-11-29 22:28:10 +01:00
Sergey Pepyakin
52c0443368 Pass function sig in function_body::translate 2018-11-29 18:58:14 +01:00
Sergey Pepyakin
08240761d5 Compile a simple function (#2)
* Implement basics.

* Execute code

* Add wasm2wat test cases.

* abi_loc_for_arg for stack.

* Assert that sp_depth is 0 at the epilogue

* Do 32bit add.

* Assert that RAX can be used as a scratch register

* Reuse assembler.

* Align stack slots.
2018-11-08 13:56:27 -08:00
Dan Gohman
154b35ecc1 Initial experiment. 2018-10-29 12:02:01 -07:00