aboutsummaryrefslogtreecommitdiff
path: root/lib/std/wasm.zig
AgeCommit message (Collapse)Author
2022-01-04wasm: Implement memset, and sret arguments.Luuk de Gram
We now detect if the return type will be set by passing the first argument as a pointer to stack memory from the callee's frame. This way, we do not have to worry about stack memory being overwritten. Besides this, we implement memset by either using wasm's memory.fill instruction when available, or lower it manually. In the future we can lower this to a compiler_rt call.
2021-12-23wasm-linker: Implement symbol names emittingLuuk de Gram
The linker will now emit names for all function, global and data segment symbols. This increases the ability to debug wasm modules tremendously as tools like wasm2wat can use this information to generate named functions, globals etc, rather than placeholders such as $f1.
2021-11-30allocgate: std Allocator interface refactorLee Cannon
2021-11-27wasm-linker: Upstream zwld into stage2Luuk de Gram
- Converts previous `DeclBlock` into `Atom`'s to also make them compatible when the rest of zlwd gets upstreamed and we can link with other object files. - Resolves function signatures and removes any duplicates, saving us a lot of potential bytes for larger projects. - We now create symbols for each decl of the respective type - We can now (but not implemented yet) perform proper relocations. - Having symbols and segment_info allows us to create an object file for wasm.
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-08-01wasm: Implement wrapping operands, add opcodes to wasm.zigLuuk de Gram
- Some opcodes have the incorrect value set in std. - Some opcodes were missing and have now been added to std. - Adding wrapping operands for add,sub and mul. - Implement intCast which either extends or shortens the type.
2021-05-08std: update usage of std.testingVeikka Tuominen
2021-04-08Refactor link/wasm.zig to use offset tableLuuk de Gram
This refactor inserts an offset table into wasm's data section where each offset points to the actual data region. This means we can keep offset indexes consistant and do not have to perform any computer to determine where in the data section something like a static string exists. Instead during runtime it will load the data offset onto the stack.
2021-04-05std/wasm: add buildOpcode to help construction of `Opcode`sgracefu
2021-02-05Ensure function indices are correct and fix a memory leakLuuk de Gram
2021-02-05Create type declarations for extern functions and write the 'import' sectionLuuk de Gram
2021-02-01Define wasm constantsLuuk de Gram
Update link.Wasm.zig to use std.wasm for its constants Make opcodes u8 and non-exhaustive Update test and rename 'spec' to 'wasm'