Parent: #496 Related: #537, #549, #550
Problem
parseTaggedTemplate stores multi-substitution results in three independent arena-backed ArrayListUnmanaged values for cooked quasis, raw quasis, and expressions. A template with N substitutions has exact cardinalities N+1, N+1, and N, but the parser retains each list's growth capacity and transfer history for the full AST lifetime.
Scope
- Add parser-only 1K/2K/4K single-tagged-template workloads with N substitutions and independently validate every cooked quasi, raw quasi, expression value, pointer/lifetime invariant, and checksum.
- Count top-level substitutions with the same escape/nesting rules used by parsing, allocate the three final AST arrays at their exact cardinalities, and fill them directly.
- Preserve the no-substitution exact fast path and source-backed plain quasis.
- Preserve nested braces/templates/strings/regex/comments in substitutions, raw/cooked divergence, invalid tagged escapes, inherited yield/await/private/strict/module contexts, source ranges, evaluation order, and OOM propagation.
No-workaround rules
- No benchmark source splitting, hidden AST side table, worst-case allocation, dropped raw/cooked entry, expression pre-evaluation, reduced nesting grammar, deferred syntax error, or benchmark-specific template shape.
Acceptance
- Benchmark-first 1K/2K/4K rows freeze exact per-quasi/per-expression validation and allocation growth before parser changes.
- N substitutions allocate exact final arrays of N+1 cooked entries, N+1 raw entries, and N expression pointers with no list growth/transfer.
- Direct tests cover zero/one/many substitutions, escaped and invalid quasis, nested braces/templates/regex/comments, inherited parse contexts, exact cardinalities, and deterministic OOM/retry.
- Parser/lexer/frontend, TSan, full units, forced tree-walker/VM execution, and exact template/tagged-template test262 comparisons pass without regressions.
- Exact-parent evidence records wall, hardware counters, allocation requests/bytes, RSS, checksums, and 1K/2K/4K growth without moving parsing or AST validation outside the timed boundary.