Commit graph

1295 commits

Author SHA1 Message Date
Brian Carroll
334bc7174f
Merge pull request #3742 from roc-lang/cleanup-mono-layout
Cleanup/refactoring of lambda set layout generation
2022-08-20 15:48:05 +01:00
Ayaz Hafiz
d1c21e3fcd
Add polymorphic expression reproduction cases from #1745
These work now that we have ways to compile polymorphic expressions.

Closes #1745
2022-08-19 22:21:50 -05:00
Ayaz Hafiz
79a5766854
Make method private 2022-08-19 22:16:47 -05:00
Ayaz Hafiz
b7c799702f
wasm: store closure data passed to higher-order low-level in struct, not box 2022-08-19 22:16:47 -05:00
Brian Carroll
1078badd58
wasm: comment on why we don't need to modify symbol storage after clone 2022-08-19 22:16:47 -05:00
Ayaz Hafiz
f08fc43210
Remove unneeded clone 2022-08-19 22:16:42 -05:00
Ayaz Hafiz
fb4282757a
gen-wasm: Do not repoint stack memory to locals upon copy
It is possible that other code paths will use the stack memory before a
copy to a local is done. For example, if the copy happens behind a branch,
the local variable may not be assigned the stack content.
2022-08-19 22:16:41 -05:00
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
cefbf3aa51
Unwrap lambda sets in cc type choosing 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
b18af7e1f3
Fix return type of closure 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
d8a8dff70d
Treat unwrapped capture sets as unwrapped directly 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
68bb03ec09
Update mono tests 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
64fc60f55f
Make lambda set set private 2022-08-19 22:16:41 -05:00
Ayaz Hafiz
a93735473a
Describe how a enum lambda set should be switched in the representation 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
f5e3105b37
Use extend_argument_list to add lambda set arguments 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
c003b2d007
Simplify ClosureInfo and enum lambda set switching, which never captures 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
d6572ef3b7
Match over call options in determining whether to extend lambda set arg 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
d4a79780b3
Determine whether to extend lambda set arg to call args by checking call options 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
62dde549e6
Determine whether lambda set is represented as an arg 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
fc4979e2ce
Add ClosureCallOptions enum to describe how to switch calling lambda 2022-08-19 22:16:40 -05:00
Ayaz Hafiz
8d01e81aa7
Use tag union/recursive tag union layout function for lambda sets 2022-08-19 22:16:39 -05:00
raleng
4371905738
Fix file links in gen_dev readme 2022-08-17 12:40:28 +02:00
Richard Feldman
0ba5b3cfc6
Merge pull request #3711 from roc-lang/record-decoding
Record decoding and their derivers
2022-08-15 22:06:34 -04:00
Brian Carroll
fa1a870d4b
Merge pull request #3791 from roc-lang/dependabot/cargo/indoc-1.0.7
Bump indoc from 1.0.6 to 1.0.7
2022-08-15 21:04:16 +01:00
Brian Carroll
2227b3d11d
Merge pull request #3813 from roc-lang/dependabot/cargo/crossbeam-0.8.2
Bump crossbeam from 0.8.1 to 0.8.2
2022-08-15 21:03:09 +01:00
Ayaz Hafiz
bed9b57b58
Add ignored empty record decoding test 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
21c3d0cafa
Add test for string and int record decoding 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
51faeaf9af
Fix doc comment 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
3770db5d70
Add test for underivable optional record 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
68441479b8
Add decoding record derive key tests 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
07cac2b4ce
Avoid non-consuming iterators 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
434e202580
Make sure to chase extension variable in record deriving 2022-08-15 11:11:37 -05:00
Ayaz Hafiz
80c939f21e
Remove temporary 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
ed23461165
Only open extension variable when feature is turned on 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
9a7e280e9c
Add some more comments to record decoding 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
b698e7f391
Remove mono test 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
0f58328d3d
Use wrap_in_decode_custom_decode_with for decode record 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
23c6e6ea87
Add a wrap_in_decode_custom_decode_with helper for decode deriving 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
60ed17155c
Check in gen test for record decoding! 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
44a746b473
Update derive decoder test 2022-08-15 11:11:36 -05:00
Ayaz Hafiz
634e9a2b69
Remove dbgs 2022-08-15 11:11:35 -05:00
Ayaz Hafiz
07392a35a7
Populate type of decoded record completely 2022-08-15 11:11:35 -05:00
Ayaz Hafiz
e93145180e
Better debug symbols for derivers 2022-08-15 11:11:35 -05:00
Richard Feldman
639df6c8c0
Unify this_decode_with_var 2022-08-15 11:11:35 -05:00
Richard Feldman
b3b6a7ee9f
Type-check lots of step_field 2022-08-15 11:11:35 -05:00
Richard Feldman
c34427bbf9
Rename record_var to initial_state_var 2022-08-15 11:11:34 -05:00
Ayaz Hafiz
d01c5c83b7
Check in gen tests that don't work yet 2022-08-15 11:11:33 -05:00
Ayaz Hafiz
f95c5aee12
Check in derived record impl 2022-08-15 11:11:33 -05:00
Ayaz Hafiz
66f75b86ee
Fix ROC_PRINT_UNIFICATIONS_DERIVED 2022-08-15 11:11:33 -05:00