From 4af3f2e147d7b36bbdac396327c696655a196f32 Mon Sep 17 00:00:00 2001 From: Joshua Koo Date: Tue, 1 Sep 2026 05:29:56 +0000 Subject: [PATCH 1/4] Bun/JSC JIT symbol resolution via JITDump (rebased from bun branch) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port the `bun` branch's JITDump support onto the current tree. The bun branch forked at v0.3.13 and predates HotSpot introspection, DWARF tail-call unwinding, and aarch64; a literal rebase conflicted heavily across trace_handler/event_loop/spawn/symbolize, so this re-applies the work semantically against current code as one coherent change. Bun uses JavaScriptCore, which emits a binary perf JITDump (`jit-.dump`) rather than a text perf-map, so its JIT-compiled JS showed as `[unknown]`. - jitdump.rs (new, from the bun branch tip): zero-dependency JITDump parser (JIT_CODE_LOAD/MOVE/DEBUG_INFO/CLOSE, BTreeMap range lookups, incremental reload, tolerant of truncated files, JSC + standard file naming, JSC #hash stripping). - trace_handler: per-PID `jit_tables`; `apply_jitdump_symbols` runs as an additional JIT source *after* V8 SFI, HotSpot Method*, and the text perf-map fallback, so it only names frames nothing else resolved. - event_loop: auto-load JITDump on new-PID detection; reload each collection window (symbolize path only); one-time warning when a --pid/system-wide Bun process has no JITDump file. - spawn: `is_bun_program` + auto-inject `BUN_JSC_useJITDump=1` for `probee -- bun