PEGO

A270: Shared Empty Capture Frame

A scope with no capture slots needs no fresh frame storage. One immutable empty frame can represent it.

Mechanism and Invariants

The frame is shared only for zero-slot scopes and is never written. Captured scopes keep their own slot arrays and rollback. Plain calls can leave a caller's frame current, while generic zero-slot invocations use the empty owner. Complete layout collectors must count required dead/nil slots before deciding a scope is empty.

Scope and State

Default capture-free scope representation in closure, both VMs, generated Go Node/typed Go and TypeScript.

Reference Control

No shared-empty-frame-only comparator is maintained. Plain-call or layout controls affect a larger route.

Evidence and Implementation

Record 001 lists the empty-frame mechanism among combined changes; 019 measures a broader capture-free call path. Neither provides a current isolated empty-frame effect.

Evidence records: 001, 019.

Source owners: emptyFrame and invokePlain, newFrame, generated empty frame, Parser.newFrame.

The comparison policy distinguishes same-source controls, historical changes and full checkpoints.

Related mechanisms: M050, A180.

Optimization Catalog