Unify Wasm and JIT exception handlers more
Categories
(Core :: JavaScript: WebAssembly, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox130 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(3 files)
When unwinding for an exception, we currently return to trampoline code whenever we have a JS JIT <=> Wasm boundary and then re-enter the other side's exception handler code. We can restructure this a bit to support unwinding these frames directly.
We can also share more code between GenerateThrowStub and the JIT exception handler trampoline.
| Assignee | ||
Comment 1•1 year ago
|
||
This also lets us remove a branch (on FailInstanceReg) on the JIT => Wasm call path.
| Assignee | ||
Comment 2•1 year ago
|
||
The next patch will use this to jump here from the Wasm throw stub.
| Assignee | ||
Comment 3•1 year ago
|
||
If there's no JS or Wasm catch handler on the stack, this patch lets us unwind
all the way to the entry frame in all cases, instead of resuming to the JIT entry
stub and then calling the JS JIT exception handler again.
This means we now have to handle all ResumeFromException::Kind values in
GenerateThrowStub. This patch supports that by jumping to the JS JIT exception
handler trampoline code after calling WasmHandleThrow. This should also shrink
the size of the Wasm throw stub.
| Assignee | ||
Comment 4•1 year ago
|
||
Because we now unwind JS JIT frames after unwinding Wasm frames, we no longer
return to the JIT => Wasm entry code from the exception handler.
To make this a bit clearer, the patch renames FailInstanceReg to InterpFailInstanceReg
and ExceptionResumeKind::Wasm to ExceptionResumeKind::WasmInterpEntry.
Comment 6•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d8768f163b46
https://hg.mozilla.org/mozilla-central/rev/6eb32b942a04
https://hg.mozilla.org/mozilla-central/rev/364d4e24bc13
Description
•