makepad/libs/wasm_strip
Admin 012e6f7df5 tools, libs and the rest
cargo-makepad, makepad-builder (with an Android step on every OS), CI tools
and tiles, and the remaining libraries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 12:26:21 +02:00
..
examples wasm_strip units: table entries are pruned by a liveness mark -- a function is live when it is exported or the start function, a live function calls it, or live code or the data it reaches names its table slot: an i32.const that is not an operand of arithmetic, a comparison, a branch or a load address; the method slots of a vtable ([drop fn or 0, size, align, method...]) at an address live code or the data it reaches names, up to the next vtable header (code that loads a method from a known vtable names an address inside it); the first words of another named static (a thread local's key) up to the next address anything named before the strip. Every other entry points at a trapping stub of its type and dead-code elimination drops the function. Counting every word of live data named almost every slot (small numbers in the data) and a cycle (a closure's vtable named by the function that only that closure reaches) kept dead widgets alive. OptimizeOptions.prune_exported_table prunes a table the module exports for a host that only grows it (the film's kernel linker); data::DataLive::of_code leaves dead code's anchors out. Examples: wasm_units modules --prune-exported-table, wasm_units report (per unit: code bytes and functions a coverage run entered, matched by demangled name), wasm_why --root (the call chain from a function back to the table slot or export that keeps it). Checked: cargo test --release -p makepad-wasm-strip --lib (42) and --test fuzz stripped (OPT2's stripped_modules_replay_the_same); counter collect-run strip pixel-identical in headless Chrome incl. two clicks; the P(DOOM) film with its analysis census (42 of 119 script modules used): optimised 18.65 MB / 3.799 MB br -> 18.05 MB / 3.733 MB br, widgets_core code 993 -> 882 KB, plays the full 156 s in the safety gate the same as the unstripped build. 2026-10-01 13:45:53 +02:00
spec tools, libs and the rest 2026-10-13 12:26:21 +02:00
src tools, libs and the rest 2026-10-13 12:26:21 +02:00
tests tools, libs and the rest 2026-10-13 12:26:21 +02:00
Cargo.toml tools, libs and the rest 2026-10-13 12:26:21 +02:00