Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Oct 24, 2025

Defined functions remain exact, but imported ones are inexact.

This is a step along the recent Custom Descriptors spec changes.

  • New RefFunc::finalize and Literal::makeFunc variants get the module, and look up
    the type there.
  • New Builder::makeRefFunc variant gets a Type and applies it. The HeapType
    variant does a lookup on the module (so the Type one is more efficient/applicable
    if the IR is not fully built yet).
  • ReFinalize now updates RefFunc types (following the pattern of a few other places).
  • C and JS APIs now assume RefFuncs are created after imported functions (so we can
    look up the type of the import; see changelog, this seems the least-annoying way to
    update here, avoiding new APIs, and less breakage for users - hopefully none, all our
    tests here pass as is).
  • wasm-split adds a cast when a function becomes an inexact import.
  • Fix GUFA to handle inexact function literals.
  • Update types in passes and fuzzer as needed.

tlively and others added 30 commits October 8, 2025 13:44
Update the Literal constructors for funcrefs to take Type instead of
HeapType to allow them to be given inexact function references types
when the referenced function is an import. Use the new capability to
give references to imported functions inexact types in GUFA. Add a test
where this change fixes a misoptimization as well as tests where this
change simply changes the nature of the misoptimization. Future PRs will
fix these tests.
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