Commit graph

214 commits

Author SHA1 Message Date
Brian Carroll
8a01c3f98a Wasm: implement dead code elimination 2022-01-14 18:20:52 +00:00
Brian Carroll
dd79a9b35a Clippy fixes 2022-01-13 05:41:52 +00:00
Brian Carroll
c8181c3a19 Wasm: use parsed data from object file in the backend 2022-01-13 05:41:52 +00:00
Brian Carroll
9f8f31b2b6 Wasm: adjust function indices for preloading 2022-01-13 05:41:52 +00:00
Brian Carroll
9c0abcd0da Wasm: Preload WasmModule from object file bytes 2022-01-13 05:41:52 +00:00
Brian Carroll
5d5e0eca96 Wasm: Convert remaining sections to store bytes, and add .size() methods 2022-01-13 05:41:52 +00:00
Brian Carroll
f4ac5bffa3 Wasm: replace builtins imports with a hashmap 2022-01-13 05:41:52 +00:00
Brian Carroll
b8ab6af203 Wasm: move WasmModule definition to mod.rs 2022-01-13 05:41:52 +00:00
Brian Carroll
59278a02d6 Wasm: Create a LinkingSegment to keep string data aligned correctly 2022-01-10 10:26:43 +00:00
Brian Carroll
a1f737d6d8 Wasm: Create OpaqueSection for sections that may be used in builtins but not by us 2022-01-10 10:26:43 +00:00
Brian Carroll
738434329e Wasm: refactor the model of the Linking section 2022-01-10 10:26:42 +00:00
Brian Carroll
6db7dbed1c Wasm: Store DataSection as bytes and segment count 2022-01-10 10:26:42 +00:00
Brian Carroll
265171ad17 Wasm: Make sure string constants are placed at a properly aligned offset 2022-01-10 10:26:42 +00:00
Brian Carroll
b8f51fb1bb Wasm: add preloaded_bytes and preloaded_count to Code section 2022-01-10 10:26:42 +00:00
Brian Carroll
aec8d1bf3d Merge branch 'trunk' of github.com:rtfeldman/roc into str_to_num 2022-01-02 12:31:59 +00:00
Brian Carroll
f767014f30
Merge pull request #2301 from rtfeldman/wasm-refcount-list
Wasm refcounting for lists
2021-12-31 13:25:38 +00:00
Brian Carroll
0912f8fd45 Wasm: replace a local.set/get pair with a local.tee 2021-12-30 15:40:00 +00:00
Brian Carroll
acade33497 Wasm bugfix: allocate using the heap alignment, not the stack alignment 2021-12-30 15:37:09 +00:00
rvcas
e7825127d6 Merge branch 'trunk' into str_to_num 2021-12-29 18:17:33 -05:00
Brian Carroll
6b932f9743 Clarify some lowlevel code to make it clearer what to do when adding new ones 2021-12-29 22:11:33 +00:00
rvcas
0d187fb53c feat(wasm): use mono layout to figure out the correct intrinsic 2021-12-28 21:38:43 -05:00
Folkert de Vries
249878cbd9
Merge pull request #2281 from rtfeldman/i/2149
(llvm) Generate code for tag unions less than 64 bits in size correctly
2021-12-27 22:38:08 +01:00
Brian Carroll
0d8a2c8a49 Use tail call elimination where possible in == for tag unions 2021-12-27 18:08:43 +00:00
ayazhafiz
326bfe9aa3 Ensure WASM code gen uses proper tag ID alignment
We should use the alignment of the tag ID layout, not the alignment of
the rest of the data in the tag union. The reason is that the tag ID may
be smaller than the data.
2021-12-26 17:45:05 -06:00
Brian Carroll
e10acd59ee Debug config for Wasm backend 2021-12-26 10:45:18 +00:00
Brian Carroll
da4cf721cc Fix equality on empty structures 2021-12-26 10:40:45 +00:00
Brian Carroll
ca501fdcf1 Restructure CodeGenHelp to generate IR immediately, in depth-first traversal 2021-12-26 10:40:45 +00:00
Brian Carroll
471e2c3143 Completely delete Wasm BlockType 2021-12-21 23:14:55 +00:00
Brian Carroll
1c20075d7b Change usage of Wasm if instruction now that we don't support block results anymore 2021-12-21 23:14:55 +00:00
Folkert de Vries
2f1c648602
Merge pull request #2253 from rtfeldman/wasm-no-block-results
Wasm: fix nested conditionals
2021-12-21 16:35:22 +01:00
Brian Carroll
2a141b3586 Automatically clean up any unused values at the end of a block 2021-12-21 13:16:15 +00:00
Brian Carroll
17dc6668ec Make all Wasm blocks NoResult and always put return value in a local var. 2021-12-21 13:16:15 +00:00
Brian Carroll
6480a720ae Move symbol_layouts to storage.rs 2021-12-20 16:06:39 +00:00
Brian Carroll
3b2aa0bf6a Fix bugs with symbol layouts in Wasm 2021-12-20 09:53:24 +00:00
Brian Carroll
9b833720d4 Further refactor and debug == in Wasm 2021-12-20 08:39:16 +00:00
Brian Carroll
f59e0e249b Use native instructions for NotEq in Wasm 2021-12-19 21:20:06 +00:00
Brian Carroll
e0ffaca3df Refactor Wasm equality operator 2021-12-19 21:20:06 +00:00
Brian Carroll
c510226c15 Reorganise Wasm lowlevels to get pointer equality working correctly 2021-12-19 21:20:06 +00:00
Brian Carroll
a1d883600c Equality operator for records 2021-12-18 17:25:00 +00:00
rvcas
b9bd75d643 Merge branch 'trunk' into wasm_arrays 2021-12-17 11:54:23 -05:00
rvcas
bc94683100 feat(wasm): copy value to memory 2021-12-17 11:37:40 -05:00
Brian Carroll
1b98673704 Separate stack and heap pointers & create Symbols for list literals 2021-12-17 11:45:54 +00:00
rvcas
bed288330f feat(wasm): try different offsets 2021-12-16 22:27:16 -05:00
rvcas
fc07070617 feat(wasm): trying to add the rest of the elements to the list 2021-12-16 22:14:15 -05:00
rvcas
b35deacebe feat(wasm): use allocate with ref count 2021-12-16 21:23:13 -05:00
rvcas
c14b4b81e0 Merge branch 'trunk' into wasm_arrays 2021-12-16 21:07:12 -05:00
Brian Carroll
3eb9e9f7ac Traverse nested layouts for code gen helpers 2021-12-16 16:56:56 +00:00
Brian Carroll
86d8e2789e Implement Wasm string equality 2021-12-16 16:56:56 +00:00
Brian Carroll
e1a04c2661 Only check layout is implemented for RC, not other ops 2021-12-16 16:56:56 +00:00
Brian Carroll
cd91be678f Setup for specializing equality checks 2021-12-16 16:52:47 +00:00