Fix GarbageCollector to work with VERIFY_OBJECT_ENABLED

There were two problems with the GC:
1.) roots were being missed for most of the C++ fields
2.) Heap::RecordFree(Object) was not being called, only Space::Free

To solve #1, added all C++ shadow fields to libcore.
This involed updating dalvik to cope with the new sizes and offsets.
This had the positive side effect of allowing a lot of special cases
in the object scanning and image writing.

To solve #2, added a call to the now public Heap::RecordFree from MarkSweep

Given the now better working GC:
- Reenabled HeapTest.GarbageCollectClassLinkerInit which is now passing.
- ImageWriter now GC's before writing an image to avoid garbage.

Change-Id: Ie7d1cc89e0bcf314cb37f0cabcb8593bf6e4d4be
11 files changed
tree: 87a5bcfc0fd528e14f34f3e4212718100b58748e
  1. build/
  2. src/
  3. test/
  4. tools/
  5. Android.mk