Implement Ion->wasm inlined calls for BigInt <-> i64 interconversion
Categories
(Core :: JavaScript: WebAssembly, enhancement, P1)
Tracking
()
People
(Reporter: lth, Assigned: asumu)
References
Details
Attachments
(5 files, 1 obsolete file)
When Ion code calls wasm, we can take an especially fast path by inlining the call in MCallOptimize, given that the types are right. For the case where the passed type is known to be BigInt, the BigInt -> int64 range folding can be done with a simple MIR node and then the call can simply load the known-int64 value as part of the call.
Assignee | ||
Comment 1•5 years ago
|
||
This is part 1 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls.
This part implements Ion MIR and LIR instructions that are needed for conversion between BigInts and I64.
Assignee | ||
Comment 2•5 years ago
|
||
This is part 2 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls.
This part adds an I64 return value case for LIonToWasmCall, which is needed in general because an I64
result may require multiple defs for the instruction.
Assignee | ||
Comment 3•5 years ago
|
||
This is part 3 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls.
This part adds changes needed in code generation and Wasm stubs for supporting the I64 arguments for
inlined Ion to Wasm calls.
Assignee | ||
Comment 4•5 years ago
|
||
This is part 4 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls.
This part adds the support for I64/BigInt arguments for inlined calls in the MCallOptimize.cpp part of
the IonBuilder. With this commit, the I64 arguments will work on 64-bit platforms, except where arguments
are required to be spilled to the stack due to the ABI (this case is more complicated to support).
On 32-bit platforms, this commit disables the BigInt/I64 support for the inlined call as it does not work
without further changes.
Assignee | ||
Comment 5•5 years ago
|
||
This is part 5 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls.
This part adds additional Wasm BigInt tests that are aimed specifically to test limits of the inlined calls and
to test more conversion cases that should be covered (e.g., to test ToBigInt instruction cases).
Assignee | ||
Comment 6•5 years ago
|
||
This is part 6 of implementing the Wasm BigInt<>I64 conversion proposal for inlined Ion to Wasm calls.
This part adds support for I64/BigInt arguments for inlined calls on 32-bit platforms. This requires additional
code because I64s are split into two parts on 32-bit platforms, which adds additional work to every part
from the original MIR instruction generation down to Wasm stub code.
Updated•5 years ago
|
Comment 8•5 years ago
|
||
bugherder |
![]() |
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 10•5 years ago
|
||
bugherder |
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
bugherder |
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
bugherder |
Comment 15•5 years ago
|
||
This was backed out on autoland since it started have high failure occurrences in js/src/jit-test/tests/wasm/bigint/bigint.js followed by application crashed [@ js::gc::IsInsideNursery]
https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&searchStr=sm&tochange=5797e768d878d00f2545fd94a88019abf2cd4a68&fromchange=15650b89e468574a18179bfac89aa4b12cecaa6a
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=299768112&repo=autoland&lineNumber=46102
Backout: https://hg.mozilla.org/integration/autoland/rev/c1b1ba2c99b1268ba658158daa200a8c79b1b8e7
Comment 16•5 years ago
|
||
Backout of parts 1->3: https://hg.mozilla.org/integration/autoland/rev/92c42c6fb67dbaa16c2c157fa5c6a29f6ec772e6
Reporter | ||
Comment 17•5 years ago
|
||
I requested a backout of this patch set given the spike in failures when it was finally enabled and given the number of fixes that were requested in bug 1633714. I think that the latter patches should be folded into this patch set, we should re-review (TBD), and we should re-land after the code freeze for FF77 ends, ie in May sometime, but not too late in May. That way, this patch set can still make it into FF78 which is an ESR release.
![]() |
||
Comment 18•5 years ago
|
||
Assignee | ||
Comment 19•5 years ago
|
||
(In reply to Lars T Hansen [:lth] from comment #17)
I requested a backout of this patch set given the spike in failures when it was finally enabled and given the number of fixes that were requested in bug 1633714. I think that the latter patches should be folded into this patch set, we should re-review (TBD), and we should re-land after the code freeze for FF77 ends, ie in May sometime, but not too late in May. That way, this patch set can still make it into FF78 which is an ESR release.
Sorry for these intermittent crashes. I'll see if I can reproduce them locally and produce a test if possible too to go along with the fixes.
Just to make sure I understand, would it be best to squash the patches from bug 1633714 into patches on here, or would it be better to append the patches directly onto the patchset? If the former, I've pulled down the patches from phabricator and have a squashed patch I can upload after testing. Should I wait on some review in bug 1633714 first?
Reporter | ||
Comment 20•5 years ago
|
||
Provided that the patches from the other bug can be folded naturally into the five patches you have here then I think it would be better to squash the patches from the other bug into this one, since many/most of them are adjustments to the patches here. If that's not really practical then we should discuss further what we can do.
You should probably wait for review, but (a) Wingo's done I think and I hope to finish today, or tomorrow at the latest, and (b) anba's work is normally very solid and I don't expect many or even any changes.
Comment 21•5 years ago
|
||
The backout from changeset c1b1ba.... caused the improvements below:
== Change summary for alert #25774 (as of Wed, 29 Apr 2020 17:00:04 GMT) ==
Improvements:
15% raptor-tp6-slides-firefox-cold loadtime linux64-shippable-qr opt 2,793.54 -> 2,371.92
15% raptor-tp6-slides-firefox-cold loadtime windows10-64-shippable-qr opt 2,776.79 -> 2,360.33
12% raptor-tp6-slides-firefox-cold loadtime windows10-64-shippable-qr opt 2,678.21 -> 2,368.00
4% raptor-tp6-slides-firefox-cold linux64-shippable-qr opt 1,393.47 -> 1,331.29
4% raptor-tp6-slides-firefox-cold windows10-64-shippable-qr opt 1,369.00 -> 1,312.34
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=25774
Assignee | ||
Comment 22•5 years ago
|
||
Does this need any additional review before trying to re-land? I have updated some of the diffs to rebase up to recent changes and the patches from bug 1633714 are folded in now. When re-landing I'll also include the test patch from bug 1633740 that will check that the GC nursery issue is fixed.
Reporter | ||
Comment 23•5 years ago
|
||
I guess we can cross our fingers that Andre found the bugs that were findable and just land.
Comment 24•5 years ago
|
||
Comment 25•5 years ago
|
||
bugherder |
Reporter | ||
Comment 27•5 years ago
|
||
Currently blocks the P1 ship bug, so P1. Asumu, what's the status - are we good, and is this bug open only because of leave-open?
Assignee | ||
Comment 28•5 years ago
|
||
Yes, with the already merged patches this should be good. I think it's ok to close.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Description
•