Skip to content

fix(jsc): release class-field identifiers with their parser arena - #28

Draft
steipete wants to merge 1 commit into
openclaw/mainfrom
fix/parser-arena-identifier-release
Draft

steipete wants to merge 1 commit into
openclaw/mainfrom
fix/parser-arena-identifier-release

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown

DefineFieldNode owns an Identifier but inherited only ParserArenaFreeable, so arena teardown skipped its destructor and lost the owning string reference. Registering it as ParserArenaDeletable balances that reference when the arena is destroyed. Live parser/identifier semantics and process-wide destructor policy stay unchanged. The recorded upstream searches found no matching owner fix in oven-sh/WebKit or WebKit/WebKit.

The native regression checks public, private, and computed field nodes. An identifier's reference count goes 1→2→2 on the baseline and 1→2→1 with the fix; JavaScriptCore_ParserArena.DefineFieldReleasesIdentifier passes against the rebuilt engine. The allocation audit attributes 115 bytes across four allocations per Worker to these lost references.

Integration qualification with openclaw/bun#153 rebased onto merged openclaw/bun#152 is complete. Both 1,000-Worker no-addon Linux LSan routes exit 0 using only the inherited console suppression; the separate known console remainder is 72 bytes/two allocations per global (oven-sh/bun#38395). The previously aborting addon-owned event-name case now delivers exactly one null-env callback on its creating thread under ASAN. Both platforms pass the complete 264-test N-API suite and the eight-finalizer/zero-fd fixture.

Matched 5,000-cycle OS RSS growth decreases from 9,408,512 to 6,930,432 bytes on Linux and from 16,154,624 to 11,173,888 bytes on macOS. Loaded-Worker timing improves on macOS; Linux changes are small and mixed across metrics and paired blocks, with no resolved directional change. Full numbers and the timing limitation are in openclaw/bun#153. No run was discarded or repeated to improve a result.

P2 review is scoped-clean, and this PR's exact-head engine checks are green. The parser fix is independently safe; the complete Worker-leak release also requires Bun oven-sh#153 after oven-sh#152. The development and release-line WebKit PRs target separate branches, with no ordering dependency between them. A matching engine artifact must be rebuilt and selected by Bun before advertising the complete fix. This PR remains unmerged and no artifact has been published.

Exact head: 9531a371207cfcaa837c0fc1febd62112bb07f91. Engine checks and ARM64 regressions are green.

DefineFieldNode owns an Identifier but inherited the arena allocation path that skips destructors. Register it as ParserArenaDeletable so its owning reference is released, with a refcount regression for all field types.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant