Closed Bug 1138395 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

36 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: smaug, Assigned: smaug)

Details

Attachments

(1 file)

Attached patch wipSplinter Review
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/mozilla-central/rev/bd849bbe77da
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.