Commit graph

3927 commits

Author SHA1 Message Date
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
473dd371b0
wasm_module: when parsing, and a linking section is not found, reset the cursor 2022-12-14 08:42:01 +00:00
Brian Carroll
9fef0c319f
test_gen: pass Wasm linking test without DCE 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
eaf2782bbd
test_gen: refactor wasm_linking execute_wasm_bytes->execute_wasm_module 2022-12-14 08:42:01 +00:00
Brian Carroll
c8b0e91f3c
test_gen: refactor wasm_linking tests to share more code 2022-12-14 08:42:01 +00:00
Brian Carroll
b4c0ac14c8
gen_wasm: comment about debug env var 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
74bb8cc843
gen_wasm: fix type error in i64 shift operators 2022-12-14 08:42:01 +00:00
Brian Carroll
deab384d02
test_gen: u64 is not always the same size as a pointer, guys, jeez 2022-12-10 00:52:23 +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
1f90286d64
wasm_module: unsafe From<u8> for Opcode takes 6% off Zig test time 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
Richard Feldman
5cfa6d8e12
Expand List.range docs 2022-12-08 05:56:53 -05:00
Richard Feldman
da5d0bd815
Merge pull request #4686 from roc-lang/list-range
Switch to more expressive list.range
2022-12-08 02:51:42 -05:00
Brendan Hansknecht
759130952d
fix glue generation for Dict and Set 2022-12-07 20:53:50 -08:00
Ayaz Hafiz
b66813d2db
Check in test for #4705 2022-12-07 10:59:05 -06:00
Ayaz Hafiz
c5dd688e3e
Correct sorting of generated procs for mono test 2022-12-07 10:58:50 -06:00
Ayaz Hafiz
42fe19541e
Define inline expects defs in their definition order
When we transform a top-level expect into an inline expect, we collect
all intermediate defs before the expect condition, then layer the defs
back on. Because the layering procedure builds an expression bottom-up,
we must layer on defs in reverse definition order.

Closes #4705
2022-12-07 10:54:16 -06:00
Ayaz Hafiz
935255d06b
Support compiling programs with test mode in test_mono 2022-12-07 10:48:41 -06:00
Folkert de Vries
2ec473ba11
Merge pull request #4702 from roc-lang/wasm_interp_zig_tests
Wasm interp - more fixes
2022-12-07 00:32:33 +01:00
Ayaz
36eaed31e3
Merge pull request #4701 from roc-lang/i4697
Fix concat of non-unique list with unique list
2022-12-06 15:08:54 -06: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
Folkert de Vries
4ab58dafbc
Merge pull request #4699 from roc-lang/wasm_interp_fixes
Wasm interp: WASI and stack trace
2022-12-06 21:12:15 +01:00
Ayaz Hafiz
dd364dbdfa
Add gen test for concat unique lists bug 2022-12-06 12:59:55 -06:00
Ayaz Hafiz
4df83d67ea
use copyBackwards when copying overlapping items in non-unique.unique concat
`mem.copy` requires that `dest` has start index `<= src`, but in our
case, `dest` has start index `>= src`. For this, `copyBackwards` should
be used.

See https://github.com/ziglang/zig/blob/master/lib/std/mem.zig#L195-L222.

Closes #4697
2022-12-06 12:58:04 -06:00
Brian Carroll
d49ae6701a
Merge branch 'main' of github.com:roc-lang/roc into wasm_interp_fixes 2022-12-06 18:57:56 +00:00
Ayaz Hafiz
a549176886
Add reproduction of failing unique concat bug 2022-12-06 12:57:32 -06: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
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
Folkert de Vries
c8a335cd0b
Merge pull request #4695 from roc-lang/mono-checker-updates
Add debug flag to check IR after specialization
2022-12-06 09:31:01 +01:00
Ayaz
8ae8857125
Merge pull request #4696 from roc-lang/hash-nat
add the ability to hash Nats
2022-12-05 20:15:21 -06:00