ART: Add object reclaim support

Add support for the object free callback.

Refactor code in support. Add test.

Bug: 31384923
Test: m test-art-host
Test: m test-art-host-run-test-905-object-free
Test: m ART_USE_READ_BARRIER=true test-art-host-run-test-905-object-free
Change-Id: Icde40ad464c723cfe2f7660c07cd2f79b6dc2032
diff --git a/test/Android.bp b/test/Android.bp
index b2152e8..4457e8a 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -247,6 +247,7 @@
         "902-hello-transformation/transform.cc",
         "903-hello-tagging/tagging.cc",
         "904-object-allocation/tracking.cc",
+        "905-object-free/tracking_free.cc",
     ],
     shared_libs: [
         "libart",
@@ -267,6 +268,7 @@
         "902-hello-transformation/transform.cc",
         "903-hello-tagging/tagging.cc",
         "904-object-allocation/tracking.cc",
+        "905-object-free/tracking_free.cc",
     ],
     shared_libs: [
         "libartd",