Skip to content

support for ref extern types - #300

Open
ottoville wants to merge 1 commit into
slowli:mainfrom
ottoville:feature/ref_extern
Open

ottoville wants to merge 1 commit into
slowli:mainfrom
ottoville:feature/ref_extern

Conversation

@ottoville

Copy link
Copy Markdown

Fixes #299

Added

  • Support non-null WASM reference types ((ref extern)) on imported and exported
    function arguments and results, including JS string builtins.

Rust types Resource, &Resource and &mut Resource are preprocessed into (ref extern) (new type introduced by this PR)
Rust types Option<Resource>, Option<&Resource> and Option<&mut Resource> are preprocessed into (ref null extern) (aka. externref, current behavior)

Changed

  • Breaking: Derive WASM nullability from Rust types. Resource, ResourceCopy and
    their references now use (ref extern); Option forms use (ref null extern).

Fixed

  • Handle optional mutable resource references in generated import wrappers.
  • Recognize debug import guards after argument spills in the stack prologue.

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.

Non nullable externref are not supported

1 participant