Commit Graph

155 Commits

Author SHA1 Message Date
Brian Carroll
83b5607022
wasm_interp: rename various variables stack->store 2022-12-18 01:09:20 +00:00
Brian Carroll
f968999ab4
wasm_interp: rename Instance::value_stack -> value_store 2022-12-18 00:21:07 +00:00
Brian Carroll
6cfc7dc6a0
wasm_interp: comments on ValueStore 2022-12-18 00:21:07 +00:00
Brian Carroll
963e6dc6b9
wasm_interp: rename struct ValueStack -> ValueStore 2022-12-18 00:21:06 +00:00
Brian Carroll
a3c6cfbc0e
wasm_interp: rename module value_stack -> value_store 2022-12-18 00:20:29 +00:00
Brian Carroll
84e6267508
wasm_interp: re-implement stack trace printing 2022-12-18 00:17:11 +00:00
Brian Carroll
4742033d00
wasm_interp: simplify do_return 2022-12-17 20:52:19 +00:00
Brian Carroll
6beac8d56a
wasm_interp: fix bug in position of locals block 2022-12-17 20:52:19 +00:00
Brian Carroll
b87cb69d94
wasm_interp: create a debug visualisation for values and blocks 2022-12-17 20:52:19 +00:00
Brian Carroll
b0d2e7a409
wasm_interp: store return type in frame & create SignatureParamsIter 2022-12-17 20:52:19 +00:00
Brian Carroll
d51beb073f
wasm_interp: create a block for each function and get tests working again 2022-12-17 20:52:19 +00:00
Brian Carroll
caedb9060b
wasm_interp: remove CallStack, create Frame, & share value storage for stack and locals
This allows us to do calls without moving arguments from one place to another
2022-12-17 20:52:19 +00:00
Brian Carroll
ef69170b88
wasm_interp: fix typo bug in WASI random_get 2022-12-17 20:49:25 +00:00
Brian Carroll
3588e57c6a
clippy 2022-12-16 16:22:52 +00:00
Brian Carroll
66aaa7c73c
wasm_interp: Use String for CLI args. It was crashing with OsString. 2022-12-16 16:04:22 +00:00
Brian Carroll
27f2050d10
wasm_interp: implement WASI fd_read 2022-12-16 14:52:11 +00:00
Brian Carroll
eaf0211808
cli: update run_wasm to use roc_wasm_interp 2022-12-16 14:52:11 +00:00
Brian Carroll
3ef171e620
wasm_interp: support fake files in WASI 2022-12-16 14:52:11 +00:00
Brian Carroll
ca0f159386
wasm_interp: allow WASI to take bytes rather than strings for argv 2022-12-16 14:52:10 +00:00
Brian Carroll
4501f2af0e
wasm_interp: create Instance::from_bytes 2022-12-16 14:52:10 +00:00
Brian Carroll
4d5b7f8b73
wasm_interp: add a WasmModule to Instance so we don't have to pass it to call_export 2022-12-16 14:52:10 +00:00
Brian Carroll
490ea1cad2
wasm_interp: shard the branch cache by function, for 3x speedup on REPL! 2022-12-16 14:52:10 +00:00
Brian Carroll
b7fef386ee
wasm_interp: implement WASI random_get & refactor default imports 2022-12-16 14:52:05 +00:00
Brian Carroll
eaa3f14fb0
repl_test: start re-writing the Wasm tests to use roc_wasm_interp 2022-12-16 14:52:05 +00:00
Brian Carroll
1a14dbba19
wasm_interp: remove leftover code from profiling 2022-12-14 12:10:21 +00:00
Brian Carroll
8052c2bb19
wasm_interp: create a branch cache to improve perf in some programs 2022-12-14 08:42:01 +00:00
Brian Carroll
6d0e7426dc
wasm_interp: handle if without else 2022-12-14 08:42:01 +00:00
Brian Carroll
0acf55137f
wasm_interp: remove unnecessary &mut from read_i32/read_u32 2022-12-14 08:42:01 +00:00
Brian Carroll
3d5edf57fc
wasm_interp: If called function is not found in exports, look in name section too 2022-12-14 08:42:01 +00:00
Brian Carroll
b585bd5fde
wasm_interp: debug print displays the called export 2022-12-14 08:42:01 +00:00
Brian Carroll
06c675703a
wasm_interp: bring back debug output 2022-12-14 08:42:01 +00:00
Brian Carroll
ed18bf7709
wasm_interp: rename ValueStack::len -> depth 2022-12-10 00:52:23 +00:00
Brian Carroll
76341c7611
wasm_interp: truncate ValueStack on leaving a block 2022-12-10 00:52:23 +00:00
Brian Carroll
612c258e35
wasm_interp: simplify CallStack for easier debugging 2022-12-10 00:52:23 +00:00
Brian Carroll
18e9051760
wasm_interp: fix a bug in implicit return 2022-12-10 00:52:23 +00:00
Brian Carroll
90449f45f3
test_gen: get some tests working with roc_wasm_interp 2022-12-10 00:52:23 +00:00
Brian Carroll
8c7d9dbff8
wasm_interp: Make ValueStack a dumb Vec<Value> => Zig test 146.3->124.6ms 2022-12-09 23:20:50 +00:00
Brian Carroll
d43129d578
wasm_interp: code comment about empty implementation of WASI clock functions 2022-12-09 23:20:50 +00:00
Brian Carroll
2abae1b5e1
wasm_interp: Don't panic while pushing a stack frame 2022-12-06 20:31:50 +00:00
Brian Carroll
4cf5d19ace
wasm_interp: Fix bug where all arguments were being set as I32 2022-12-06 20:23:34 +00:00
Brian Carroll
1b126d3b58
wasm_interp: Don't panic when setting a local variable 2022-12-06 20:22:05 +00:00
Brian Carroll
9d912a6cc7
wasm_interp: don't panic when unwrapping Value 2022-12-06 20:19:25 +00:00
Brian Carroll
c7a75bf770
wasm_interp: comment to clarify the two CLI systems 2022-12-06 09:38:08 +00:00
Brian Carroll
df5baf4211
clippy 2022-12-06 09:02:59 +00:00
Brian Carroll
2dac57c2bb
wasm_interp: self-review fixes 2022-12-06 08:59:17 +00:00
Brian Carroll
dfbee7b916
wasm_interp: ensure WASI argv[0] is the .wasm executable 2022-12-06 08:59:17 +00:00
Brian Carroll
aa76634751
wasm_interp: implement WASI proc_exit 2022-12-06 08:59:17 +00:00
Brian Carroll
6820278672
wasm_interp: fix memory instructions (immediate arg for memory index) 2022-12-06 08:59:17 +00:00
Brian Carroll
b938e546b2
wasm_interp: In stack trace, last frame shouldn't show previous CALL address 2022-12-06 08:59:17 +00:00
Brian Carroll
0f5b7be945
wasm_interp: dump stack trace on unreachable instruction 2022-12-06 08:59:17 +00:00