libxml2: linearly optimize XPath expressions.

Some XPath expression nodes keep a back pointer to the last/previous
expression node for optimization purposes. Such pointers will result
in repeated work when walking over the expression
tree/graph, peephole optimizing it. Unacceptable amounts of repeated
work as the expression tree becomes deeper.

Avoid by marking the expression nodes during the optimization pass.

R=scottmg
BUG=573768

Committed: https://crrev.com/0b208a502be9d60929be48056dd4213efd998076
Cr-Commit-Position: refs/heads/master@{#369733}

Review URL: https://codereview.chromium.org/1562133002

Cr-Commit-Position: refs/heads/master@{#369966}
2 files changed