Commit graph

54 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
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
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
eaa3f14fb0
repl_test: start re-writing the Wasm tests to use roc_wasm_interp 2022-12-16 14:52:05 +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
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
18e9051760
wasm_interp: fix a bug in implicit return 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
2abae1b5e1
wasm_interp: Don't panic while pushing a stack frame 2022-12-06 20:31:50 +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
6820278672
wasm_interp: fix memory instructions (immediate arg for memory index) 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
Brian Carroll
513a346fe1
wasm_interp: end all function blocks on RETURN op 2022-12-06 08:59:08 +00:00
Brian Carroll
ad2973cd8d
wasm_interp: fix call_indirect immediates order 2022-12-06 08:59:08 +00:00
Brian Carroll
6d43763ab7
wasm_interp: dump a stack trace on error 2022-12-06 08:59:08 +00:00
Brian Carroll
5bdd1b5628
wasm_interp: use Result instead of panic. Focus debug info on *Wasm app*, not interp. 2022-12-06 08:59:08 +00:00
Brian Carroll
284dc6fa51
wasm_interp: support WASI argc/argv, and writing to stdout/stderr 2022-12-05 22:16:27 +00:00
Brian Carroll
42a15d07b3
wasm_interp: Just don't support non-function imports! I've never seen them anyway. 2022-12-02 07:47:49 +00:00
Brian Carroll
c38164ce8a
wasm_interp: cache import indices instead of signatures 2022-12-02 07:47:49 +00:00
Brian Carroll
0cf2f4f9e4
clippy 2022-12-01 21:56:59 +00:00
Brian Carroll
c866ce6b09
wasm_interp: Handle calls to imports 2022-12-01 20:41:38 +00:00
Brian Carroll
ec8950816a
wasm_interp: expose both call_export_from_cli and call_export (for library usage) 2022-11-30 23:20:58 +00:00
Brian Carroll
d29ea7fedf
wasm_interp: last few instructions! 2022-11-29 08:59:37 +00:00
Brian Carroll
17810d5134
wasm_interp: float rounding ops 2022-11-29 08:43:56 +00:00
Brian Carroll
714586fac1
wasm_interp: f32 convert instructions 2022-11-29 08:06:18 +00:00
Brian Carroll
029f0d00c1
wasm_interp: truncate instructions 2022-11-29 08:06:18 +00:00
Brian Carroll
afa57a027b
wasm_interp: implement some number conversion ops 2022-11-28 23:28:08 +00:00
Brian Carroll
94ca352ed7
wasm_interp: 'reinterpret' instructions 2022-11-28 23:28:08 +00:00