Rewrite ClassLinker::LinkFields().

Rewrite field offset assignment to avoid heap allocations in
most cases. We do one allocation if there are many fields.

Rewrite gap filling to prefer small gaps over big ones. This
creates more natural field ordering. For example,
    class A { byte unalign; }
    class B extends A {
        long l;
	byte a, b, c, d, e, f;
    }
would have previously had offsets
    12, 10, 14, 9, 11, 13, 15
for fields a, b, c, d, e, f, respectively. Now these are
    9, 10, 11, 12, 13, 14, 15
in line with their lexicographical order.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: boots.
Bug: 175869411
Change-Id: I558635ac59c959dd85e8a3b015c26a6d90033853
6 files changed