diff options
| author | Luuk de Gram <luuk@degram.dev> | 2022-01-31 21:12:30 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2022-02-03 21:43:25 +0100 |
| commit | ae1e3c8f9bc86eeefb5a83233884a134f7b974f4 (patch) | |
| tree | ed25223280b2ccfffd74691b73e558065ec7925d /src/Module.zig | |
| parent | 29013220d95f60669c4a181d157157aea9f137b5 (diff) | |
| download | zig-ae1e3c8f9bc86eeefb5a83233884a134f7b974f4.tar.gz zig-ae1e3c8f9bc86eeefb5a83233884a134f7b974f4.zip | |
wasm: Implement vector_init for array & structs
Implements the instruction `vector_init` for structs and arrays.
For arrays, it checks if the element must be passed by reference or not.
When not, it can simply use the `offset` field of a store instruction to copy the values
into the array. When it is byref, it will move the pointer by the element size, and then perform
a store operation. This ensures types like structs will be moved into the right position.
For structs we will always move the pointer, as we currently cannot verify if all fields are
not by ref.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions
