Skip to content

ABI: implement counted private JSValue protection #367

Description

@chrisbbreuer

Parent

Goal

Implement the revision-pinned Home/Bun Bun__JSValue__protect and Bun__JSValue__unprotect boundary exactly: cell values become counted VM roots, primitives are no-ops, and a value becomes collectible only after the matching number of unprotect calls.

Scope

  • Export both exact C symbols with the pinned encoded-value signatures.
  • Recover the owning VM from private encoded cell handles without requiring a separate global argument.
  • Ignore empty, deleted, primitive, invalid-kind, and unmatched unprotect inputs without changing root state.
  • Share the existing race-safe counted C-API root table so protection remains correct under precise, moving, and parallel collection.
  • Prove double-protect/single-unprotect retention and final-unprotect release under precise GC.
  • Exercise both symbols from the independently compiled Home/Bun ABI consumer fixture.
  • Refresh both pinned inventories and their drift gates.

Completion evidence

A focused Debug/ReleaseSafe private-ABI run plus the compiled consumer fixture must pass. The expensive full suite remains delegated to the normal batched CI run.

Activity

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