Bug 247396 - [WASM-Function-References] Add support for local initialization tracking
Summary: [WASM-Function-References] Add support for local initialization tracking
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 247393
  Show dependency treegraph
 
Reported: 2022-11-02 17:28 PDT by Asumu Takikawa
Modified: 2023-08-25 17:54 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Asumu Takikawa 2022-11-02 17:28:18 PDT
The typed function references proposal introduces non-defaultable types such as `(ref $t)`. References that inhabit those types must be initialized, and can't be used in an uninitialized state (like null).

As a result, it's necessary to track local initialization state somehow so that `local.get` can be disallowed on uninitialized references, and have a defined result on initialized locals.

The issue tracking the spec algorithm: https://github.com/WebAssembly/function-references/pull/63

The chosen algorithm for this is "1a" from here: https://github.com/WebAssembly/function-references/issues/44#issuecomment-1136373660 (initialization state is reset after each block)
Comment 1 Radar WebKit Bug Importer 2022-11-09 16:29:17 PST
<rdar://problem/102166692>
Comment 2 Asumu Takikawa 2023-08-15 11:37:29 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16713
Comment 3 EWS 2023-08-25 17:54:22 PDT
Committed 267309@main (83c1c1073f0f): <https://commits.webkit.org/267309@main>

Reviewed commits have been landed. Closing PR #16713 and removing active labels.