Commit graph

5394 commits

Author SHA1 Message Date
Anton-4
428b4574ae Merge branch 'trunk' of github.com:rtfeldman/roc into function_closure_to_mark_node 2021-10-15 12:04:51 +02:00
Folkert
7773cf9b4d clippy 2021-10-14 20:12:43 +02:00
Folkert
19eadbfe70 make list inc/dec non-recursive (except when freeing the list) 2021-10-14 19:57:23 +02:00
Richard Feldman
8a4975ee8a
Merge pull request #1781 from rtfeldman/fix-parens
Remove parentheses from unapplied tags
2021-10-13 20:38:37 -04:00
Brian Carroll
6206418b67 Fix clippy warnings 2021-10-14 00:13:47 +02:00
Brian Carroll
e6245c41f5 README updates 2021-10-14 00:04:17 +02:00
Folkert
408aa899bf remove old code 2021-10-13 15:10:42 +02:00
Folkert
55f8a7f3a4 implement print of FunctionOrTagUnion 2021-10-13 14:50:21 +02:00
Brian Carroll
5c42455ca7 Rename some values & improve comments 2021-10-13 10:52:51 +02:00
Brian Carroll
472943a068 Refactoring: extract Storage out of WasmBackend 2021-10-12 10:22:38 +01:00
Brian Carroll
d2e01bd10a rename SymbolStorage -> StoredValue 2021-10-12 10:20:17 +01:00
Chelsea Troy
051b511d87 Remove parentheses from unapplied tags 2021-10-11 20:42:07 -05:00
Anton-4
37ba50e746 bug fixes involving IdentId 2021-10-11 20:16:22 +02:00
Brian Carroll
85ca33ddd6 tweak test script 2021-10-11 08:20:33 +01:00
Brian Carroll
403fbb362d Merge branch 'trunk' of github.com:rtfeldman/roc into wasm_reduce_set_get 2021-10-10 23:20:06 +01:00
Brian Carroll
f6685349b3 Batch local declarations to save a few bytes and make some code a little nicer 2021-10-10 22:21:13 +01:00
Brian Carroll
58549bdf07 CodeBuilder doc comments 2021-10-10 20:56:49 +01:00
Brian Carroll
041e26e807 rename CodeBuilder methods 2021-10-10 20:56:39 +01:00
Brian Carroll
c5ee41af25 rename code_builder 2021-10-10 20:56:32 +01:00
Brian Carroll
8164a14dfa rename module_builder 2021-10-10 20:56:20 +01:00
Brian Carroll
c9997f2115 Turn off output file generation & delete duplicate test 2021-10-10 20:55:53 +01:00
Folkert
5084fd533b only do type checing for roc check 2021-10-10 16:32:14 +02:00
Richard Feldman
a0887da6ca
Merge pull request #1645 from rtfeldman/list-walk-flip
Reorder List.walk arguments
2021-10-10 08:38:20 -04:00
Brian Carroll
9dcc6f2bc5 size comparison tweaks 2021-10-10 12:52:53 +01:00
Folkert
15a2ac7410 update more List.walk uses 2021-10-10 12:35:52 +02:00
Folkert
ebcee4021c flip list.walk passed function arguments 2021-10-10 12:35:03 +02:00
Brian Carroll
14f7f0f3b4 Improved test setup for size comparison 2021-10-10 10:42:02 +01:00
Brian Carroll
47f93bddea Fix & refactor create_storage 2021-10-10 10:36:23 +01:00
Brian Carroll
32b9f4fb07 Generate a .wasm file for every test, for size benchmarking 2021-10-09 18:47:37 +01:00
Brian Carroll
d166f65a31 Fix bug: Forgot to generate a local for the stack frame pointer 2021-10-09 18:16:24 +01:00
Brian Carroll
476c1664ec Add debug logging to CodeBuilder and fix a minor bug 2021-10-09 17:24:37 +01:00
Brian Carroll
3aaafdefe1 Get Join/Jump working with VM storage 2021-10-09 16:46:59 +01:00
Anton-4
03d9d41a7a debugging closure -> MarkupNode 2021-10-08 20:19:52 +02:00
Brian Carroll
d81999045a Get Switch statements working with VM storage 2021-10-07 09:14:35 +01:00
Folkert
94e8c62613 make things compile, base64 has a memory leak 2021-10-06 22:57:11 +02:00
Brian Carroll
af823fe5a8 Get rid of unneeded local.set/get in common cases 2021-10-06 20:07:20 +01:00
Richard Feldman
c6a8bdfdbe Swap closure indices in alias analysis 2021-10-06 08:59:38 -04:00
Richard Feldman
90401477c9 Fix List.walkUntil arg order 2021-10-06 07:32:56 -04:00
Richard Feldman
54a1a33ddf Improve unreachable error message 2021-10-05 21:19:08 -04:00
Richard Feldman
8391c337ab Merge remote-tracking branch 'origin/trunk' into list-walk-flip 2021-10-05 20:50:50 -04:00
Brian Carroll
d6bba482ee Treat the Virtual Machine stack as a form of SymbolStorage
Simulate the behaviour of the stack machine, mark where Symbol values
are created, and track where they are in the stack as we emit instructions.

This will allow us to be smarter with setting and getting locals.
However that's not actually implemented yet! At the moment,
we're still generating the same code as before but in a fancier way.

What's happening:

Let's say we have a function call that takes two arguments [A,B]
and that we are lucky and just happen to have a VM stack of [A,B]
That's great, we _should_ not have to do anything, just emit 'Call'

BUT what we are doing is "load A to the top" and then "load B to the top".
This sounds good but it's actually stupid
We are saying we want A at the top of the stack when we don't!!
We want it right where it is, just beneath the top!

So we are emitting code to bring it from 2nd position to the top.
How do we do that? By inserting a local.set instruction to save it,
and a local.get instruction to load it to the top!

What should be happening:

Check the entire VM stack at once for all the symbols we are trying to load.
If they happen to be there (which is likely given the IR structure) do nothing.
If it's not quite perfect... then emit lots of local.set and local.get. Whatever.

What would be the way to solve this properly?

Build the Wasm instructions as a tree, then serialise it depth-first.
The tree encodes all of the information about what needs to be on the
stack at what point in the program. If a tree node has two children,
it consumes two items from the stack. If you do it this way, all
of the instructions get executed just at the right time.
2021-10-05 21:39:19 +01:00
Brian Carroll
d796bbcc68 add a couple of assertions 2021-10-05 21:19:08 +01:00
Anton-4
ab665b7380 Merge branch 'trunk' of github.com:rtfeldman/roc into docs_markup 2021-10-05 11:58:45 +02:00
Anton-4
4324b08a30 cleanup+fmt+clippy 2021-10-05 11:58:11 +02:00
Richard Feldman
894e295b85
Merge pull request #1764 from rtfeldman/list
Some List docs changes
2021-10-04 18:08:32 -05:00
Anton-4
548d806a88 def->MarkupNode working 2021-10-04 19:26:31 +02:00
Folkert de Vries
fa4875da83
Merge pull request #1761 from rtfeldman/giesch
Add List.dropAt
2021-10-04 15:01:17 +02:00
Richard Feldman
cfe7d5afbb Document List.map2 and List.map3 2021-10-04 08:42:52 -04:00
Richard Feldman
e6ec1ded22 Add mapJoin and mapOrDrop to List 2021-10-04 08:26:23 -04:00
Richard Feldman
696a8273ee
Merge pull request #1742 from rtfeldman/test-linker
Test linker
2021-10-03 23:26:15 -04:00