[Webkit-unassigned] [Bug 132319] CSS JIT: optimize direct / indirect adjacent's traversal backtracking

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 30 05:11:32 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=132319





--- Comment #3 from Yusuke Suzuki <utatane.tea at gmail.com>  2014-04-30 05:11:52 PST ---
(From update of attachment 230473)
View in context: https://bugs.webkit.org/attachment.cgi?id=230473&action=review

Added comments to the patch.

> Source/WebCore/cssjit/SelectorCompiler.cpp:68
> +    JumpToDirectAdjacentTail

Drop JumpToClearAdjacentTail since there's no need to decrease stack height.

> Source/WebCore/cssjit/SelectorCompiler.cpp:613
> +        return BacktrackingAction::NoBacktracking;

When there's no descendant relation on the right, traversal failure becomes global failure.

> Source/WebCore/cssjit/SelectorCompiler.cpp:615
> +    if (fragment.tagNameMatchedBacktrackingStartHeightFromDescendant == (fragment.heightFromDescendant + 1))

When `tagNameMatchedBacktrackingStartHeightFromDescendant` == `heightFromDescendant` + 1, the descendant backtracking starts with the parent of the current element. So we can use the current element and the backtracking action is JumpToDescendantTreeWalkerEntryPoint.

> Source/WebCore/cssjit/SelectorCompiler.cpp:618
> +    return BacktrackingAction::JumpToDescendantTail;

Otherwise, currently we take the conservative approach, JumpToDescendantTail.
We can optimize it more aggressively, but it will be done in the next patches.

> Source/WebCore/cssjit/SelectorCompiler.cpp:651
> +            fragment.matchingPostTagNameBacktrackingAction = fragment.traversalBacktrackingAction;

When `hasIndirectAdjacentRelationOnTheRightOfDirectAdjacentChain` is false and `hasDescendantRelationOnTheRight` is true, we should backtrack with the closest descendant fragment. So we can take the same action as the traversal action.

> Source/WebCore/cssjit/SelectorCompiler.cpp:657
> +        fragment.traversalBacktrackingAction = solveTraversalBacktrackingAction(fragment, hasDescendantRelationOnTheRight);

In the indirect fragment, we can take the same traversal action in the direct fragment's traversal action.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list