Split the allocation path into 'instrumented' and 'uninstrumented'
ones.

The instrumented path is equivalent to the existing allocation path
that checks for three instrumentation mechanisms (the debugger
allocation tracking, the runtime allocation stats collection, and
valgrind) for every allocation. The uinstrumented path does not
perform these checks. We use the uninstrumented path by default and
enable the instrumented path only when any of the three mechanisms is
enabled. The uninstrumented version of Heap::AllocObject() is inlined.

This change improves the Ritz MemAllocTest by ~4% on Nexus 4 and ~3%
on Host/x86.

Bug: 9986565
Change-Id: I3e68dfff6789d77bbdcea98457b694e1b5fcef5f
diff --git a/runtime/runtime.h b/runtime/runtime.h
index d73940b..552cfdf 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -398,6 +398,9 @@
   const std::vector<const DexFile*>& GetCompileTimeClassPath(jobject class_loader);
   void SetCompileTimeClassPath(jobject class_loader, std::vector<const DexFile*>& class_path);
 
+  void InstrumentQuickAllocEntryPoints();
+  void UninstrumentQuickAllocEntryPoints();
+
  private:
   static void InitPlatformSignalHandlers();
 
@@ -514,6 +517,8 @@
   jobject main_thread_group_;
   jobject system_thread_group_;
 
+  int quick_alloc_entry_points_instrumentation_counter_;
+
   DISALLOW_COPY_AND_ASSIGN(Runtime);
 };