Skip to content

NFC: BridgeJS: Further simplify codegen and JSValue intrinsics#625

Merged
krodak merged 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/bridgejs-next-cleanups
Feb 12, 2026
Merged

NFC: BridgeJS: Further simplify codegen and JSValue intrinsics#625
krodak merged 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/bridgejs-next-cleanups

Conversation

@krodak
Copy link
Member

@krodak krodak commented Feb 12, 2026

Overview

  • Refactor ClosureCodegen to remove duplicate closure type construction by extracting swiftClosureType(for:) and reusing it in both helper and invoke thunk generation.
  • Simplify closure invoke ABI return handling by directly using loweringReturnInfo().returnType and remove now-unused local state.
  • Refactor ExportSwift by extracting shared helpers for static context base name, constructor thunk rendering, and method thunk rendering reused across class/struct export paths.
  • Simplify class property export rendering by collapsing static vs instance context selection to a single call site.
  • Simplify stack lifting for arrays of imported JS class wrappers from manual inline stack loops to [JSObject].bridgeJSLiftParameter().map { Wrapper(unsafelyWrapping: $0) }.
  • Remove an unused parameter from optional lowering internals in StackCodegen.
  • Deduplicate JSValue payload retain logic in BridgeJSIntrinsics via bridgeJSRetainPayloadIfNeeded(kind:payload1:) and reuse it in both lift and lower paths.
  • Simplify JSValue.bridgeJSLiftReturn() to delegate to the existing no-arg bridgeJSLiftParameter() path.

@krodak krodak self-assigned this Feb 12, 2026
@krodak krodak merged commit a98e49d into swiftwasm:main Feb 12, 2026
11 checks passed
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