WebAssembly / WebAssembly/binaryen

Combining data segments

Open
#8,198 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

AssemblyScript tends to produce a lot of (data ...) entries which are adjacent to each other, and seem like they could be combined. Here's an example.

I can see that memory-packing splits blocks up, but I don't see a way to combine them. Am I missing something, and could this be added?

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 example in tests/compiler/memory.debug.wat and inspect the existing memory-packing behavior that splits data blocks. Trace where adjacent (data ...) entries are handled, then determine the expected combined output while preserving their contents and layout. Done should include coverage for adjacent segments and confirm the optimizer produces the intended combined representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.