ReviewOS

zig-utils/zig-js

ABI: implement exact fast built-in property reads

#204
Closed chris opened this 9 days ago ·
9 days ago

Parent

Scope

Implement the pinned side-effect-controlled property reads:

  • JSC__JSValue__fastGetDirect_
  • JSC__JSValue__fastGet
  • JSC__JSValue__fastGetOwn
  • Bun__JSObject__getCodePropertyVMInquiry (Bun core only)

Acceptance criteria

  • Pin all 24 BuiltinName byte values, including Symbol.asyncIterator, and reject out-of-range IDs safely.
  • fastGetDirect_ reads only direct own data storage and returns empty for absence/accessors without walking prototypes or invoking user code.
  • fastGetOwn performs exact GetOwnProperty slot resolution, including own accessors and Proxy descriptor behavior, and returns empty for absence/exception.
  • fastGet uses the existing Bun-compatible Object.prototype-cutoff lookup and returns deleted for absence, empty for exception, and present undefined unchanged.
  • Bun's code VM inquiry rejects null/proxy receivers, walks data properties without invoking accessors/custom hooks, and returns empty for absence or non-pure slots.
  • Focused coverage includes all 24 IDs, Symbol identity, direct/own/inherited distinctions, Object.prototype cutoff, accessors, proxies, present undefined, invalid IDs, sibling realms, foreign values, and first-exception preservation.
  • Inventories, README/API evidence, and parent trackers are regenerated from checked-in results.
9 days ago

Implemented and published directly on main.

Implementation: 59029d2d (feat(abi): implement fast built-in property reads (#204)) Documentation: 4f9c60e6 (docs(abi): publish fast property read evidence (#204))

Delivered:

  • exact 24-entry BuiltinName byte table, including VM-owned Symbol.asyncIterator and Symbol.for("nodejs.util.inspect.custom") identity;
  • direct-data-only, own-slot, and Object.prototype-cutoff fast reads with their distinct empty/deleted/present-undefined contracts;
  • Bun-only pure code VM inquiry that sees inherited data but executes no accessor, custom hook, or Proxy trap;
  • table-wide and observability-focused coverage for accessors, proxies, inheritance, cutoff, invalid IDs, sibling realms, foreign cells, and first-exception preservation.

Validation:

  • zig build test-home-private-abi -Doptimize=Debug — green, 115/115 symbols linked and runtime matrix passed.
  • zig build home-private-abi-audit bun-private-abi-audit — green.
  • Home: 116/431 implemented, 315 pending.
  • Bun core: 110/421 implemented, 311 pending.
  • Public/extension accounting remains 117/19.

README benchmark scores were preserved because this was an ABI/correctness slice and no benchmark input changed.

Sign in to comment on this issue.