Skip to content

Prepare FACT for supporting more memory types#12972

Open
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
alexcrichton:refactor-fact-for-memory-types
Open

Prepare FACT for supporting more memory types#12972
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
alexcrichton:refactor-fact-for-memory-types

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit refactors the internals of FACT, wasmtime's component-to-component trampoline compiler, to better handle memories of different types. When FACT was originally written it had support for memory64, despite components not having support for memory64, but since then more types of memories have showed up in core wasm. For example FACT didn't handle shared memories or custom-page-sizes memories well. This commit manually updates some memory64: bool fields/etc to ty: Memory to have a full-fledged memory type on-hand during translation. This affects how the memory is imported, for example, as well as bounds checks.

Note that components do not currently support 64-bit memories, nor shared memories, nor custom-page-size memories. This refactoring is for future support of these features internally within FACT itself, but more support will be necessary to fully support these features throughout the runtime.

This commit refactors the internals of FACT, wasmtime's
component-to-component trampoline compiler, to better handle memories of
different types. When FACT was originally written it had support for
memory64, despite components not having support for memory64, but since
then more types of memories have showed up in core wasm. For example
FACT didn't handle shared memories or custom-page-sizes memories well.
This commit manually updates some `memory64: bool` fields/etc to `ty:
Memory` to have a full-fledged memory type on-hand during translation.
This affects how the memory is imported, for example, as well as bounds
checks.

Note that components do not currently support 64-bit memories, nor
shared memories, nor custom-page-size memories. This refactoring is for
future support of these features internally within FACT itself, but more
support will be necessary to fully support these features throughout the
runtime.
@alexcrichton alexcrichton requested a review from a team as a code owner April 6, 2026 18:01
@alexcrichton alexcrichton requested review from cfallin and removed request for a team April 6, 2026 18:01
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