Add dexanalyze tool

Used to gather statistics about dex files.

Sample output:
Cumulative analysis for 240 DEX files
Num string ids: 9809636
Num method ids: 11334990
Num field ids: 8281881
Num type ids: 2291729
Num class defs: 1604550
Same class direct: 1577080
Other class direct: 5114002
Same class virtual: 2118445
Other class virtual: 15998142
Same class static: 693507
Other class static: 6496367
Num strings accessed from code: 5832974
Unique(per class) method ids accessed from code: 15169103
Unique(per class) string ids accessed from code: 4279695
Same class invoke: 4389032
Other class invoke: 27608511
Invokes from code: 31997543

Bug: 77709234
Bug: 77721545
Test: time dexanalyze -count-indices <APKS>
Test: mm test-art-host-gtest-dexanalyze_test -j64
Test: mm test-art-target-gtest-dexanalyze_test -j64

Change-Id: I3cd3fd10a9c540c7780942fc33f4eb4c7ff5d914
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 7ca7409..4fedfb9 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -172,6 +172,7 @@
 ART_GTEST_class_table_test_DEX_DEPS := XandY
 ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
 ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes
+ART_GTEST_dexanalyze_test_DEX_DEPS := MultiDex
 ART_GTEST_dexlayout_test_DEX_DEPS := ManyMethods
 ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) ManyMethods Statics VerifierDeps MainUncompressed EmptyUncompressed
 ART_GTEST_dex2oat_image_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps
@@ -311,6 +312,12 @@
   $(TARGET_CORE_IMAGE_DEFAULT_32) \
   imgdiagd-target
 
+# Dex analyze test requires dexanalyze.
+ART_GTEST_dexanalyze_test_HOST_DEPS := \
+  dexanalyze-host
+ART_GTEST_dexanalyze_test_TARGET_DEPS := \
+  dexanalyze-target
+
 # Oatdump test requires an image and oatfile to dump.
 ART_GTEST_oatdump_test_HOST_DEPS := \
   $(HOST_CORE_IMAGE_DEFAULT_64) \
@@ -353,6 +360,7 @@
     art_compiler_tests \
     art_compiler_host_tests \
     art_dex2oat_tests \
+    art_dexanalyze_tests \
     art_dexdiag_tests \
     art_dexdump_tests \
     art_dexlayout_tests \
@@ -798,6 +806,7 @@
 ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
 ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
 ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
+ART_GTEST_dexanalyzer_test_DEX_DEPS :=
 ART_GTEST_dexoptanalyzer_test_DEX_DEPS :=
 ART_GTEST_dexoptanalyzer_test_HOST_DEPS :=
 ART_GTEST_dexoptanalyzer_test_TARGET_DEPS :=