Restore a few external allocation constants for compatibility.

Aspects of the external allocation facility were exposed through the
VMDebug getAllocCount method.  In a previous change I removed all of
the references to external allocation from getAllocCount.  This had
the unfortunate side effect of breaking some CTS tests and causing the
VM to abort if the old constants were provided to getAllocCount on an
asserts enabled dalvik build.

The straight forward workaround seems to be to restore the special
treatment of these values in getAllocCount for as long as we support
the public interfaces of the external allocation facility.  An easier
way out may have been to make the failure case of getAllocCount return
0 instead of -1 and aborting on an asserts build.  Without some
analysis of API usage in market I would prefer to not change the -1
return value to 0 as it seems the thread counts currently return -1.

This change also eliminates the conditional export of the enum values
related to external allocation.  Those values are published API so it
makes no sense to maintain a way to guard their inclusion.

Change-Id: I49c173e0ec305536760c7aec15eebdc29213fc56
diff --git a/vm/Profile.h b/vm/Profile.h
index bca5096..dd38252 100644
--- a/vm/Profile.h
+++ b/vm/Profile.h
@@ -24,11 +24,6 @@
 
 #include <stdio.h>
 
-/* External allocations are hackish enough that it's worthwhile
- * separating them for possible removal later.
- */
-#define PROFILE_EXTERNAL_ALLOCATIONS 1
-
 struct Thread;      // extern
 
 
diff --git a/vm/native/dalvik_system_VMDebug.c b/vm/native/dalvik_system_VMDebug.c
index a119715..839338e 100644
--- a/vm/native/dalvik_system_VMDebug.c
+++ b/vm/native/dalvik_system_VMDebug.c
@@ -144,12 +144,12 @@
     KIND_GC_INVOCATIONS         = 1<<4,
     KIND_CLASS_INIT_COUNT       = 1<<5,
     KIND_CLASS_INIT_TIME        = 1<<6,
-#if PROFILE_EXTERNAL_ALLOCATIONS
+
+    /* These values exist for backward compatibility. */
     KIND_EXT_ALLOCATED_OBJECTS = 1<<12,
     KIND_EXT_ALLOCATED_BYTES   = 1<<13,
     KIND_EXT_FREED_OBJECTS     = 1<<14,
     KIND_EXT_FREED_BYTES       = 1<<15,
-#endif // PROFILE_EXTERNAL_ALLOCATIONS
 
     KIND_GLOBAL_ALLOCATED_OBJECTS   = KIND_ALLOCATED_OBJECTS,
     KIND_GLOBAL_ALLOCATED_BYTES     = KIND_ALLOCATED_BYTES,
@@ -158,23 +158,12 @@
     KIND_GLOBAL_GC_INVOCATIONS      = KIND_GC_INVOCATIONS,
     KIND_GLOBAL_CLASS_INIT_COUNT    = KIND_CLASS_INIT_COUNT,
     KIND_GLOBAL_CLASS_INIT_TIME     = KIND_CLASS_INIT_TIME,
-#if PROFILE_EXTERNAL_ALLOCATIONS
-    KIND_GLOBAL_EXT_ALLOCATED_OBJECTS = KIND_EXT_ALLOCATED_OBJECTS,
-    KIND_GLOBAL_EXT_ALLOCATED_BYTES = KIND_EXT_ALLOCATED_BYTES,
-    KIND_GLOBAL_EXT_FREED_OBJECTS   = KIND_EXT_FREED_OBJECTS,
-    KIND_GLOBAL_EXT_FREED_BYTES     = KIND_EXT_FREED_BYTES,
-#endif // PROFILE_EXTERNAL_ALLOCATIONS
 
     KIND_THREAD_ALLOCATED_OBJECTS   = KIND_ALLOCATED_OBJECTS << 16,
     KIND_THREAD_ALLOCATED_BYTES     = KIND_ALLOCATED_BYTES << 16,
     KIND_THREAD_FREED_OBJECTS       = KIND_FREED_OBJECTS << 16,
     KIND_THREAD_FREED_BYTES         = KIND_FREED_BYTES << 16,
-#if PROFILE_EXTERNAL_ALLOCATIONS
-    KIND_THREAD_EXT_ALLOCATED_OBJECTS = KIND_EXT_ALLOCATED_OBJECTS << 16,
-    KIND_THREAD_EXT_ALLOCATED_BYTES = KIND_EXT_ALLOCATED_BYTES << 16,
-    KIND_THREAD_EXT_FREED_OBJECTS   = KIND_EXT_FREED_OBJECTS << 16,
-    KIND_THREAD_EXT_FREED_BYTES     = KIND_EXT_FREED_BYTES << 16,
-#endif // PROFILE_EXTERNAL_ALLOCATIONS
+
     KIND_THREAD_GC_INVOCATIONS      = KIND_GC_INVOCATIONS << 16,
 
     // TODO: failedAllocCount, failedAllocSize
@@ -280,6 +269,12 @@
         /* convert nsec to usec, reduce to 32 bits */
         pResult->i = (int) (allocProf->classInitTime / 1000);
         break;
+    case KIND_EXT_ALLOCATED_OBJECTS:
+    case KIND_EXT_ALLOCATED_BYTES:
+    case KIND_EXT_FREED_OBJECTS:
+    case KIND_EXT_FREED_BYTES:
+        pResult->i = 0;  /* backward compatibility */
+        break;
     default:
         assert(false);
         pResult->i = -1;