Consider removing DoMarking fast path in tracer dispatch
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox106 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(7 external files)
Tracing GC things in SpiderMonkey works via virtual method dispatch, except for a special fast path for marking:
https://searchfox.org/mozilla-central/source/js/src/gc/Marking.cpp#724-727
Removing this would simplify the code and make it easier to follow by making marking just another kind of tracing.
It's possible that this will regress performance. However marking also has special cases for eager marking of non-cyclic GC things and for marking objects and these should end up being used most of the time.
Eventually we should be able to get the compiler to devirtualise these calls, which would mitigate any performance impact.
| Assignee | ||
Comment 1•4 years ago
|
||
To make things clear, this is about removing the DoMarking fast path, not the GCMarker::eagerlyMarkChildren fast path, which will be investigated in a later bug.
| Assignee | ||
Comment 2•4 years ago
|
||
imported patch remove-unused-gc-number-method
| Assignee | ||
Comment 3•4 years ago
|
||
This moves all GC thing trace methods (and optimised GCMarker versions that do
eager marking) to their own header. With later patches this should allow
devirtualisation of the tracer dispatch.
A follow on bug will attempt to remove some of the GCMarker versions.
Depends on D156558
| Assignee | ||
Comment 4•4 years ago
|
||
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.
Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.
Depends on D156559
| Assignee | ||
Comment 5•4 years ago
|
||
Similar to the previous patch, this delegates whether to update the edge to the
implementation of the trace method, so we don't need generic tracing code to
handle that possiblity any more.
Depends on D156560
| Assignee | ||
Comment 6•4 years ago
|
||
This removes the fast path so we use virtual dispatch for all tracers.
Depends on D156561
| Assignee | ||
Comment 7•4 years ago
|
||
All tracers are now GenericTracers so there's no reason for this to be a
separate thing.
Depends on D156562
| Assignee | ||
Comment 8•4 years ago
|
||
For non-tagged pointer types, DoCallback is now simple enough that we can
define this inline in Tracing.h and most TraceEdge methods become a virtual
method call.
Depends on D156563
Comment 10•4 years ago
|
||
Backed outfor causing reftest crashes at @ mozilla::dom::Promise::MaybeReject(nsresult).
Backout link: https://hg.mozilla.org/integration/autoland/rev/fc02f1e9c4843648b6791d4217d124fae5f986d9
Failure log: https://treeherder.mozilla.org/logviewer?job_id=389722922&repo=autoland&lineNumber=52981
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
Relanded because the real issue was from a different bug.
Comment 13•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/1e226dbfe8fa
https://hg.mozilla.org/mozilla-central/rev/6897324c32c5
https://hg.mozilla.org/mozilla-central/rev/88c46af9c2c5
https://hg.mozilla.org/mozilla-central/rev/1fc5ea164fd7
https://hg.mozilla.org/mozilla-central/rev/5aaa5504196b
https://hg.mozilla.org/mozilla-central/rev/2b2a03b16808
https://hg.mozilla.org/mozilla-central/rev/81fd7885f181
Description
•