Parent: #465. Related: #815 and #816.
Interpreter.nameAnonValue copies the public name property into a String Value but assigns the original borrowed byte slice directly to Function.name. That internal name is used by stack traces/debug frames and is neither traced nor relocated (traceFunction / relocateFunction treat metadata bytes as arena-owned). A computed string key can therefore leave a live function's diagnostic name pointing into a released or evacuated String cell.
Confirmed on main 61310f6 plus pending #815 metadata lowering:
- A focused direct ownership witness passes mutable
"inferred"bytes into nameAnonValue, overwrites the source withU, and observes a correct public name but internalFunction.name == "UUUUUUUU". - A real moving-nursery witness names an anonymous function from the computed key
'method'+37, releases that key, then invokes the function after a native checkpoint. The public name survives but the error stack losesmethod37. Forced tree-walker fails, independently of #815's new VM flags.
Fix the shared naming ownership boundary, not the stack renderer. Retain immutable diagnostic bytes in the function owner's stable arena before publishing metadata. Preserve existing-name controls, allocation failure cleanup, and shared no-GIL metadata immutability.
Acceptance:
- Own Function.name bytes at NamedEvaluation / nameAnonValue.
- Direct borrowed-storage and actual moving stack-trace regressions pass, with forced VM/tree paths and allocation replay.
- Complete #815's native/no-GIL/TSan, conformance, sharded-unit and fuzz gates with explicit revision scope.
Exact failed Debug log: /Users/chris/.cache/zig-js-vm-naming.7Wj8Ri/name-before-debug.log (0/2 passed, no leaks). No native stack/queue/job redesign or GC pinning workaround.