Parents: #473, #479 Related: #465, #493
Finding
The post-#601 exact-main cold profile still records managed string construction in ordinary evaluation. Interpreter.applyUnary(.typeof) currently calls Value.strAlloc(self.arena, v.typeOf()) for every resolved operand, although ECMA-262 typeof can return only the fixed strings undefined, object, boolean, number, string, symbol, bigint, or function. Availability probes in context/workload configuration repeatedly allocate, classify, copy, register, trace, and finalize cells whose bytes are compile-time constants. The unresolved-identifier branch already returns the correct static undefined cell, so resolved operands take an unnecessarily different ownership path.
Scope
- Add one exact
Value-returningtypeofclassifier shared by tree-walker, VM, and native runtime-operation execution throughapplyUnary. - Return compile-time static
StringCells for all eight result spellings; retain the byte-slicetypeOf()API for embedding/introspection consumers. - Preserve HTMLDDA, callable object, Symbol wrapper/primitive, BigInt wrapper/primitive, and ordinary object ordering exactly.
- Add exact static-cell identity/managed-state tests across every result category and forced tree-walker/required-bytecode execution.
No-workaround rules
- No cached mutable result objects, realm pool, skipped operand evaluation, altered unresolved-identifier handling, or benchmark-specific recognition.
- Static cells remain immutable/unmanaged and must continue to compare by exact bytes against runtime strings.
Acceptance
- Exact-parent attribution proves fewer managed string cells/bytes/finalizers for repeated resolved
typeof, with identical result/checksum and no moved allocation. - Exact-parent cold and dedicated
typeoftiming show a material or consistently causal gain. - Tree-walker, required bytecode, optimizer runtime fallback, GC, moving-GC, C API, TSan, full units, and affected test262 remain exact.