Refactor barriered pointer wrappers to simplify repetitive code
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(8 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 |
gc/Barrier.h provides wrapper classes to add barriers to GC thing pointers. There are several barriers supported (read, pre-write and post-write) we supply a wrapper class for many (most?) of the possible combinations. This results in a lot of repetitive code.
This bug aims to fix that by refactoring most of the implementation into a single class that is parameterized with a bitfield of options and using compile time conditionals to trigger the appropriate barriers.
| Assignee | ||
Comment 1•2 months ago
|
||
This makes the |value| that stores the wrapped pointer in BarrieredBase
private, and provides unbarriered accessors for sublasses to use.
| Assignee | ||
Comment 2•2 months ago
|
||
This removes an optimization for setting two HeapPtrs at the same time. It
skips a GC state check on the zone. It's only used in one place and I'd be
surprised if this made a measurable difference to anything.
| Assignee | ||
Comment 3•2 months ago
|
||
This adds the BarrieredPtrImpl class template which contains logic for all barriers
and conditionally selects which barriers to apply at compile time.
| Assignee | ||
Comment 4•2 months ago
|
||
This ended up adding the gray things check to more paths hence the addition of
AutoTouchingGrayThings in RemapDeadWarpper.
This also made it so that we need to use BarrieredBase rather than
WriteBarriered as the base pointer type in some tracing methods.
| Assignee | ||
Comment 5•2 months ago
|
||
This is now only used for HeapSlot, so we can merge the two.
| Assignee | ||
Comment 6•2 months ago
|
||
This also uses a macro to reduce repetitive code.
| Assignee | ||
Comment 7•2 months ago
|
||
| Assignee | ||
Comment 8•2 months ago
|
||
Comment 10•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/3a9c4fe19229
https://hg.mozilla.org/mozilla-central/rev/9e5969b4e161
https://hg.mozilla.org/mozilla-central/rev/8568c4319af8
https://hg.mozilla.org/mozilla-central/rev/e1fe8c52bfea
https://hg.mozilla.org/mozilla-central/rev/b11039655f6b
https://hg.mozilla.org/mozilla-central/rev/1e42a8bdc545
https://hg.mozilla.org/mozilla-central/rev/3a0930d84a7e
https://hg.mozilla.org/mozilla-central/rev/3618de534588
https://hg.mozilla.org/mozilla-central/rev/cf03e38ca715
Description
•