Skip to content
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

current frame memory access for js callees #67

Closed
devsnek opened this issue May 15, 2019 · 1 comment
Closed

current frame memory access for js callees #67

devsnek opened this issue May 15, 2019 · 1 comment

Comments

@devsnek
Copy link
Member

devsnek commented May 15, 2019

It's not possible for JS callees to gain access to S.mems[0] without it being explicitly exported under a prenegotiated name. This means that it's not possible to work with functions that require memory access within the wasm start function, and it makes it impossible to import a function with the esm proposal that can access the memory.

This seems like a super important step to consider with the design of memory moving forward. I've seen it be a design blocker at least once within WASI (WebAssembly/WASI#19), and I've had to work around it in various other projects I've worked on.

Two ideas I have had are being able to pass memories as function arguments, and having a WebAssembly.currentMemories getter of some sort.

@rossberg
Copy link
Member

That seems unrelated to this proposal, which notably does not have any connection to memory objects at all. I suggest creating an issue on the design repo.

(That said, we could provide first-class references to memory objects, the same way we already provide function references. What we cannot do, however, is giving external access to memory that is not exported or otherwise handed out explicitly. We also cannot give access to exports before the start function has terminated, since that would break the initialisation semantics of a module.)

@devsnek devsnek closed this as completed May 15, 2019
rossberg pushed a commit that referenced this issue Feb 24, 2021
* Initial test generation code

* Cleanup

* Parameterize

* Cleanup

* Rename

* More tests

* Table copy

* table.init

* More tests

* More memory.init tests

* table.copy

* data.drop and elem.drop

* Updates for the reference interpreter

* Partial memory.fill

* Comment out test for reference interpreter

* Partial OOB for memory_init

* Partial table.init

* Partial OOB for table.copy

* Some binary tests

* Uncontroversial updates

* Test suite updates after discussion with binji

* Binary tests for elem segments

* Fix test bug, update comments
rossberg pushed a commit that referenced this issue Feb 24, 2021
* [js-api] Remove spurious argument to ToWebAssemblyValue().

Fixes #51.

* [js-api] Extend the WebAssembly.Table API.

Fixes #22.
Fixes #67.
rossberg added a commit that referenced this issue Sep 20, 2022
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

No branches or pull requests

2 participants