diff options
| author | Luuk de Gram <luuk@degram.dev> | 2021-11-17 09:08:32 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2021-11-21 21:07:54 +0100 |
| commit | 261f13414b6bafbe075ce5066964b36a3a5b5e16 (patch) | |
| tree | 18df3c82a434a6400cb30251258f18dab8d6a072 /src/Compilation.zig | |
| parent | c18bc08e3c658f50faf7668f8940a11326f3947a (diff) | |
| download | zig-261f13414b6bafbe075ce5066964b36a3a5b5e16.tar.gz zig-261f13414b6bafbe075ce5066964b36a3a5b5e16.zip | |
wasm: Implement emulated stack
All non-temporary locals will now use stack memory.
When `airAlloc` is called, we create a new local, move the stack pointer,
and write its offset into the local. Arguments act as a register and do not
use any stack space.
We no longer use offsets for binary operations, but instead write the result
into a local. In this case, the local is simply used as a register, and does not
require stack space. This allows us to ensure the order of instructions is correct,
and we no longer require any patching/inserting at a specific offset.
print_air was missing the logic to print the type of a `ty_str`.
Diffstat (limited to 'src/Compilation.zig')
0 files changed, 0 insertions, 0 deletions
