Bug 98829

Summary: Minimize the recent template explosion in SelectorChecker.
Product: WebKit Reporter: Dimitri Glazkov (Google) <dglazkov>
Component: New BugsAssignee: Dimitri Glazkov (Google) <dglazkov>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, eric, koivisto, macpherson, menard, shinyak, webcomponents-bugzilla, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP
none
Patch
none
Patch for landing none

Dimitri Glazkov (Google)
Reported 2012-10-09 15:45:30 PDT
Minimize the recent template explosion in SelectorChecker.
Attachments
WIP (18.56 KB, patch)
2012-10-09 15:49 PDT, Dimitri Glazkov (Google)
no flags
Patch (19.00 KB, patch)
2012-10-10 11:38 PDT, Dimitri Glazkov (Google)
no flags
Patch for landing (19.01 KB, patch)
2012-10-10 19:21 PDT, Dimitri Glazkov (Google)
no flags
Dimitri Glazkov (Google)
Comment 1 2012-10-09 15:49:49 PDT
Dimitri Glazkov (Google)
Comment 2 2012-10-10 11:38:09 PDT
Antti Koivisto
Comment 3 2012-10-10 12:15:57 PDT
Comment on attachment 168048 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168048&action=review > Source/WebCore/css/SelectorChecker.h:100 > - template<typename CheckingContext> > - SelectorMatch checkSelector(const CheckingContext&, PseudoId&, bool& hasUnknownPseudoElements) const; > - template<typename CheckingContext> > - bool checkOneSelector(const CheckingContext&) const; > + SelectorMatch checkSelector(const SelectorCheckingContext&, PseudoId&, bool& hasUnknownPseudoElements) const; > + template<typename SiblingTraversalStrategy> > + bool checkOneSelector(const SelectorCheckingContext&, const SiblingTraversalStrategy&) const; Since only checkOneSelector is now templated I suppose you expect to be calling it directly with a different strategy? You are now calling SiblingTraversalStrategy with object that contains no data. Why? Do you expect that some other strategy will need data? Are you sure the object and this pointer gets optimized away?
Dimitri Glazkov (Google)
Comment 4 2012-10-10 16:00:23 PDT
(In reply to comment #3) > (From update of attachment 168048 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=168048&action=review > > > Source/WebCore/css/SelectorChecker.h:100 > > - template<typename CheckingContext> > > - SelectorMatch checkSelector(const CheckingContext&, PseudoId&, bool& hasUnknownPseudoElements) const; > > - template<typename CheckingContext> > > - bool checkOneSelector(const CheckingContext&) const; > > + SelectorMatch checkSelector(const SelectorCheckingContext&, PseudoId&, bool& hasUnknownPseudoElements) const; > > + template<typename SiblingTraversalStrategy> > > + bool checkOneSelector(const SelectorCheckingContext&, const SiblingTraversalStrategy&) const; > > Since only checkOneSelector is now templated I suppose you expect to be calling it directly with a different strategy? Right. Here's a larger context of this patch: https://bugs.webkit.org/attachment.cgi?id=167976&action=review > > You are now calling SiblingTraversalStrategy with object that contains no data. Why? Do you expect that some other strategy will need data? Yes, the ShadowDOMSiblingTraversalStrategy will contain a list of nodes that are considered siblings in that context. > Are you sure the object and this pointer gets optimized away? I spent a bit of time trying to discern this in assembly, but my disas-foo is weak :-\ I couldn't see much difference between the callsites. The PerformanceTests/CSS/PseudoClassSelectors.html shows no difference in performance.
Antti Koivisto
Comment 5 2012-10-10 16:11:00 PDT
Comment on attachment 168048 [details] Patch Ok, r=me
WebKit Review Bot
Comment 6 2012-10-10 18:26:50 PDT
Comment on attachment 168048 [details] Patch Rejecting attachment 168048 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1 ERROR: /mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive). Full output: http://queues.webkit.org/results/14248724
Dimitri Glazkov (Google)
Comment 7 2012-10-10 19:21:02 PDT
Created attachment 168127 [details] Patch for landing
WebKit Review Bot
Comment 8 2012-10-10 20:07:29 PDT
Comment on attachment 168127 [details] Patch for landing Clearing flags on attachment: 168127 Committed r131002: <http://trac.webkit.org/changeset/131002>
WebKit Review Bot
Comment 9 2012-10-10 20:07:33 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.