Revoke rosalloc thread-local buffers at the checkpoint.

In the mark sweep collector, rosalloc thread-local buffers were
revoked during the pause. Now, they are revoked at the thread
checkpoint, as opposed to during the pause, which appears to help
reduce the pause time.

In Ritz MemAllocTest, the average sticky pause time went down ~20%
(925 us -> 724 us).

Bug: 13394464
Bug: 9986565
Change-Id: I104992a11b46d59264c0b9aa2db82b1ccf2826bc
diff --git a/runtime/thread.cc b/runtime/thread.cc
index afa5574..8e14924 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -2074,6 +2074,16 @@
   thread_local_objects_ = 0;
 }
 
+bool Thread::HasTlab() const {
+  bool has_tlab = thread_local_pos_ != nullptr;
+  if (has_tlab) {
+    DCHECK(thread_local_start_ != nullptr && thread_local_end_ != nullptr);
+  } else {
+    DCHECK(thread_local_start_ == nullptr && thread_local_end_ == nullptr);
+  }
+  return has_tlab;
+}
+
 std::ostream& operator<<(std::ostream& os, const Thread& thread) {
   thread.ShortDump(os);
   return os;