Attempt to improve the code generated for GC barriers
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
(Keywords: perf-alert)
Attachments
(5 files)
I looked at the code clang generates for GC barriers and it doesn't seem optimal. The read barrier for JS::Value is 1.5KB for example. With some adjustments the source it should be possible to do much better.
Assignee | ||
Comment 1•3 years ago
|
||
We've already asserted that we're not collecting if we're on the main thread in this method.
Assignee | ||
Comment 2•3 years ago
|
||
Currently our Value barriers are all out-of-line. We can at least avoid a call
if the value isn't a GC thing.
Depends on D91308
Assignee | ||
Comment 3•3 years ago
|
||
This moves barrier implementations out of derived cell types, with the types
supplying necessary information to a central implementation (e.g. with the
isPermanentAndMayBeShared() method).
Depends on D91309
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D91310
Assignee | ||
Comment 5•3 years ago
|
||
Constructing a GCCellPtr means getting the trace kind from a lookup table based
on the alloc kind. We can move this out of line so that code's not included in
the barrier.
Depends on D91311
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/737cf10628b2 Part 1: Remove a redundant heap state check r=sfink https://hg.mozilla.org/integration/autoland/rev/4caed033bc07 Part 2: Inline preconditions for Value barriers r=sfink https://hg.mozilla.org/integration/autoland/rev/48cec06d1360 Part 3: Move barrier implementations out of derived cell tyes into standalone functions r=sfink https://hg.mozilla.org/integration/autoland/rev/be4870668a89 Part 4: Remove use of ApplyGCThingTyped from Value barriers as this doesn't generate good code r=sfink https://hg.mozilla.org/integration/autoland/rev/1258696a62ee Part 5: Add a simpler gray unmarking interface that's easier to call from our read barrier r=sfink
Comment 7•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/737cf10628b2
https://hg.mozilla.org/mozilla-central/rev/4caed033bc07
https://hg.mozilla.org/mozilla-central/rev/48cec06d1360
https://hg.mozilla.org/mozilla-central/rev/be4870668a89
https://hg.mozilla.org/mozilla-central/rev/1258696a62ee
Assignee | ||
Comment 8•3 years ago
|
||
This resulted in the following improvement:
== Change summary for alert #27079 (as of Mon, 28 Sep 2020 14:25:28 GMT) ==
Improvements:
8% six-speed-sm linux64-shippable opt 10,201.75 -> 9,403.75
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=27079
Updated•3 years ago
|
Description
•