Commit graph

205 commits

Author SHA1 Message Date
Brian Carroll
01b47a2ec7 Add inline directives to ensure unit placeholders are optimised away 2021-11-05 12:11:37 +00:00
Brian Carroll
d220ed7a23 Refactor module section serialization 2021-11-05 12:11:33 +00:00
Brian Carroll
4dcb65cc46 Fix data count section for the case where data section is empty 2021-11-05 08:36:18 +00:00
Brian Carroll
c5d99433f7 Fix build error
And slightly improve efficiency by exiting early from an iteration
2021-11-04 23:21:48 +00:00
Brian Carroll
09f2ce327c Change some comments after self-review 2021-11-04 21:19:23 +00:00
Brian Carroll
0d1946a782 Don't generate a DataSection unless we actually need it! 2021-11-04 20:50:32 +00:00
Brian Carroll
c798c9d444 Implement long string literals 2021-11-04 20:44:29 +00:00
Brian Carroll
414c9e6f86 Move WasmModule initialisation into WasmBackend
It helps to coordinate different sections with related values,
based on knowledge of Roc rather than Wasm.
2021-11-04 20:41:23 +00:00
Brian Carroll
1b91fd9533 Get rid of some overcomplicated Data section stuff
Currently a Wasm module can only have one memory
The Data Segment spec allows for more in future
But the format is confusing enough already without that!
Let's just get rid of that complexity, we don't need it.
2021-11-04 19:44:10 +00:00
Brian Carroll
c57d99c1ac Create types for DataSection 2021-11-04 18:58:17 +00:00
Brian Carroll
46c19b59d4 Add support for small string literals 2021-11-04 14:29:46 +00:00
Brian Carroll
2f430fce86 Refactor literals 2021-11-04 13:40:34 +00:00
Brian Carroll
7fdd6cf952 rust-fmt 2021-11-03 11:59:49 +00:00
Brian Carroll
b432d923b1 Create a linking module 2021-11-03 11:46:46 +00:00
Brian Carroll
e10b7d1f2c Merge branch 'trunk' of github.com:rtfeldman/roc into wasm_module_builder 2021-11-03 11:32:45 +00:00
Brian Carroll
d87db20478 clippy 2021-11-03 11:31:12 +00:00
Brian Carroll
ad9b761fce Move wasm file format code into a submodule 2021-11-03 11:20:16 +00:00
Brian Carroll
87f6246851 Remove parity-wasm! 2021-11-03 10:36:08 +00:00
Brian Carroll
59757d638a Migrate the last sections: Type and Function 2021-11-03 10:24:03 +00:00
Richard Feldman
e7c9a5211f Drop file that was accidentally restored in rebase 2021-11-02 19:39:11 -04:00
Richard Feldman
ac42470c81 Drop unused libc deps 2021-11-02 19:37:38 -04:00
Richard Feldman
ffbf2b4276 Move some things to dev deps 2021-11-02 19:37:05 -04:00
Brian Carroll
6fca1caee5 Merge branch 'trunk' of github.com:rtfeldman/roc into wasm_module_builder 2021-11-02 23:02:00 +00:00
Folkert
b6373c4efb move files over 2021-11-02 21:39:16 +01:00
Brian Carroll
7a1b5ecc99 Slightly reorganise serialize code 2021-11-02 20:35:29 +00:00
Brian Carroll
b0aeafc066 Refactor code section to get rid of a copy 2021-11-02 20:34:57 +00:00
Folkert
f91443100f move files 2021-11-02 21:12:50 +01:00
Brian Carroll
d8c1017aec refactor stack pointer initialisation 2021-11-02 14:00:22 +00:00
Brian Carroll
baf896f6f9 Migrate linking and relocation sections 2021-11-02 13:56:47 +00:00
Brian Carroll
e720873c05 Migrate to own Global and Memory sections 2021-11-02 13:32:54 +00:00
Brian Carroll
edadd4ce13 Temporary setup to gradually migrate sections from parity_wasm to our own module_builder
Previously we just had our own code section.
Now we also have export section, and a way of switching them over one by one,
running tests in between.
2021-11-02 12:46:15 +00:00
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