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

[JS Generator] Add scope for each wasm instance #1698

Open
LiuYu396 opened this issue Oct 27, 2023 · 1 comment · May be fixed by #1699
Open

[JS Generator] Add scope for each wasm instance #1698

LiuYu396 opened this issue Oct 27, 2023 · 1 comment · May be fixed by #1699

Comments

@LiuYu396
Copy link

The live range of the wasm instance created by JS Generator is global, likes:

let $1 = instance(...);
assert...($1, ...);
let $2 = instance(...);
assert...($2, ...);

Tests such as memory_copy.wast and memory_init.wast, usually contain many instances. When executing these tests on some machines, out of memory fails may be reported.

Can you add a scope to each instance so that they are destroyed after use ?

@rossberg
Copy link
Member

That matches the .wast semantics, where all modules exist for the rest of the test script (and some tests rely on this). Determining the end of live range implicitly in the converter would not be straightforward.

I created a patch in #1699 which modifies test generators and JS converter to explicitly introduce scopes. Unfortunately, that requires using a new feature in the .wast scripts to express these scopes. Existing tools parsing .wast will most likely break, so I'm not sure if or when we can merge this.

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 a pull request may close this issue.

2 participants