Commit graph

196 commits

Author SHA1 Message Date
Ayaz Hafiz
15ef517cf2
gen-wasm: box captured data before passing it to a higher-order lowlevel
Previously, when it existed, captured data would always be represented
as a struct, and hence implicitly boxed. That meant that passing
captured data would always pass a pointer. However, now, captured data
can live unwrapped. This poses a challenge for the higher-order
lowlevels, which always expect captures data to be passed as an opaque
pointer. As such, always box captured data.

It's possible to optimize this so that only unwrapped captures data
needs to be boxed; however, that is not attempted in this patch.
2022-08-19 22:16:41 -05:00
Ayaz Hafiz
0606086eb6
Compare values with runtime representation 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
89457f9faf
Add Wasm32Result for Infallible 2022-08-12 15:42:20 -07:00
Richard Feldman
97e2900bf5
s/rtfeldman/roc-lang/g in links to GitHub repos 2022-08-12 15:24:09 -04:00
Folkert
10b6f33ed2
boilerplate 2022-08-12 13:34:36 +02:00
Brian Carroll
86b5db10d5
Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-stack-size-control-i2490 2022-08-08 22:39:26 +01:00
Brian Carroll
dd040d5f73
wasm: add stack_bytes field to Env 2022-08-08 21:41:25 +01:00
Brian Carroll
11929a7b6d
wasm: set memory layout after code gen, when we know the amount of const data 2022-08-07 21:34:49 +01:00
Folkert
792936066c
Merge remote-tracking branch 'origin/trunk' into roc-std-platform 2022-08-07 13:28:03 +02:00
Folkert
9574bd9928
move implementation of platform functions to use site... 2022-08-06 21:32:18 +02:00
Brian Carroll
50326f7e0b
Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-code-gen-fixes-i3448 2022-08-06 10:12:24 +01:00
Brian Carroll
aa0e9e8d31
wasm: Get RC reset/reuse working correctly 2022-08-06 09:58:47 +01:00
Brian Carroll
e71a6da62d
wasm: fix refcount bug in higher order low-levels 2022-08-05 09:51:51 +01:00
Folkert de Vries
9f2ddc61d8
Merge pull request #3699 from rtfeldman/wasm-fix-uninit-capacity
Wasm: fix uninitialised capacity in List literals
2022-08-04 15:24:55 +02:00
Brian Carroll
7f44ace383
wasm: nicer debug output for Let statements 2022-08-04 12:30:25 +01:00
Brian Carroll
67f7512e6d
wasm: drop unused return value from copy_value_from_memory 2022-08-04 12:29:25 +01:00
Brian Carroll
85e5d11db4
wasm: fix List.getUnsafe trying to load a symbol before it was stored 2022-08-04 12:27:46 +01:00
Folkert de Vries
7f4e0bb0c9 gen_wasm use dummy platform functions 2022-08-03 21:35:28 +02:00
Brian Carroll
5c6eed570d
wasm: Ensure List literals have an initialized capacity field 2022-07-29 15:18:15 +02:00
Brian Carroll
0041d4f3bc
wasm: Fix shiftRightBy for U8 and U16 2022-07-29 14:05:39 +02:00
Folkert
9bdf1f733f
Wasm32Sized for isize 2022-07-27 20:10:47 +02:00
Folkert
100e439852
fix bug with ALIGN_OF_WASM on tuples (it used the size) 2022-07-24 13:33:35 +02:00
Folkert
e1b427839b
implement wasm traits for roc_std::{I128, U128} 2022-07-24 12:07:27 +02:00
Folkert
c09cb4e3ea
fix stack size of empty tag union 2022-07-23 23:10:56 +02:00
Folkert
e6104ee52f
update api usage in wasm backend 2022-07-22 21:13:53 +02:00
Folkert
3ca24a6476
implement wasm memory traits for 4-tuples 2022-07-22 12:18:31 +02:00
Brian Carroll
8e4fd629eb
Wasm: Handle closure data that's a lambda set with no closure data 2022-07-20 00:28:36 +01:00
Ayaz Hafiz
efc11bd7ed
Wasm sized and decode for void values 2022-07-18 12:37:48 -04:00
Folkert de Vries
1b1b63aad0
Merge branch 'trunk' into assoc-list-dict 2022-07-14 16:47:50 +02:00
Richard Feldman
da7c7ac5f2
Merge pull request #3525 from rtfeldman/3522
Num.toStr for f32, f64, Dec
2022-07-13 21:30:05 -04:00
Brian Carroll
06f8af6b1e
gen_wasm: correctly detect empty ElementSection and don't emit TableSection 2022-07-13 21:23:32 +01:00
Folkert
5763248b44
Merge remote-tracking branch 'origin/trunk' into assoc-list-dict 2022-07-13 20:44:28 +02:00
Ayaz Hafiz
b7b9227675
Num.toStr Dec for wasm 2022-07-13 12:24:07 -04:00
Richard Feldman
aad922251d
Use Builtin::WRAPPER_* in gen_wasm 2022-07-13 12:19:38 -04:00
Richard Feldman
25facfa9c6
Expose capacity builtins 2022-07-13 12:19:37 -04:00
Ayaz Hafiz
b7c312d449
Support Num.toStr for f32, f64 2022-07-13 12:13:01 -04:00
Folkert
4d55b756bb
remove dict/set layout 2022-07-13 11:41:19 +02:00
Folkert
8e21fdcb04
remove dict/set lowlevels 2022-07-13 11:24:07 +02:00
Folkert
d1f7b0fc5a
wasm: store tag id right after the content 2022-07-09 14:28:41 +02:00
Folkert
d8c1ae6bf1
fix off-by-one error 2022-07-08 23:47:03 +02:00
Folkert
e8530eaca5
improve lowlevel unwrapping 2022-07-08 22:13:13 +02:00
Folkert
56c9787e8f
List.appendUnsafe and List.reserve 2022-07-07 22:40:28 +02:00
Brian Carroll
c32ce44b29
wasm: Explicit exhaustiveness on conditionals for higher-order lowlevels 2022-07-07 20:36:12 +01:00
Brian Carroll
a6faf875f8
wasm: Use Ord::max where possible instead of a custom function 2022-07-07 20:32:32 +01:00
Folkert
a55461d0f8
format 2022-07-07 13:40:37 +02:00
Brian Carroll
c9a1600751
wasm: Fix List.map where the mapper has zero-size arguments 2022-07-07 00:05:56 +01:00
Brian Carroll
25a2eddf0f
wasm: Create a stack frame pointer for any function with a zero-size arg 2022-07-06 22:31:30 +01:00
Brian Carroll
a9aee13086
test_gen: support RocResult for Wasm tests 2022-07-06 22:01:03 +01:00
Brian Carroll
f132350ef3
wasm: implement List.sortWith 2022-07-06 22:01:01 +01:00
Brian Carroll
88bcb82fef
wasm: Don't eliminate inlined low-level wrappers. Need them for indirect calls. 2022-07-06 21:59:40 +01:00