Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NFC: BridgeJS: Remove dead cleanup infrastructure#655

Merged
krodak merged 1 commit into
swiftwasm:mainswiftwasm/JavaScriptKit:mainfrom
PassiveLogic:kr/cleanup-removalPassiveLogic/JavaScriptKit:kr/cleanup-removalCopy head branch name to clipboard
Feb 18, 2026
Merged

NFC: BridgeJS: Remove dead cleanup infrastructure#655
krodak merged 1 commit into
swiftwasm:mainswiftwasm/JavaScriptKit:mainfrom
PassiveLogic:kr/cleanup-removalPassiveLogic/JavaScriptKit:kr/cleanup-removalCopy head branch name to clipboard

Conversation

@krodak

@krodak krodak commented Feb 18, 2026

Copy link
Copy Markdown
Member

Overview

As discussed recently, we're not going with the type descriptor approach from #622. Instead, splitting the improvements into targeted PRs, as #622 even after the cleanup is a bit too much, as most likely we don't want to include all changes (even after the cleanup), so this approach should work better.
This is the first one - removing cleanup infrastructure that became dead code after #635 and #636.

What changed

After #635 (string lower no longer needs cleanup) and #636 (fixed JSObject? double-release in struct lowering), no type produces cleanup code at runtime. This PR removes all of it:

  • cleanupCode printer field from IntrinsicJSFragment.PrintCodeContext
  • tmpStructCleanups array and swift_js_struct_cleanup BJS handler from generated JS
  • _swift_js_struct_cleanup extern and wrapper from BridgeJSIntrinsics.swift
  • swift_js_struct_cleanup stub from instantiate.js
  • Struct helper lower() no longer returns { cleanup } - just pushes fields to stacks
  • Enum helper lower() returns caseId directly instead of { caseId, cleanup }
  • Struct/enum helper factory collapse: () => { return () => ({...}); } simplified to () => ({...}); call-site ()() becomes ()
  • init(unsafelyCopying:) no longer calls struct cleanup; lower extern returns Void instead of Int32
  • strStack.push(textDecoder.decode(bytes)) inlined (removed intermediate variable)

@krodak krodak self-assigned this Feb 18, 2026
@krodak krodak merged commit 8bbf832 into swiftwasm:main Feb 18, 2026
12 checks passed
@krodak krodak deleted the kr/cleanup-removal branch March 27, 2026 13:47
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.