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
diff --git a/src/heap_test.cc b/src/heap_test.cc
index 53489e4..2a4cbbf 100644
--- a/src/heap_test.cc
+++ b/src/heap_test.cc
@@ -6,7 +6,7 @@
class HeapTest : public CommonTest {};
-TEST_F(HeapTest, DISABLED_GarbageCollectClassLinkerInit) {
+TEST_F(HeapTest, GarbageCollectClassLinkerInit) {
// garbage is created during ClassLinker::Init
Heap::CollectGarbage();
}