Improve codegen for wasm subtype checks
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox139 | --- | fixed |
People
(Reporter: rhunt, Assigned: bvisness)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files, 2 obsolete files)
When we cast, we generate a testing node which is branched on at the MIR level. The failure case for the cast goes to a basic block with a single wasm trap node. We should find a way to ensure that block gets moved away from all other code in the function. Essentially move it 'out of line'.
| Reporter | ||
Comment 1•1 year ago
|
||
Tweak the masm so that the final conditional branch in a cast goes
to the caller specified 'label' instead of the 'cast success' branch.
This lets us eliminate a jump instruction in the case that we're
trying to branch OOL on cast failure.
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
Besides the improvements Ryan mentioned above, we can also improve codegen in our masm routines to avoid unnecessary jumps.
| Assignee | ||
Comment 3•1 year ago
|
||
| Assignee | ||
Comment 4•1 year ago
|
||
Cleans up codegen for wasm subtype checks to avoid unnecessary short
jumps and to branch directly to the destination on the most common
paths.
Depends on D239958
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 5•1 year ago
|
||
This bug ended up with two chunks of work that have turned out to be independent: moving the trap from bug 1949849's MWasmRefCast out of line, and tweaking the masm for the subtype checks to avoid unnecessary jumps. The former seems to be better done in bug 1949849 (and currently resides there anyway), and the latter can be done at any time. Therefore I'm shuffling the dependencies so we can land this tiny tweak more quickly.
| Assignee | ||
Comment 6•1 year ago
|
||
Comment 8•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/01ba02821657
https://hg.mozilla.org/mozilla-central/rev/d36f5081af48
Updated•1 year ago
|
Description
•