Improve accuracy of heap trim times

Before, WaitForConcurrentGc was being called inside of Heap::Trim.
This caused the printed trim times to be larger than they should be.

Change-Id: Icc76b5ed7fb99350536d48a5215e7c1fdb8b4567
diff --git a/src/heap.cc b/src/heap.cc
index c6f2395..584c5b2 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2040,8 +2040,7 @@
   }
 }
 
-void Heap::Trim(Thread* self) {
-  WaitForConcurrentGcToComplete(self);
+void Heap::Trim() {
   alloc_space_->Trim();
 }
 
diff --git a/src/heap.h b/src/heap.h
index 14d8382..984a329 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -278,7 +278,7 @@
 
   void DumpForSigQuit(std::ostream& os);
 
-  void Trim(Thread* self);
+  void Trim();
 
   HeapBitmap* GetLiveBitmap() SHARED_LOCKS_REQUIRED(Locks::heap_bitmap_lock_) {
     return live_bitmap_.get();
diff --git a/src/native/dalvik_system_VMRuntime.cc b/src/native/dalvik_system_VMRuntime.cc
index b98f974..9c40041 100644
--- a/src/native/dalvik_system_VMRuntime.cc
+++ b/src/native/dalvik_system_VMRuntime.cc
@@ -156,15 +156,14 @@
   }
 }
 
-static void VMRuntime_trimHeap(JNIEnv* env, jobject) {
+static void VMRuntime_trimHeap(JNIEnv*, jobject) {
   // Trim the managed heap.
   Heap* heap = Runtime::Current()->GetHeap();
   uint64_t start_ns = NanoTime();
   DlMallocSpace* alloc_space = heap->GetAllocSpace();
   size_t alloc_space_size = alloc_space->Size();
   float utilization = static_cast<float>(alloc_space->GetNumBytesAllocated()) / alloc_space_size;
-  Thread* self = static_cast<JNIEnvExt*>(env)->self;
-  heap->Trim(self);
+  heap->Trim();
   // Trim the native heap.
   dlmalloc_trim(0);
   dlmalloc_inspect_all(MspaceMadviseCallback, NULL);