Closed Bug 1728899 Opened 3 years ago Closed 3 years ago

Update Wasm exception handling approach to use TlsData field

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: asumu, Assigned: asumu)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

This bug is for implementing the exception handling strategy described in https://phabricator.services.mozilla.com/D118283#4037101 (adding a pendingExceptionValue field to wasm::TlsData field to store a thrown exception, instead of using an ABI register to communicate it) in the Baseline compiler and the runtime. The Ion implementation (bug 1695778) will depend on this approach.

Assignee: nobody → asumu

As part of transitioning to a TlsData-based approach to
commmunicating Wasm exception values, switch to using the
AnyRef wrapper instead of an exception-specific data
structure.

This commit changes how exception values are communicated
between throws and handlers in Wasm. Instead of using the
WasmExceptionReg ABI register, a pointer in the TlsData
is used instead.

The ABI register is still used to coordinate between the
exception landing pad and the catch block code.

The new approach is used in preparation for the exception
implementation in IonMonkey.

Depends on D124549

I've attached some draft patches that implement this approach. For now I have left them as WIP because I think it could make sense to try rebasing the Ion patches on this first to make sure that the implementation strategy will work out.

Priority: -- → P3
Attachment #9239491 - Attachment description: WIP: Bug 1728899 - Part 1, use AnyRef for Wasm exceptions → Bug 1728899 - Part 1, use AnyRef for Wasm exceptions
Attachment #9239492 - Attachment description: WIP: Bug 1728899 - Part 2, switch to TlsData-based exceptions → Bug 1728899 - Part 2, switch to TlsData-based exceptions

I've set the two patches here to non-WIP and requested review as it looks like the implementation approach to accessing the exception value in these patches is working fine for the Ion patch drafts that are up on Phabricator now.

Instead of using WasmExceptionReg, use the block return protocol
to communicate exception object values between the exception landing
pad and the handler code.

Depends on D126611

Pushed by rhunt@eqrion.net:
https://hg.mozilla.org/integration/autoland/rev/98313f100c70
Part 1, use AnyRef for Wasm exceptions r=rhunt
https://hg.mozilla.org/integration/autoland/rev/83b810657eac
Part 2, switch to TlsData-based exceptions r=rhunt
https://hg.mozilla.org/integration/autoland/rev/1fcb6d8ccf9a
Part 3, use block return protocol for exception r=rhunt
https://hg.mozilla.org/integration/autoland/rev/320172e6d5ec
Part 4, delete WasmExceptionReg r=rhunt
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: