Add more information for different concepts in JS_FOR_EACH_TRACEKIND
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: allstars.chh, Assigned: allstars.chh)
References
Details
Attachments
(2 files)
see https://bugzilla.mozilla.org/show_bug.cgi?id=1510607#c15
https://bugzilla.mozilla.org/show_bug.cgi?id=1510607#c16
In bug 1510607 we found that we are conflating too many concepts into one category, and this caused some regression.
So I file this as a separate bug to isolate the data stored in JS_FOR_EACH_TRACEKIND into different categories
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Hi mccr8
I'd like to ask do TraceKind::BaseShape and TraceKind::JitCode participate in CC?
CC reads this information in IsCCTraceKind (used to called AddToCCKind, as I changed the naming in bug 1478533)
but BaseShape and JitCode are not listed in this function.
And the comment in nsCycleCollector says CC will look at gray objects
https://searchfox.org/mozilla-central/source/xpcom/base/nsCycleCollector.cpp#93
and according to the table in JS_FOR_EACH_TRACEKIND, these two TraceKinds(BaseShape and JitCode) can be marked gray.
https://searchfox.org/mozilla-central/source/js/public/TraceKind.h#104
so does this mean CC will watch these two?
Thanks
Comment 2•5 years ago
|
||
I'm not sure what is going on with JitCode, but for shapes, they need to be marked grey by the GC, because the CC wants to trace through them, but the CC does not represent shapes in the CC graph. Instead, the outgoing edges from a shape will be attributed to any JS objects that hold onto that shape.
Comment 3•5 years ago
|
||
Oh, that's right, GC things can be in one of 3 different categories:
- never part of a gray cycle, so don't need to participate at all in gray marking
- can be part of a gray cycle, but not represented in CC graph
- can be part of a gray cycle, represented by a node in the CC graph
For case (2), it's as mccr8 described: if you have the GC graph A -> B1 -> B2 -> B3 -> C, and all of the B nodes fall within case 2, then the CC graph will look like CC(A) -> CC(C).
It could be represented as 2 booleans, or a 3-way enumeration.
Assignee | ||
Comment 4•5 years ago
|
||
TypeParticipatesInCC is confusing, as this function is used to tell if a
TraceKind can be marked gray.
Assignee | ||
Comment 5•5 years ago
|
||
Pushed by allstars.chh@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c2659af33baf Part 1: rename to TraceKindCanBeGray. r=jonco https://hg.mozilla.org/integration/mozilla-inbound/rev/6741a996b17d Part 2: implement isCCTraceKind with JS_FOR_EACH_TRACEKIND. r=jonco
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c2659af33baf
https://hg.mozilla.org/mozilla-central/rev/6741a996b17d
Description
•