镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

VM: expose exact active legacy arguments for compiled ordinary functions #802

Closed

Description

@chrisbbreuer

Parent: #465. Found while validating #801; coordinate activation ownership with #787.

Baseline e4f76af fails this positive paired VM witness even without GC:

function legacyRead(value) { return legacyRead.arguments[0]; }
assert.sameValue(legacyRead(37), 37);

The tree-walker passes; required bytecode throws TypeError: null is not an object. The ordinary function is admitted, but VM calls do not publish the legacy call-frame view used by Interpreter.getProperty. This is separate from relocation of an already published tree-walker legacy frame.

Acceptance:

  • Preserve the engine's legacy caller/arguments behavior in admitted ordinary compiled calls, including inline, nested-driver, recursive and tail transitions, without routing them to the tree-walker.
  • Keep argument mapping/identity, strict and newer-function poison restrictions, and cross-realm behavior exact.
  • Publish and retire introspection views under the existing activation ownership protocol, failure-atomically and with relocatable function/environment/argument slots; coordinate with GC: publish provisional VM activation roots failure-atomically #787 rather than racing that lifecycle work.
  • Add no-GC and actual moving-GC differential controls, OOM, no-GIL/TSan and relevant conformance.

The failing witness and transcript are retained locally under /Users/chris/.cache/zig-js-801.9pDs7h/legacy-arguments.js and before-legacy-arguments.log. This issue remains open independently of the scoped coercion/assignment root work.

Activity

  1. chrisbbreuer commented on Aug 31, 2026

    @chrisbbreuer
    MemberAuthor

    Implemented and pushed to main in bcc3e757.

    The VM now publishes activation-owned legacy caller/arguments views for compiled ordinary functions, lazily materializes exact mapped arguments, preserves recursive/nested/inline/tail ownership, and traces/relocates function, environment, and argument edges. Native direct calls reject potentially reentrant effects before execution and retain proven safe fast paths; common snapshots stay inline to avoid per-call allocator pressure.

    Verification:

    • zig build test-parallel: 2,226 passed, 1 skipped, 0 failed, 0 leaked
    • optimizer unit gate: 71/71
    • tree-walker/required x GC-off/GC-on differential, wide-argument overflow, cross-realm, poison, recursion, tail, and actual moving-GC probes passed
    • activation OOM probes passed for normal and inline driver entry
    • focused no-GIL probe passed under TSan
    • test262 test/built-ins/Function/prototype: 309 -> 309; 0 flips, 0 regressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions