Remove AutoSetHelperThreadContext from GCParallelTask
Categories
(Core :: JavaScript: GC, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: jandem, Assigned: jonco)
References
Details
Attachments
(6 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 |
Longer-term we'd like to get rid of helper thread JSContexts. The two cases where we still rely on them are GCParallelTask and ParseTask. The ParseTask use will be easier to address after Stencil. For GCParallelTask maybe we could add a GCThreadContext
TLS class that stores the thread-specific bits we care about and then remove AutoSetHelperThreadContext.
Reporter | ||
Comment 1•5 years ago
|
||
I suspect this would be a nice refactoring because it will make it explicit what state is used by off-thread tasks. For example, poking at this a bit, I noticed helper threads currently use AutoDisableProxyCheck
but the JSContext
flag we set there is only checked on the main thread so this could stay on JSContext/JSRuntime
.
Assignee | ||
Comment 2•5 years ago
|
||
This sounds good to me.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
The plan is to move the parts of JSContext that are used by helper threads into JSFreeOp, which already functions as a kind of GC context.
Assignee | ||
Comment 4•3 years ago
|
||
This replaces such uses with an RAII class where necessary.
Assignee | ||
Comment 5•3 years ago
|
||
This uses the context's default free op for background sweeping so there is now
only one free op per thread. This makes all free ops 'default' ones so this
flag is removed. All free ops now have a runtime so maybeOnHelperThread() is
also removed.
Depends on D140188
Assignee | ||
Comment 6•3 years ago
|
||
JSFreeOp is defined in gc/FreeOp.h so moves its method implementations under gc/ as well.
Depends on D140189
Assignee | ||
Comment 7•3 years ago
|
||
This is only used in one place and it's simpler to check the tracer kind there.
Depends on D140190
Assignee | ||
Comment 8•3 years ago
|
||
Depends on D140191
Assignee | ||
Comment 9•3 years ago
|
||
This patch moves the debug-only GC state from JSContext to JSFreeOp. Support
functions for this move to FreeOp.h and most RAII classes move to GCInternals.h.
The default free op member is removed from JSContext. A free op for the main
thread is added to GCRuntime, and the helper thread system creates a vector of
free ops that can be used by tasks. GCParallelTask takes one of these and sets
it in TLS when running a task.
Use of JSContext by GC helper threads is replaced by JSFreeOp.
Depends on D140192
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Backed out for causing SM bustages.
Backout link: https://hg.mozilla.org/integration/autoland/rev/0350ac4b305a14b0ece1100fd82f7cb97d707d3e
Failure log: https://treeherder.mozilla.org/logviewer?job_id=369843618&repo=autoland&lineNumber=14190
https://treeherder.mozilla.org/logviewer?job_id=369846554&repo=autoland&lineNumber=5908
https://treeherder.mozilla.org/logviewer?job_id=369846934&repo=autoland&lineNumber=45318
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3c2076b122e0
https://hg.mozilla.org/mozilla-central/rev/a6b5cbbdd54b
https://hg.mozilla.org/mozilla-central/rev/8611c3ef5a77
https://hg.mozilla.org/mozilla-central/rev/f78d139e1d0e
https://hg.mozilla.org/mozilla-central/rev/410d1b57bb09
https://hg.mozilla.org/mozilla-central/rev/28829816a629
Assignee | ||
Updated•10 months ago
|
Description
•