Brian Carroll
02bb9028ef
Returning records on the stack from Wasm dev backend!
2021-09-28 08:06:59 +01:00
Brian Carroll
39fda3e675
Add more information to SymbolStorage
...
SymbolStorage is function-specific, whereas WasmLayout is function-independent.
SymbolStorage used to be a single-variant enum with a LocalId and a WasmLayout,
but now we need more variants, so we can handle stack memory allocation..
- For values in stack memory, the storage needs to include an offset within the
stack frame, but we don't need that for primitive values.
- For function parameters, the allocated stack memory is in the caller's frame
rather than the current frame, so we don't want size or offset.
We could have kept a WasmLayout inside of SymbolStorage but that would have made
possible a lot of invalid combinations. It seemed better to copy the fields we need.
2021-09-26 20:52:17 +01:00
Brian Carroll
ecece45a83
Add a helper method local_id_from_symbol
2021-09-26 20:52:17 +01:00
Brian Carroll
ae6cfe1992
Moree implementations for Wasm32TestResult
2021-09-26 20:52:16 +01:00
Brian Carroll
286ca680e0
Tidy up load_literal
2021-09-26 20:52:16 +01:00
Brian Carroll
ab4f28fd69
Comment out a test that isn't working
2021-09-26 20:52:16 +01:00
Brian Carroll
92b1d73bd6
Refactor build_proc into smaller helpers
2021-09-26 20:52:10 +01:00
Brian Carroll
65446ce1e8
Remove unnecessary Option
2021-09-18 14:46:09 +01:00
Brian Carroll
c3b5ac6c82
Allocate stack memory to local variables
2021-09-18 13:39:38 +01:00
Brian Carroll
52a56bfa27
Optimise away a memory copy for returned structs in simple cases
2021-09-17 21:50:00 +01:00
Brian Carroll
4f55b7a56e
Allocate and free stack frames
2021-09-17 21:17:05 +01:00
Brian Carroll
036503c750
copy returned structs to caller stack
2021-09-17 19:42:29 +01:00
Brian Carroll
3d18d34135
Insert extra argument when returning on stack
2021-09-15 18:45:20 +02:00
Brian Carroll
2be2e09ffd
Merge branch 'trunk' of github.com:rtfeldman/roc into wasm_stack_memory
2021-09-14 14:57:17 +02:00
Folkert
de959d3ad3
recurse on lambda set in wasm backend
2021-09-14 13:30:19 +02:00
Brian Carroll
866d9f47a0
Move WasmLayout to its own module
2021-09-14 08:31:32 +02:00
Brian Carroll
258513a57c
reset join/jump data
2021-09-14 08:18:33 +02:00
Brian Carroll
672aa14f7c
Cosmetic: reorganise WasmLayout match statment
2021-09-14 08:00:00 +02:00
Richard Feldman
b16faae0a2
Fix gen_wasm exhaustiveness error
2021-09-13 20:02:34 -04:00
Brian Carroll
cfef0f0f47
Add clarifying comments based on PR feedback
2021-09-13 22:42:04 +02:00
Brian Carroll
c47c3ccf58
Clippy fix
2021-09-13 17:30:13 +02:00
Brian Carroll
408c31ebcc
Tests for different bitwidth integers
2021-09-13 17:01:06 +02:00
Brian Carroll
df73a4d80e
rename wasm test modules
2021-09-12 23:24:04 +02:00
Brian Carroll
35c5b6bc4e
Tests passing with generic native/wasm interface
2021-09-12 23:23:43 +02:00
Brian Carroll
8b73b98622
Code gen full test wrapper from body
2021-09-11 16:56:00 +01:00
Brian Carroll
086f13ef5a
Rename test code gen menthod to build_wrapper_body
2021-09-11 16:55:20 +01:00
Brian Carroll
f0a7b4a46a
Stack grows downward by convention, not upward
2021-09-11 11:44:49 +01:00
Brian Carroll
e8a36fc9b6
Readme updates
2021-09-11 11:44:48 +01:00
Brian Carroll
83150d2c7e
Test helper trait to generate test wrapper code
2021-09-11 11:44:43 +01:00
Brian Carroll
b21155f60b
Move some constants from backend to lib
2021-09-11 10:20:32 +01:00
Brian Carroll
042b175d89
More comprehensive WasmLayout
2021-09-11 10:20:27 +01:00
Folkert
34a88c228f
fix another typo
2021-09-10 15:49:18 +02:00
Folkert
3a83b0c415
fix typo
2021-09-10 15:44:11 +02:00
Folkert
e3b3206286
sorting comment
2021-09-10 14:15:37 +02:00
Folkert
3750b154ca
cleanup
2021-09-10 13:52:33 +02:00
Folkert
7290ef7f98
rename
2021-09-10 13:19:18 +02:00
Folkert
daf0a0e02b
Merge remote-tracking branch 'origin/trunk' into gen_wasm_join
2021-09-10 13:16:46 +02:00
Folkert
05469d5ae5
Merge remote-tracking branch 'origin/trunk' into gen_wasm_switch
2021-09-09 10:19:46 +02:00
Brian Carroll
f822251c65
Fix rust-fmt
2021-09-08 20:38:27 +01:00
Brian Carroll
57a30b8e9e
Get rid of duplicated eval helper file
2021-09-08 20:16:59 +01:00
Folkert
e802da5f54
implement factorial example
2021-09-08 20:05:05 +02:00
Folkert
ae2b4b7c78
comment out wasm record tests
2021-09-08 20:01:35 +02:00
Folkert
4e5b677426
basic join point
2021-09-08 15:54:00 +02:00
Folkert
480cdea82c
comment out record tests
2021-09-08 00:57:59 +02:00
Folkert
1da32f18e5
implement switch for the gen wasm backend
2021-09-08 00:00:36 +02:00
Brian Carroll
7825c0c007
Merge branch 'gen_wasm' of github.com:rtfeldman/roc into gen_wasm
2021-09-07 21:37:29 +01:00
Folkert
c888baccff
rename layout -> return_layout
2021-09-07 20:55:05 +02:00
Folkert
4c8ac253e4
fix typo
2021-09-07 17:45:10 +02:00
Folkert
afd7553e7a
enable F64
2021-09-07 17:42:31 +02:00
Folkert
e316bfca72
make mut
2021-09-07 16:48:11 +02:00