Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20825c02cda2d46fc21745193bf2b91a382f40d2
      
https://github.com/WebKit/WebKit/commit/20825c02cda2d46fc21745193bf2b91a382f40d2
  Author: Robert Jenner <[email protected]>
  Date:   2026-04-29 (Wed, 29 Apr 2026)

  Changed paths:
    A JSTests/wasm/regress/wasm-tag-retains-reachable-types.js
    M Source/JavaScriptCore/wasm/WasmTag.h
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.h
    M Source/JavaScriptCore/wasm/js/WebAssemblyGCStructure.cpp
    M Source/JavaScriptCore/wasm/js/WebAssemblyGCStructure.h

  Log Message:
  -----------
  [JSC] JSWebAssemblyTag should retain FunctionSignature types
https://bugs.webkit.org/show_bug.cgi?id=306559
rdar://168041308

Reviewed by Marcus Plutowski.

This problem is similar to the problem from a few months ago with 
WebAssemblyGCStructure not
retaining all TypeDefinitions it depends on. That problem was fixed by 
introducing
WebAssemblyGCStructureTypeDependencies which holds a transitive closure of all 
types reachable from
a given root type (a StructType or ArrayType). It is retained by a 
WebAssemblyGCStructure to ensure
all reachable TypeDefinitions stay alive for as long as the structure can 
reference them.

This patch adapts WebAssemblyGCStructureTypeDependencies to also ensure that a 
Wasm::Tag retains all
TypeDefinitions reachable from its 'm_type' (a FunctionSignature).

Specifically:

- WebAssemblyGCStructureTypeDependencies is moved from 
WebAssemblyGCStructure.h/.cpp to
  WasmTypeDefinition.h/.cpp and renamed WebAssemblyGCTypeDependencies.

- The implementation is extended to traverse FunctionSignatures.

- An instance of WebAssemblyGCTypeDependencies is created and stored by 
Wasm::Tag constructor to
  capture all TypeDefinitions reachable from the tag's function signature.

Test: JSTests/wasm/regress/wasm-tag-retains-reachable-types.js

Originally-landed-as: 305413.237@safari-7624-branch (5c551f153c01). 
rdar://173969088
Canonical link: https://commits.webkit.org/312331@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to