WebAssembly / WebAssembly/spec

[JS Generator] Add scope for each wasm instance

Open
#1,698 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
3.5k
Forks
539
Avg merge
2d 1h
Merged PRs (30d)
13

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JS Generator and inspect how instance(...) calls are emitted for memory_copy.wast and memory_init.wast. Confirm that each generated instance is scoped so it can be destroyed after its assertions; run those tests and verify that repeated instances no longer retain unnecessary memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.