Use runtime page size for large object alignment

In general, this removes `kLargeObjectAlignment` and replaces it with a
dynamic `LargeObjectSpace::ObjectAlignment()` static method. It avoids
consuming extra memory to align up large object to `kMaxPageSize` (16K),
when the runtime page size is 4K.

However, in order to keep `SpaceBitmap<kAlignment>` optimized, this
keeps the internal bitmap alignment fixed to the minimal page size (4K),
We then accept that if the page size is 16K at runtime, then only 1 bit
out of every 4 bits will actually be in-use.

Assuming a heap capacity of 256M, the size of the bitmap is as follows:

  - 4K:  (256M / 4K)  -> 64K pages -> 8K needed to store one bit per
    page.
  - 16K: (256M / 16K) -> 16K pages -> 2K needed to store one bit per
    page.

As a temporary solution, it's acceptable to consume 8K regardless of the
runtime page size.

In the future, as 16K page sizes becomes more common, we may need to
re-think how large object spaces work, and if it still makes sense to
have the large object alignment tied to the OS page size.

To cover testing, this CL turns the existing space bitmap unit tests
into type-paramaterized tests, based on the SpaceBitmap implementation
and the object alignment they can support:

  | SpaceBitmapType       | SpaceBitmap alignment | Object alignment   |
  |-----------------------+-----------------------+--------------------|
  | ContinuousSpaceBitmap | kObjectAlignment      | kObjectAlignment   |
  | LargeObjectBimap      | kMinPageSize (4K)     | kMinPageSize (4K)  |
  | LargeObjectBimap      | kMinPageSize (4K)     | kMaxPageSize (16K) |

In passing, this also removes the templated version of
MapAnonymousAligned(), as it was only used to allocate large objects,
outside of tests. And highlights that its alignment must be higher than
gPageSize. The image tests are also adapted accordingly.

Test: art/test/testrunner/testrunner.py -b --host
  on host
Test: art/test/testrunner/testrunner.py --target --64 \
        --optimizing --gcverify --gcstress
Test: art/tools/run-gtests.sh -- -j6
Test: art/tools/run-gtests.sh \
        /apex/com.android.art/bin/art/arm64/art_runtime_tests \
        -- --gtest_filter="*SpaceBitmap*"
  on target Pixel6

Author: Pierre Langlois <pierre.langlois@arm.com>
Change-Id: Ib1251c88be1380168e3b5cf9126611e5daef5db1
14 files changed