Speed up updating inner value of HTMLTextFormControlElements.

Upon setting the inner string value of an element like <textarea/>, we
append a solitary trailing <br> if the new value ends with a line
break character (for layout and content editable purposes.)

Upon replacing that string value with another, check if the shadowed
inner element being updated has such a trailing <br> element and remove
it first, before proceeding with setting the new value. Doing so enables
fast replacement of text nodes rather than invoking the general path of
replacing a set of siblings with a text node.

This is of most benefit with Oilpan enabled, as it reduces the heap
allocations made when handling this update operation. For a deep-loop
microbenchmark like blink_perf.DOM.textarea-dom, a 10% speedup is
observed (linux, windows).

Linux64-chrome numbers on textarea-dom:

- Oilpan enabled:
  + ToT: 14.6 runs/s
  + CL:  16.6 runs/s

- Oilpan disabled:
  + ToT: 16.5 runs/s
  + CL:  16.9 runs/s

R=tkent,haraken,esprehn
BUG=

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

Cr-Commit-Position: refs/heads/master@{#350989}
1 file changed