Parents: #465, #498 Related: #491, #711
Problem
Program, generator, async, and plain-function admission still rejects the optional_chain AST wrapper and optional member/call nodes even though bytecode already provides nullish peek jumps, exact property lookup, receiver-aware calls, spread calls, and ordinary branch merging. This forces otherwise eligible code to the tree-walker and leaves a known tier-divergence surface around computed keys, argument suppression, and receiver identity.
Scope
- Lower optional property reads and optional calls in program, plain-function, generator, and async bytecode.
- Preserve one-shot base/key/getter/callee evaluation, receiver identity, and the rule that computed keys and arguments are skipped after a nullish short circuit.
- Carry a chain short circuit across later non-optional member/call segments while respecting parentheses that terminate the chain.
- Support mixed named/computed segments, direct/member calls, spread arguments, generator/async suspension, proxy/accessor effects, and nested chains.
- Preserve optional
eval?.(...)as indirect eval and keep strict tail-position behavior exact; reject only shapes lacking an existing causal tail operation. - Use compile-owned jump patching and verified operand cleanup over the existing VM operation family.
No-workaround rules
- No source/AST rewriting, repeated observable evaluation, hidden bindings, global/environment scratch, heap wrapper per reference, tree-walker callback, disabled proper-tail-call behavior, or new runtime primitive.
- No runtime stack-container, queue, job, Promise/microtask, Worker, or Map/Set iterator changes.
Acceptance
- Program/plain/generator/async optional reads and calls compile through existing operations with exact short-circuit cleanup.
- Witnesses cover chain continuation and parentheses, computed key/argument suppression, getter/proxy counts, receiver identity, spread, indirect eval, suspension, exceptions, and strict tail positions.
- Forced tree-walker and required bytecode agree; unsupported barriers remain causal and audited.
- Focused compiler/frontend, full units, applicable TSan, and exact optional-chaining Test262 before → after accounting pass with zero regressions.
- Parent/related issues and landing commit are cross-linked with quantified evidence.