nsDocument::mExpandoAndGeneration.expando shows up in the cc graphs

RESOLVED FIXED in Firefox 39

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

36 Branch
mozilla39
x86_64
Linux
Points:
---

Firefox Tracking Flags

(firefox39 fixed)

Details

Attachments

(1 attachment)

Created attachment 8571331 [details] [diff] [review]
wip

In the cases I see it in cc graph expando points to an object with getter/setter and those are Proxies pointing to Location wrapper.

Apparently bug 928336 changes some of the expando handling, so it is not clear to me
what is the lifetime management for mExpandoAndGeneration.expando.
Right now it is traced only if we preserve the wrapper for the document.
I wonder if we could just make it behave more like a normal Heap<JS::Value> -
HoldJSObjects and set the value, and then trace always.
bz, could you explain the lifetime management of nsDocument::mExpandoAndGeneration.expando?
Is it safe to assume that if expando is an object, document -> expando is a strong edge?
Flags: needinfo?(bzbarsky)
> Apparently bug 928336 changes some of the expando handling, so it is not clear to me
> what is the lifetime management for mExpandoAndGeneration.expando.

After bug 928336, its lifetime will be the same as the nsIDocument (and as the nsIDocument's JS wrapper).

> Right now it is traced only if we preserve the wrapper for the document.

After bug 928336 we'll always preserve the wrapper for the document, afaict.

> Is it safe to assume that if expando is an object, document -> expando is a strong
> edge?

I think yes, since the function that creates the expando object preserves the wrapper for the document, which will ensure that expando is traced.
Flags: needinfo?(bzbarsky)
Comment on attachment 8571331 [details] [diff] [review]
wip

Thanks.
Attachment #8571331 - Flags: review?(continuation)
Comment on attachment 8571331 [details] [diff] [review]
wip

Review of attachment 8571331 [details] [diff] [review]:
-----------------------------------------------------------------

Does this need to wait for bug 928336 to land?

I guess doing the opposite direction, eg marking the document live when the expando object is black, is not going to be super useful. I'd expect the wrapper would be black in that case anyways.
Attachment #8571331 - Flags: review?(continuation) → review+
> Does this need to wait for bug 928336 to land?

I don't think so.  Bug 928336 changes nothing about the lifetimes here; those were already changed in bug 1133760.
Assignee: nobody → bugs
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd849bbe77da
https://hg.mozilla.org/mozilla-central/rev/bd849bbe77da
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox39: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.