Skip to content

[MakeSharedObjects] Lower externrefs using a dynamically grown table - #9114

Merged
tlively merged 1 commit into
mainfrom
shared-obj-lazy-table-externs
Sep 18, 2026
Merged

tlively merged 1 commit into
mainfrom
shared-obj-lazy-table-externs

Conversation

@tlively

@tlively tlively commented Sep 18, 2026

Copy link
Copy Markdown
Member

Because arbitrary unshared externrefs cannot be made shared directly,
lower unshared externrefs to shared i31ref table indices using a
LazyTable abstraction that manages the table and runtime conversion
helpers on demand.

Unlike function references, externrefs are still passed across the
module boundary, so wrap imported and exported functions that accept or
return externrefs to convert between externrefs and table indices. Also
lower any.convert_extern and extern.convert_any using imported
conversion helpers, and check that table.grow succeeds (>= 0) when
converting references to indices, trapping otherwise.

Because arbitrary unshared externrefs cannot be made shared directly,
lower unshared externrefs to shared i31ref table indices using a
LazyTable abstraction that manages the table and runtime conversion
helpers on demand.

Unlike function references, externrefs are still passed across the
module boundary, so wrap imported and exported functions that accept or
return externrefs to convert between externrefs and table indices. Also
lower any.convert_extern and extern.convert_any using imported
conversion helpers, and check that table.grow succeeds (>= 0) when
converting references to indices, trapping otherwise.
@tlively
tlively requested a review from a team as a code owner September 18, 2026 00:45
@tlively
tlively requested review from kripken and removed request for a team September 18, 2026 00:45
@tlively
tlively merged commit fbf2e5a into main Sep 18, 2026
16 checks passed
@tlively
tlively deleted the shared-obj-lazy-table-externs branch September 18, 2026 16:50
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