Brian Carroll
d996eee72e
Pointlessly improve how we handle a crazy edge case, because my brain wouldn't let it go
2021-10-25 13:26:50 +02:00
Brian Carroll
4e098be7fe
Fix a test throwing a Wasm runtime error
2021-10-25 13:04:30 +02:00
Brian Carroll
3f404dd114
clippy
2021-10-25 12:23:24 +02:00
Brian Carroll
ddf66293e9
Fix and refactor number encodings
2021-10-25 12:15:04 +02:00
Brian Carroll
b6e442c9ee
Fix locals code gen
2021-10-24 23:36:00 +02:00
Brian Carroll
11f327f722
Fix function call
2021-10-24 23:35:25 +02:00
Brian Carroll
c46e73bd64
Fix test code gen
2021-10-24 23:34:14 +02:00
Brian Carroll
6534da5055
Fix LEB encoding and refactor insertions
2021-10-24 11:54:21 +02:00
Brian Carroll
13577aa9ec
Combine our handmade Code section with other sections from parity_wasm (tests compile but fail)
2021-10-23 17:12:49 +02:00
Brian Carroll
7c398ba238
tweak comment
2021-10-23 13:52:45 +02:00
Brian Carroll
973626fe2d
Rename FunctionBuilder back to CodeBuilder
2021-10-23 13:48:20 +02:00
Brian Carroll
dbe6d195f7
Delete CodeBuilder
2021-10-23 13:40:10 +02:00
Brian Carroll
74e3239a1c
Switch over to function_builder
2021-10-23 13:39:54 +02:00
Brian Carroll
bca9f31c58
Implement insertions for byte-level code gen
2021-10-23 00:02:14 +02:00
Brian Carroll
dc1779d41d
Finalisation and serialisation for byte-level function builder
2021-10-22 19:02:03 +02:00
Brian Carroll
0586f91b04
Reorder arguments of instruction methods
...
Having the opcode first makes it easier to see if it matches the method name
2021-10-22 13:17:18 +02:00
Brian Carroll
fbceafa8dc
Get all instructon methods compiling
2021-10-22 12:59:19 +02:00
Brian Carroll
4f958e8a80
Get most common instruction patterns to compile
2021-10-22 12:01:22 +02:00
Brian Carroll
4563e2af49
Get function_builder compiling
2021-10-22 10:38:53 +02:00
Brian Carroll
dc80623d45
Sketch out methods for byte-level instructions. No macros yet.
2021-10-21 23:21:56 +02:00
Brian Carroll
e168d175c4
Start writing a byte-level function_builder
2021-10-21 21:30:51 +02:00
Brian Carroll
5ea313f256
update gen_wasm to use bumpalo::collections::Vec where possible
2021-10-21 21:14:15 +02:00
Brian Carroll
1be6fd1222
Switch to fork of parity-wasm that can support bumpalo vectors
2021-10-21 17:14:07 +02:00
Brian Carroll
401f2ececd
rename some methods
2021-10-18 21:35:16 +02:00
Brian Carroll
e4db06cbdd
Add a debug assertion in code builder
2021-10-18 21:16:54 +02:00
Brian Carroll
64603a480c
Get rid of Option in VM stack model
2021-10-18 21:03:54 +02:00
Brian Carroll
b86849347a
Write test debug output to a path in /tmp
2021-10-18 20:42:13 +02:00
Brian Carroll
f242aade86
Rename a variable & fix a bug calling functions that return via stack memory
2021-10-18 18:35:48 +02:00
Brian Carroll
1b97675f1f
Refactor the optimisation for immediately-returned Let statements
...
The original intention was to avoid creating a local when we define
and immediately return a primitive value. But now our default path
does avoids unnecessary locals anyway!
For StackMemory values we do need an optimised path but it's nicer
to just pass a flag to Storage::allocate.
2021-10-18 13:18:10 +02:00
Brian Carroll
2daefc8b32
Name a constant
2021-10-18 13:11:05 +02:00
Brian Carroll
99468b0aac
Clarify a comment
2021-10-17 11:24:25 +02: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
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
Brian Carroll
85ca33ddd6
tweak test script
2021-10-11 08:20:33 +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
Brian Carroll
9dcc6f2bc5
size comparison tweaks
2021-10-10 12:52:53 +01: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