Skip to content

WASI support #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: webassembly
Choose a base branch
from
Draft

WASI support #1

wants to merge 2 commits into from

Conversation

tanishiking
Copy link
Owner

This commit introduces the necessary infrastructure to handle WebAssembly memory operations.
This commit introduces a memory management API for WebAssembly, enabling direct manipulation of memory segments on Wasm linear memory.

`MemoryAllocator` handles the allocation and freeing of memory, while `MemorySegment` allows for read/write data on the allocated memory.
Those APIs are implemented as a intrinsic functions: Wasm linker backend
translates the method body of `allocate`, `free` of `MemoryAllocator`
and `_storeX`, `_loadX` of `MemorySegment` to `Transient.Value` and then
transformed into Wasm via `FunctionEmitter`.

We use `Transient.Value` instead of defining new `Tree`s in SJSIR,
so that we wouldn't introduce the breaking change once we need to modify
the structure of those structures.
We'll keep them `Transient.Value` at least until we make sure we found
the "right" IR structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant