Commit Graph

67 Commits

Author SHA1 Message Date
Jef
1ff22de331 Remove unused code 2019-03-26 17:50:03 +01:00
Jef
96df539554 Remove unused code 2019-03-26 17:40:57 +01:00
Jef
cf9c57e279 Fix br_if calling convention handling 2019-03-26 10:29:55 +01:00
Jef
3798890d71 Fix inter-function calls assuming that functions are allocated sequentially 2019-03-26 09:01:09 +01:00
Jef
791ccf84b4 Free up registers where possible 2019-03-21 13:33:00 +01:00
Jef
6b8ff11854 Implement imported mutable globals 2019-03-20 10:57:55 +01:00
Jef
e4752aae3d Several fixes, implement imported globals 2019-03-19 15:22:05 +01:00
Jef
64ab86f9bc Add new test results 2019-03-18 20:42:08 +01:00
Jef
4e48dad9b6 Add host calls 2019-03-18 19:41:36 +01:00
Jef
a8a26b5948 Fix some float issues 2019-03-16 13:04:49 +01:00
Jef
e4260d1f6e Add more float ops 2019-03-15 13:13:34 +01:00
Jef
938d7701d9 Add float equality 2019-03-15 12:23:12 +01:00
Jef
1eb419cdda Implement memory.size/memory.grow, globals, call_indirect 2019-03-15 11:51:11 +01:00
Jef
a9ab1a1467 Add conversions, update tests in readme 2019-03-12 18:29:01 +01:00
Jef
5ae789ab7b Fix div and rem 2019-03-12 16:26:58 +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
71662af0fa Integer division 2019-02-28 18:09:22 +01:00
Jef
677d54e46d Experimental br_table support 2019-02-27 17:59:27 +01:00
Jef
15bf933be7 Add more float operations 2019-02-27 11:29:23 +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
f1d9ccb9e8 Implement Microwasm 2019-02-19 14:51:30 +01:00
Jef
680a8ed585 Add select 2019-02-08 13:24:59 +01:00
Jef
7e5c3c567f Signature checking for call_indirect, integrate with wasmtime 2019-02-08 11:46:25 +01:00
Jef
2fad984a0d Shift and rotate 2019-01-30 11:06:32 +01:00
Jef
e57cec3b3f Do call_indirect properly, by accessing the table section 2019-01-18 13:01:42 +01:00
Jef
e0f032a0e5 clz/ctz/popcnt 2019-01-17 13:51:18 +01:00
Jef
74d168ec4b Merge ends, store locals in registers where possible 2019-01-17 11:07:51 +01:00
Jef
a7fa7da7d4 Support a proper vmctx that contains more than just memory offset 2019-01-16 16:34:24 +01:00
Jef
d7434fe5d2 Have vmctx be the first argument so we (almost) never have to shuffle it around 2019-01-16 09:33:46 +01:00
Jef
62fe065e85 Fix miscompilation for maliciously-crafted use of locals 2019-01-15 14:00:43 +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
Jef
010f2d8569 Fix comparisons, add more tests for binops 2019-01-08 09:45:39 +01:00
Jef
fcd18746a7 Add 64-bit operations 2019-01-07 19:17:29 +01:00
Jef
9decdca525 Add Return 2018-12-19 16:39:20 +00:00
Jef
c52cf1493a Reformat a comment 2018-12-19 14:46:32 +01:00
Jef
f91b9072de Fix some issues with the use of stack depth 2018-12-19 14:42:00 +01:00
Jef
3b5c11a92a Test comparison operators 2018-12-19 12:58:08 +01:00
Jef
2173f4bcca Add other comparison operators, fix materialising locals, add more TODO comments (v. important) 2018-12-19 12:42:35 +01:00
Jef
cbf34a455b Add factorial tests from spec (after fixing them slightly) 2018-12-19 10:40:31 +01:00
Jef
72855e48c7 Improve behaviour when adding literal to non-literal, materialise local if its value will be changed
Currently the implementation of materializing locals causes compilation to be non-linear in degenerate cases
2018-12-18 19:15:29 +01:00
Jef
5418241dc6 Allow blocks to return values in any register 2018-12-18 17:16:38 +01:00
Jef
74ffb8560c Fix use of locals 2018-12-18 12:12:17 +01:00
Jef
53841cdb07 Add loops 2018-12-17 12:50:29 +01:00
Jef
23b5a56a7d Fix locals not being restored properly (which may cause us to read garbage values from the stack) 2018-12-17 12:16:40 +01:00
Jef
1e04dc90b6 Make more tests quickcheck-compatible, remove unused code 2018-12-14 16:35:48 +01:00