Compress the Dex register maps built by the optimizing compiler.

- Replace the current list-based (fixed-size) Dex register
  encoding in stack maps emitted by the optimizing compiler
  with another list-based variable-size Dex register
  encoding compressing short locations on 1 byte (3 bits for
  the location kind, 5 bits for the value); other (large)
  values remain encoded on 5 bytes.
- In addition, use slot offsets instead of byte offsets to
  encode the location of Dex registers placed in stack
  slots at small offsets, as it enables more values to use
  the short (1-byte wide) encoding instead of the large
  (5-byte wide) one.
- Rename art::DexRegisterMap::LocationKind as
  art::DexRegisterLocation::Kind, turn it into a
  strongly-typed enum based on a uint8_t, and extend it to
  support new kinds (kInStackLargeOffset and
  kConstantLargeValue).
- Move art::DexRegisterEntry from
  compiler/optimizing/stack_map_stream.h to
  runtime/stack_map.h and rename it as
  art::DexRegisterLocation.
- Adjust art::StackMapStream,
  art::CodeGenerator::RecordPcInfo,
  art::CheckReferenceMapVisitor::CheckOptimizedMethod,
  art::StackVisitor::GetVRegFromOptimizedCode, and
  art::StackVisitor::SetVRegFromOptimizedCode.
- Implement unaligned memory accesses in art::MemoryRegion.
- Use them to manipulate data in Dex register maps.
- Adjust oatdump to support the new Dex register encoding.
- Update compiler/optimizing/stack_map_test.cc.

Change-Id: Icefaa2e2b36b3c80bb1b882fe7ea2f77ba85c505
11 files changed