Skip to content

Materialize compile-time constants as static data#9771

Closed
rtfeldman wants to merge 434 commits into
mainfrom
wasm-changes
Closed

Materialize compile-time constants as static data#9771
rtfeldman wants to merge 434 commits into
mainfrom
wasm-changes

Conversation

@rtfeldman

Copy link
Copy Markdown
Contributor

This adds explicit static-data references for reachable compile-time constants, materializes those constants into backend data objects, and teaches the wasm/native backends to use those symbols instead of rebuilding constants at runtime. It also updates wasm target config to model imported memory as No, Uninitialized, or Zeroed, wires Binaryen optimization into wasm size/speed builds, and adds regression coverage for hoisted constants, static data emission, and unused top-level compile-time evaluation.

@rtfeldman rtfeldman changed the base branch from main to fmt-tight-single-collection-args June 23, 2026 16:34
@rtfeldman rtfeldman changed the base branch from fmt-tight-single-collection-args to main June 25, 2026 13:07
rtfeldman added 29 commits July 8, 2026 16:33
A constant list literal consumed through .iter() is materialized as static
data, so the whole minted chain including the base list allocates nothing on
the --opt=size cart path. Add a wasm-static-lib gate asserting --max-allocs 0
for the full list.iter().append().append() for-loop pattern, which the existing
--assert-alloc-balanced iter_for gate cannot catch (a heap-built base list
would allocate-and-free yet stay balanced).
@rtfeldman rtfeldman closed this Jul 10, 2026
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