--- id: scan-spidermonkey priority: medium status: unscanned created: 2026-03-23 --- ## Target **Repo:** `https://github.com/mozilla/gecko-dev` (sparse clone: `js/src/jit/`) **Language:** C++ **Why:** Firefox JIT compiler — linear vector scans in IonMonkey graph coloring or SCC inflate JIT compilation time on complex JS functions. ## Scan command ```bash # Sparse shallow clone of just the JIT directory git clone --depth 1 --filter=blob:none --sparse https://github.com/mozilla/gecko-dev /tmp/spidermonkey cd /tmp/spidermonkey && git sparse-checkout set js/src/jit # Submit to unsandbox cat > /tmp/scan-spidermonkey.sh << 'EOF' #!/usr/bin/env bash set -euo pipefail GRAPH_KW="tarjan|strongly.connected|dfs|scc|topolog|topo.sort|cycle|reachab|postorder|dominator|liveness|digraph|shortest.path|path.find" MEM="std::find|\.count\(|vector.*find|find.*begin.*end|push_back.*visited|visited\.push_back" find /tmp/spidermonkey/js/src/jit -name "*.cpp" -o -name "*.h" | sort | while read f; do graph_lines=$(grep -inE "$GRAPH_KW" "$f" 2>/dev/null | cut -d: -f1 | head -5 || true) [ -z "$graph_lines" ] && continue while IFS= read -r lineno; do s=$(( lineno > 20 ? lineno - 20 : 1 )); e=$(( lineno + 20 )) hit=$(sed -n "${s},${e}p" "$f" 2>/dev/null | grep -iE "$MEM" | head -1 | sed 's/^\s*//' || true) [ -n "$hit" ] && echo "CANDIDATE\t${f}:${lineno}\t${hit}" done <<< "$graph_lines" done EOF export UNSANDBOX_PUBLIC_KEY=unsb-pk-russ-test-isth-best export UNSANDBOX_SECRET_KEY=unsb-sk-rk46c-3zvpg-zjf6z-hjrge ~/git/un-inception/build/un /tmp/scan-spidermonkey.sh ``` ## Key files to check - `js/src/jit/IonAnalysis.cpp` — IonMonkey IR analysis passes; SCC, dominators, liveness - `js/src/jit/BacktrackingAllocator.cpp` — Register allocator; live range graph coloring with visited tracking - `js/src/jit/MIR.cpp` — MIR graph node management; use/def chain traversal ## Expected pattern `std::find(vec.begin(), vec.end(), block)` where `vec` is a `Vector` used as a visited set inside `BuildDominatorTree` or `AnalyzeNewScriptDefiniteProperties` — or equivalent loop in `BacktrackingAllocator` over a `LiveRangeVector`. ## Acceptance criteria - [ ] Scan run and results saved to `tools/scan-results/spidermonkey.txt` - [ ] All CANDIDATE hits triaged (confirmed defect or false positive) - [ ] If confirmed: defect ticket created in `tools/tickets/defects/`