Offthread Baseline: initial implementation
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox136 | --- | fixed |
People
(Reporter: iain, Assigned: iain)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(13 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 |
I have a mostly working version of offthread baseline compilation. This bug is for landing that, disabled by default. In subsequent bugs, I'll work on improving the performance enough to turn it on.
| Assignee | ||
Comment 1•11 months ago
|
||
| Assignee | ||
Comment 2•11 months ago
|
||
This will no longer be Warp-specific.
| Assignee | ||
Comment 3•11 months ago
|
||
I tried to isolate most of the mechanical boilerplate into its own patch. This is based on IonCompileTask.
| Assignee | ||
Comment 4•11 months ago
|
||
This is no longer Ion-specific.
| Assignee | ||
Comment 5•11 months ago
|
||
This performs the actual off-thread compilation. Making the result available on the main thread comes later.
| Assignee | ||
Comment 6•11 months ago
|
||
| Assignee | ||
Comment 7•11 months ago
|
||
| Assignee | ||
Comment 8•11 months ago
|
||
| Assignee | ||
Comment 9•11 months ago
|
||
| Assignee | ||
Comment 10•11 months ago
|
||
| Assignee | ||
Comment 11•11 months ago
|
||
In latin1/date.js, test() has actually been broken in Ion since bug 1784023 added support for removing unused calls to indexOf. If lat1 + '\u1200' does not fit in an inline string, then we will create a rope. If indexOf is optimized away, then substr on the unflattened rope will only look at the right child, and will return a latin1 string, triggering the assertion. For reasons that aren't entirely clear to me, running the test with --baseline-offthread-compile=on --ion-offthread-compile=off exposed the bug by getting us into Ion at the right time.
recoverObjects.js expects us to always inline particular callees. If offthread baseline compilation takes long enough, then we may have already exceeded the trial inlining warmup threshold by the time we finish the baseline compile, meaning that we won't do any inlining. In the long run it would be good to fix this by guaranteeing that we don't skip inlining. That's somewhat tricky, though. I considered triggering trial inlining while finishing a compilation on the main thread in cases where the warmup counter had already exceeded the threshold, but we do trial inlining per ICScript, not per JSScript, so that doesn't work for recursive inlining.
| Assignee | ||
Comment 12•11 months ago
|
||
BaselineCompiler::emitDebugTrap uses the Debug API to find breakpoints. It can't be accessed from the main thread.
We could include a list of breakpoints in the snapshot, but baseline compilation performance is not that important when debugging.
| Assignee | ||
Comment 13•11 months ago
|
||
TSAN doesn't like it when we access mutable script flags offthread.
Comment 14•10 months ago
|
||
Comment 15•10 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/26673c9ed156
https://hg.mozilla.org/mozilla-central/rev/ebc7affe24f6
https://hg.mozilla.org/mozilla-central/rev/9c8ba30f7c13
https://hg.mozilla.org/mozilla-central/rev/7a6623672119
https://hg.mozilla.org/mozilla-central/rev/de20bf596703
https://hg.mozilla.org/mozilla-central/rev/60ee7cd1a632
https://hg.mozilla.org/mozilla-central/rev/0160e0fc01a0
https://hg.mozilla.org/mozilla-central/rev/804e4fb521ce
https://hg.mozilla.org/mozilla-central/rev/92f7637737c1
https://hg.mozilla.org/mozilla-central/rev/f4948f1d7709
https://hg.mozilla.org/mozilla-central/rev/195268c19e9b
https://hg.mozilla.org/mozilla-central/rev/229417824fbb
https://hg.mozilla.org/mozilla-central/rev/e11e64eee863
Description
•