Parent: #486 Depends on: #487, #469, #470, #481
Goal
Add a profiling optimizing WebAssembly tier for hot functions and loops, including bounds/alias/range optimization, inlining, and allocation/GC specialization.
Scope
- Build typed SSA with explicit memory/table/global/GC/exception/atomic effects and exact source/trap origins.
- Add constant folding, GVN/CSE, DCE, range analysis, loop optimization, redundant bounds-check elimination, address strength reduction, load/store forwarding, and block layout.
- Inline direct and guarded indirect/ref calls with code-size/compile-cost budgets; specialize JS import/export conversions and common runtime helpers.
- Optimize multi-memory/memory64/table/GC object operations only with correct alias, growth, relocation, and trap guards.
- Add OSR/tiering/deopt or safe replacement from baseline code, preserving exact Wasm stack/locals/handlers/GC roots.
- Coordinate vectorization with #488 and tiering/memory policy with #481/#480.
No-workaround rules
- No hoisting across a possible trap/effect when observable order changes, stale memory base after growth, lost integer wrap/NaN behavior, assumed import purity, or unbounded compile/code growth.
Acceptance
- IR verifier and pass-specific positive/negative tests cover traps, aliases, growth, exceptions, GC, atomics, and recovery.
- Baseline/optimizer/interpreter differentials cover every optimized family on all declared backends.
- Full conformance, no-GIL, moving-GC, TSan, OOM/fault, streaming, and artifact-lifetime gates pass.
- #461 reports compile time, code bytes, eliminated checks/operations, OSR/deopt, runtime calls, and memory.
- Expanded #460 Wasm rows meet #486 goals without cold/compile/RSS regressions hidden by warmed throughput.
Foundation
Reuse the verified optimization/effect principles from #469, not JavaScript-specific value semantics.