Make CSSStyleDeclaration's wrapper use nursery heap and make last Release call ClearComputedStyle();

RESOLVED FIXED in Firefox 62

Status

()

defect
RESOLVED FIXED
Last year
Last year

People

(Reporter: smaug, Assigned: smaug)

Tracking

(Blocks 1 bug)

unspecified
mozilla62
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox62 fixed)

Details

Attachments

(2 attachments)

No description provided.
Assignee: nobody → bugs
Make the wrapper nursery allocated, use faster mainthread-only refcounting (this way cycle collector uses main-thread only purple buffer nursery), call ClearComputedStyle() sooner.

remote: View the pushlog for these changes here:
remote:   https://hg.mozilla.org/try/pushloghtml?changeset=34c3f38fb67e6fdcd817203f7bf87deb7083e67c
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=34c3f38fb67e6fdcd817203f7bf87deb7083e67c
remote: recorded changegroup in replication log in 0.115s
Attachment #8986731 - Flags: review?(emilio)
Comment on attachment 8986731 [details] [diff] [review]
shortliving_cssstyledeclaration.diff

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

::: dom/webidl/CSSStyleDeclaration.webidl
@@ +8,5 @@
>   */
>  
> + // Because of getComputedStyle, many CSSStyleDeclaration objects can be
> + // short-living.
> +[ProbablyShortLivingWrapper]

Disclaimer: I'm not totally familiar with all of the implications of this. I guess it makes sense for getComputedStyle, but not sure how much would this slow down or impact element.style / cssrule.style / etc.

I guess that if node lists have this it may make sense for this to have it as well.

::: layout/style/nsComputedDOMStyle.cpp
@@ +375,5 @@
>  NS_INTERFACE_MAP_END_INHERITING(nsDOMCSSDeclaration)
>  
>  
> +NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_ADDREF(nsComputedDOMStyle)
> +NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(

Maybe change the destructor to assert !mResolvedComputedStyle instead of calling ClearComputedStyle(), with a comment pointing here?
Attachment #8986731 - Flags: review?(emilio) → review+
Posted patch + assertionSplinter Review
Still compiling (a debug build) to see if it could fire. I can't see any reason why it would.
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/412d61652806
Make CSSStyleDeclaration's wrapper use nursery heap and make last Release call ClearComputedStyle(), r=emilio
https://hg.mozilla.org/mozilla-central/rev/412d61652806
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.