Closed Bug 1014258 Opened 10 years ago Closed 10 years ago

JSEventHandler CanSkip isn't called usefully

Categories

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

29 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla32
Tracking Status
firefox31 --- verified
firefox32 --- verified

People

(Reporter: smaug, Assigned: smaug)

References

Details

(Keywords: regression)

Attachments

(1 file)

Attached patch patchSplinter Review
Because JSEventHandler isn't a JSHolder anymore, it's CanSkip isn't called always, which
means it doesn't end up calling mTarget->CanSkip.
This leads to large unoptimized-out areas in the CC graphs.
Test case is to load
http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute 

When marking JS areas black we should propagate blackness to C++ using CanSkip calls, but
that is perhaps a bit tricky to implement. So, for now, fix this regression.

https://tbpl.mozilla.org/?tree=Try&rev=9316901e19c1
Attachment #8426567 - Flags: review?(continuation)
Comment on attachment 8426567 [details] [diff] [review]
patch

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

::: dom/events/JSEventHandler.cpp
@@ +35,5 @@
>    , mTypedHandler(aTypedHandler)
>  {
>    nsCOMPtr<nsISupports> base = do_QueryInterface(aTarget);
>    mTarget = base.get();
> +  // Note, we call HoldJSObjects to get CanSkip called before CC.

nit: "Note:" rather than "Note," maybe?
Attachment #8426567 - Flags: review?(continuation) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/da6db31fc9c4

Nah, ',' it is. ':' is stronger, and it doesn't need to be.
(And I so use Finnish rules for punctuation marks.)
Blocks: 986304
Comment on attachment 8426567 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 986304
User impact if declined: possibly higher cycle collection times
Testing completed (on m-c, etc.): just landed to m-i
Risk to taking this patch (and alternatives if risky): not risky 
String or IDL/UUID changes made by this patch: NA
Attachment #8426567 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/da6db31fc9c4
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Attachment #8426567 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(In reply to Olli Pettay [:smaug] from comment #0)
> Test case is to load
> http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-
> controls-and-forms.html#autofilling-form-controls:-the-autocomplete-
> attribute 

To verify this is fixed, what am I looking for on this page?
Need to check cycle collector graph.
One way is to install the addon attached to https://bugzilla.mozilla.org/show_bug.cgi?id=726346, 
restart browser, load that whatwg page in one tab and then about:cc in another one.
Run cycle collector and ensure the graph is not huge (<10000 objects).

But I guess I could verify this.
Flags: in-testsuite?
Flags: in-testsuite? → in-testsuite-
Flags: in-qa-testsuite?
Keywords: verifyme
Flags: in-qa-testsuite? → in-qa-testsuite?(hskupin)
The scenario for testing as pointed out in comment 7 sounds complex, and the code impact seems to be small here. Given the amount of other important test cases we have to add, I don't think we should do more as the manual verification here. Olli, what do you think?
Flags: in-qa-testsuite?(hskupin) → in-qa-testsuite-
Keywords: regression
Yeah, no need manual verification here (I've tested this).
(But I and mccr8 should figure out how to make sure we don't regress CC optimizations - some kind
 of test which analyzes non-allTraces CC logs after running testcases.)
So this will be a test you will/can take care of, right? Is there a framework, which can be used for that? Or is there really nothing appropriate for an in-tree test?
There isn't really any framework. We have leak testing which checks if CC graph has Window objects, but
we need some new framework where one can easily check existence of any type of object in CC graph.
So maybe filing such a bug and marking possible bugs with test requests (like this one) as dependent on it? Otherwise we may loose possible tests.
(In reply to Olli Pettay [:smaug] from comment #9)
> Yeah, no need manual verification here (I've tested this).

Olli, did you verify this in both Firefox 31 and Firefox 32? If so we can mark this as Verified.
Flags: needinfo?(bugs)
I actually didn't verify this on 31.
Let me do that now.
Flags: needinfo?(bugs)
I see now similar behavior on 31 and trunk.
Thanks for your help, Olli.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: