Commit graph

190 commits

Author SHA1 Message Date
Brian Carroll
4f464e485a Export and code sections 2021-11-01 14:13:34 +00:00
Brian Carroll
2a0dbb39fb Memory and Global sections 2021-11-01 12:30:44 +00:00
Brian Carroll
e05ef73f6c function section 2021-11-01 09:54:09 +00:00
Brian Carroll
eb9705e2e9 import section 2021-11-01 09:48:29 +00:00
Brian Carroll
d25b12328d Rename some SerialBuffer methods 2021-11-01 08:42:02 +00:00
Brian Carroll
7ad452d78a Types section 2021-11-01 08:34:34 +00:00
Brian Carroll
6ab00d164c Create WasmModule struct 2021-11-01 00:06:25 +00:00
Brian Carroll
c29e8bc452 comment formatting 2021-11-01 00:05:18 +00:00
Brian Carroll
63f65947bc Remove excessive calls to LayoutIds::default() 2021-11-01 00:02:28 +00:00
Brian Carroll
49ac08546c Replace a vector reference with a slice 2021-11-01 00:01:48 +00:00
Brian Carroll
572bdb987f Add a comment 2021-10-31 08:32:33 +00:00
Brian Carroll
96832ed1e3 self review 2021-10-30 18:22:09 +01:00
Brian Carroll
b0e0c14dd8 clippy 2021-10-30 17:52:38 +01:00
Brian Carroll
b8eea9be2b Fix linking bugs from wasm-objdump analysis 2021-10-30 17:47:13 +01:00
Brian Carroll
0ee482ae9e Fix string encoding. Tests pass. 2021-10-30 10:57:21 +01:00
Brian Carroll
99b08ad395 Skip relocations for test_wrapper since we don't run a linker on it anyway. 2021-10-30 09:50:53 +01:00
Brian Carroll
b541802819 Change custom section names to string slice
We will never need to create these names dynamically.
e.g. "reloc.CODE", "reloc.DATA", and "linking" will all
come from specific places in our backend code.
It's a different story for function names etc.
2021-10-30 09:26:40 +01:00
Brian Carroll
2da2e51895 Move relocations code into the backend and code builder 2021-10-30 09:20:16 +01:00
Brian Carroll
9780cce4dd Rough draft of function name relocations 2021-10-30 08:55:33 +01:00
Brian Carroll
f5f34b74c0 Write serializers for much of the linking and relocation sections 2021-10-29 16:04:27 +01:00
Brian Carroll
2020e89db7 Create reserve_padded_u32, nice for readability 2021-10-28 22:44:33 +01:00
Brian Carroll
7841ef959a Serialize padded signed integers and refactor serialize module 2021-10-28 20:45:04 +01:00
Brian Carroll
3c9375af28 Start creating module_builder 2021-10-28 13:18:14 +01:00
Brian Carroll
82acf55d38 Create serializer module 2021-10-28 11:50:55 +01:00
Brian Carroll
eb47b5183c Slightly refactor code section swapping 2021-10-27 19:41:52 +01:00
Brian Carroll
f066adbe05 Adjust relocation offset to account for inserts, preamble, function offset, etc. 2021-10-27 16:50:30 +01:00
Brian Carroll
1def56ea04 Build up a vector of relocations 2021-10-26 23:31:36 +01:00
Brian Carroll
fd3d8f5227 Get rid of procedure sorting 2021-10-26 22:44:28 +01:00
Brian Carroll
a0d2b7e6e1 Unit tests for LEB-128 encoders 2021-10-26 18:08:40 +01:00
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
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