Skip to content

ABI: expose exact native CallFrame caller metadata #251

Description

@chrisbbreuer

Goal

Implement the three pinned Home/Bun CallFrame introspection exports for Zig host callbacks: Bun__CallFrame__getCallerSrcLoc, Bun__CallFrame__isFromBunMain, and debug Bun__CallFrame__describeFrame.

Parent tracking: #134, #140, #163, #164. Depends on #248 and #250.

Required implementation

  • Associate each active pinned JSC64 callback frame with its owning VM and visible JavaScript caller without changing the consumer-visible register layout.
  • Return an owned source URL plus exact one-based line/column, skipping the private native frame and preserving same-VM sibling behavior.
  • Detect builtin://bun/main from caller source origin and reject null, stale, mismatched-frame, and foreign-VM inputs.
  • Provide a stable NUL-terminated debug description for the active frame without heap lifetime ambiguity.
  • Preserve nested/reentrant native callbacks and pending exceptions.
  • Promote both inventories and update README/API/Home/ABI evidence.

Evidence gate

  • Compiled consumer invokes all three exports from ordinary, constructor, nested, named-source, builtin-source, sibling-global, invalid, and foreign-VM cases.
  • Home/Bun inventories remain zero-unclassified.
  • Targeted host-function/CallFrame runtime matrix passes; broad testing stays batched with adjacent slices.
  • Current benchmark remains linked unless measured workload code changes.

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