Oilpan: Vector::reserveCapacity shouldn't reallocate backing storage always

In the current implementation, when Vector::reserveCapacity expands its backing storage,
we always reallocate the backing storage (i.e., allocate a new storage -> memmove the storage
-> deallocate the old storage).

In this CL, we reallocate the backing storage only when necessary. If we can expand the tail
of the backing storage to the new capacity, we just expand the storage instead of reallocating
the storage.

This optimization works well for the following code:

  HeapVector<X> vec;
  for (...) {
    X* x = new X();  // Note that X is allocated in a different heap than the collection backing heap.
    vec.append(x);  // If this calls Vector::reserveCapacity, we can expand the backing storage without reallocation.
  }

but doesn't work for the following code:

  HeapVector<X> vec;
  HeapVector<X> vec2;
  for (...) {
    X* x = new X();
    X* x2 = new X();
    vec.append(x);  // If this calls Vector::reserveCapacity, we have to reallocate the storage.
    vec2.append(x2);  // If this calls Vector::reserveCapacity, we have to reallocate the storage.
  }

This significantly improves a lot of benchmarks:

parser.query-selector-*: 20 - 50%
parser.html-parser: 5%
parser.xml-parser: 11%
shadow_dom.ShadowReprojection: 6%


BUG=420515

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

git-svn-id: svn://svn.chromium.org/blink/trunk@185350 bbb929c8-8fbe-4397-9dbb-9b2b20218538