Closed Bug 1892721 Opened 1 year ago Closed 6 months ago

Track wasm ref types directly on MIR nodes

Categories

(Core :: JavaScript: WebAssembly, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: bvisness, Assigned: bvisness)

References

(Blocks 3 open bugs)

Details

Attachments

(14 files, 3 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

We can improve the efficiency of wasm casts by tracking types directly in the MIR graph. Doing so would allow us to freely reorder the creation and manipulation of ref values without being constrained by the wasm validation stack as we are today.

Severity: -- → N/A
Priority: -- → P2
Attachment #9397855 - Attachment description: WIP: Bug 1892721: Track wasm ref types directly on MIR nodes. → Bug 1892721: Track wasm ref types directly on MIR nodes. r=rhunt

Depends on D208139

Blocks: 1936339

Comment on attachment 9439807 [details]
Bug 1892721: Make iongraph prettier. r=iain

Revision D230165 was moved to bug 1947314. Setting attachment 9439807 [details] to obsolete.

Attachment #9439807 - Attachment is obsolete: true
Attachment #9397855 - Attachment description: Bug 1892721: Track wasm ref types directly on MIR nodes. r=rhunt → WIP: Bug 1892721: Track wasm ref types directly on MIR nodes. r=rhunt
Blocks: wasm-ref-mir
Blocks: 1949849
Blocks: 1950683
Attachment #9397855 - Attachment description: WIP: Bug 1892721: Track wasm ref types directly on MIR nodes. r=rhunt → Bug 1892721: Track wasm ref types directly on MIR nodes. r=rhunt
Attachment #9468678 - Attachment description: WIP: Bug 1892721: Use ref type from input in cast/test operations → Bug 1892721: Use ref type from input in cast/test operations. r=rhunt

Comment on attachment 9468679 [details]
Bug 1892721: Track ref types on nulls. r=rhunt

Revision D239767 was moved to bug 1950683. Setting attachment 9468679 [details] to obsolete.

Attachment #9468679 - Attachment is obsolete: true

Comment on attachment 9468680 [details]
Bug 1892721: Track ref types on i31.new. r=rhunt

Revision D239768 was moved to bug 1950683. Setting attachment 9468680 [details] to obsolete.

Attachment #9468680 - Attachment is obsolete: true

Comment on attachment 9468681 [details]
Bug 1892721: Track ref types on new structs and arrays. r=rhunt

Revision D239769 was moved to bug 1950683. Setting attachment 9468681 [details] to obsolete.

Attachment #9468681 - Attachment is obsolete: true

Comment on attachment 9468683 [details]
Bug 1892721: Track ref types on phis. r=rhunt

Revision D239770 was moved to bug 1950683. Setting attachment 9468683 [details] to obsolete.

Attachment #9468683 - Attachment is obsolete: true

Comment on attachment 9468684 [details]
Bug 1892721: Track ref types on wasm parameters. r=rhunt

Revision D239771 was moved to bug 1950683. Setting attachment 9468684 [details] to obsolete.

Attachment #9468684 - Attachment is obsolete: true

Comment on attachment 9468685 [details]
Bug 1892721: Track ref types on any <-> extern conversions. r=rhunt

Revision D239772 was moved to bug 1950683. Setting attachment 9468685 [details] to obsolete.

Attachment #9468685 - Attachment is obsolete: true

Comment on attachment 9468686 [details]
WIP: Bug 1892721: Convert MWasmTrapIfNull to MWasmRefAsNonNull

Revision D239773 was moved to bug 1949849. Setting attachment 9468686 [details] to obsolete.

Attachment #9468686 - Attachment is obsolete: true
See Also: → 1889317
Blocks: 1951158
Attachment #9468679 - Attachment is obsolete: false
Attachment #9468680 - Attachment is obsolete: false
Attachment #9468681 - Attachment is obsolete: false
Attachment #9468683 - Attachment is obsolete: false
Attachment #9468684 - Attachment is obsolete: false
Attachment #9468685 - Attachment is obsolete: false
Duplicate of this bug: 1950683

Comment on attachment 9468678 [details]
Bug 1892721: Use ref type from input in cast/test operations. r=rhunt

Revision D239766 was moved to bug 1951158. Setting attachment 9468678 [details] to obsolete.

Attachment #9468678 - Attachment is obsolete: true
Attachment #9468683 - Attachment description: WIP: Bug 1892721: Track ref types on phis → Bug 1892721: Track ref types on phis. r=rhunt
Attachment #9468679 - Attachment description: WIP: Bug 1892721: Track ref types on ref.null → Bug 1892721: Track ref types on ref.null. r=rhunt
Attachment #9468680 - Attachment description: WIP: Bug 1892721: Track ref types on i31.new → Bug 1892721: Track ref types on i31.new. r=rhunt
Attachment #9468681 - Attachment description: WIP: Bug 1892721: Track ref types on new structs and arrays → Bug 1892721: Track ref types on new structs and arrays. r=rhunt
Attachment #9468684 - Attachment description: WIP: Bug 1892721: Track ref types on wasm parameters → Bug 1892721: Track ref types on wasm parameters. r=rhunt
Attachment #9468685 - Attachment description: WIP: Bug 1892721: Track ref types on any <-> extern conversions → Bug 1892721: Track ref types on any <-> extern conversions. r=rhunt
Attachment #9468679 - Attachment description: Bug 1892721: Track ref types on ref.null. r=rhunt → Bug 1892721: Track ref types on nulls. r=rhunt

Depends on D240393

Depends on D240394

This adds debug-only checks to ensure that any MIR node that declares a
wasm ref type actually produces values matching that type. This
essentially performs a ref.cast after each operation.

Because the types in StaticTypeDefs.h were not actually added to the
type contexts for builtin modules, they would not work in cases where,
for example, we try to look up a type's index.

Also adds a simple foldsTo if the condition is constant. (I'm surprised
we didn't have this in place already.)

Pushed by bvisness@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1ce87c043c9e Track wasm ref types directly on MIR nodes. r=rhunt https://hg.mozilla.org/integration/autoland/rev/150e1c8e4b35 Add debug result checks for wasm ref types. r=rhunt https://hg.mozilla.org/integration/autoland/rev/e82e5ecbaf2e Add static type defs to builtin type contexts. r=rhunt https://hg.mozilla.org/integration/autoland/rev/e3c914c3f41c Track ref types on phis. r=rhunt https://hg.mozilla.org/integration/autoland/rev/ee1c3b9b7532 Track ref types on nulls. r=rhunt https://hg.mozilla.org/integration/autoland/rev/d86ec5a73d86 Track ref types on i31.new. r=rhunt https://hg.mozilla.org/integration/autoland/rev/cbeee30d81cd Track ref types on new structs and arrays. r=rhunt https://hg.mozilla.org/integration/autoland/rev/29ed6f86d0c9 Track ref types on wasm parameters. r=rhunt https://hg.mozilla.org/integration/autoland/rev/2eeecc8ebd44 Track ref types on any <-> extern conversions. r=rhunt https://hg.mozilla.org/integration/autoland/rev/1674ea62221f Track ref types on field/element loads. r=rhunt https://hg.mozilla.org/integration/autoland/rev/8968c113bd92 Track ref types on some MWasmRegisterResults. r=rhunt https://hg.mozilla.org/integration/autoland/rev/6d5115798ab7 Track ref types on table elems. r=rhunt https://hg.mozilla.org/integration/autoland/rev/483f296a7cf7 Track ref types on global.get. r=rhunt https://hg.mozilla.org/integration/autoland/rev/b904665b1626 Track ref types on select. r=rhunt
Regressions: 1959720
QA Whiteboard: [qa-triage-done-c140/b139]
Blocks: 1990314
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: