Move remaining runtime/base stuff to libartbase

Move the remainder of the Arena stuff, plus dumpable and
runtime/*memory_region* to libartbase.  More preparation to build
profiling library.

Bug: 22322814
Test: make -j 50 checkbuild
Change-Id: Iaf26d310c89bc58846553281576c18102f5e4122
diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc
index 9ccdff3..8cb1998 100644
--- a/compiler/jni/quick/jni_compiler.cc
+++ b/compiler/jni/quick/jni_compiler.cc
@@ -28,6 +28,7 @@
 #include "base/logging.h"  // For VLOG.
 #include "base/macros.h"
 #include "base/malloc_arena_pool.h"
+#include "base/memory_region.h"
 #include "base/utils.h"
 #include "calling_convention.h"
 #include "class_linker.h"
@@ -37,7 +38,6 @@
 #include "driver/compiler_options.h"
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "jni_env_ext.h"
-#include "memory_region.h"
 #include "thread.h"
 #include "utils/arm/managed_register_arm.h"
 #include "utils/arm64/managed_register_arm64.h"
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 3bd5e14..e1f680f 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -24,12 +24,12 @@
 #include "base/bit_field.h"
 #include "base/bit_utils.h"
 #include "base/enums.h"
+#include "base/memory_region.h"
 #include "dex/string_reference.h"
 #include "dex/type_reference.h"
 #include "globals.h"
 #include "graph_visualizer.h"
 #include "locations.h"
-#include "memory_region.h"
 #include "nodes.h"
 #include "optimizing_compiler_stats.h"
 #include "read_barrier_option.h"
diff --git a/compiler/optimizing/stack_map_stream.h b/compiler/optimizing/stack_map_stream.h
index 579aabd..268e9bd 100644
--- a/compiler/optimizing/stack_map_stream.h
+++ b/compiler/optimizing/stack_map_stream.h
@@ -19,9 +19,9 @@
 
 #include "base/bit_vector-inl.h"
 #include "base/hash_map.h"
+#include "base/memory_region.h"
 #include "base/scoped_arena_containers.h"
 #include "base/value_object.h"
-#include "memory_region.h"
 #include "method_info.h"
 #include "nodes.h"
 #include "stack_map.h"
diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc
index 944c64b..421c1b6 100644
--- a/compiler/utils/assembler.cc
+++ b/compiler/utils/assembler.cc
@@ -20,8 +20,8 @@
 #include <vector>
 
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "globals.h"
-#include "memory_region.h"
 
 namespace art {
 
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h
index 5b0cd6b..379a639 100644
--- a/compiler/utils/assembler.h
+++ b/compiler/utils/assembler.h
@@ -29,10 +29,10 @@
 #include "base/array_ref.h"
 #include "base/enums.h"
 #include "base/macros.h"
+#include "base/memory_region.h"
 #include "debug/dwarf/debug_frame_opcode_writer.h"
 #include "label.h"
 #include "managed_register.h"
-#include "memory_region.h"
 #include "mips/constants_mips.h"
 #include "offsets.h"
 #include "x86/constants_x86.h"
diff --git a/compiler/utils/jni_macro_assembler.cc b/compiler/utils/jni_macro_assembler.cc
index 3f7691b..0c34aa4 100644
--- a/compiler/utils/jni_macro_assembler.cc
+++ b/compiler/utils/jni_macro_assembler.cc
@@ -38,8 +38,8 @@
 #include "x86_64/jni_macro_assembler_x86_64.h"
 #endif
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "globals.h"
-#include "memory_region.h"
 
 namespace art {
 
diff --git a/compiler/utils/mips/assembler_mips.cc b/compiler/utils/mips/assembler_mips.cc
index b2ad490..dce5b95 100644
--- a/compiler/utils/mips/assembler_mips.cc
+++ b/compiler/utils/mips/assembler_mips.cc
@@ -18,9 +18,9 @@
 
 #include "base/bit_utils.h"
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "entrypoints/quick/quick_entrypoints_enum.h"
-#include "memory_region.h"
 #include "thread.h"
 
 namespace art {
diff --git a/compiler/utils/mips64/assembler_mips64.cc b/compiler/utils/mips64/assembler_mips64.cc
index 5a817fa..bb1bb82 100644
--- a/compiler/utils/mips64/assembler_mips64.cc
+++ b/compiler/utils/mips64/assembler_mips64.cc
@@ -18,9 +18,9 @@
 
 #include "base/bit_utils.h"
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "entrypoints/quick/quick_entrypoints.h"
 #include "entrypoints/quick/quick_entrypoints_enum.h"
-#include "memory_region.h"
 #include "thread.h"
 
 namespace art {
diff --git a/compiler/utils/x86/assembler_x86.cc b/compiler/utils/x86/assembler_x86.cc
index 42c2541..86f9010 100644
--- a/compiler/utils/x86/assembler_x86.cc
+++ b/compiler/utils/x86/assembler_x86.cc
@@ -17,8 +17,8 @@
 #include "assembler_x86.h"
 
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "entrypoints/quick/quick_entrypoints.h"
-#include "memory_region.h"
 #include "thread.h"
 
 namespace art {
diff --git a/compiler/utils/x86_64/assembler_x86_64.cc b/compiler/utils/x86_64/assembler_x86_64.cc
index c6e16e7..bd31561 100644
--- a/compiler/utils/x86_64/assembler_x86_64.cc
+++ b/compiler/utils/x86_64/assembler_x86_64.cc
@@ -17,8 +17,8 @@
 #include "assembler_x86_64.h"
 
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "entrypoints/quick/quick_entrypoints.h"
-#include "memory_region.h"
 #include "thread.h"
 
 namespace art {
diff --git a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc
index 5766f9d..9486cb4 100644
--- a/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc
+++ b/compiler/utils/x86_64/jni_macro_assembler_x86_64.cc
@@ -17,8 +17,8 @@
 #include "jni_macro_assembler_x86_64.h"
 
 #include "base/casts.h"
+#include "base/memory_region.h"
 #include "entrypoints/quick/quick_entrypoints.h"
-#include "memory_region.h"
 #include "thread.h"
 
 namespace art {
diff --git a/libartbase/Android.bp b/libartbase/Android.bp
index 3c61944..62157e1 100644
--- a/libartbase/Android.bp
+++ b/libartbase/Android.bp
@@ -20,13 +20,18 @@
     host_supported: true,
     srcs: [
         "base/allocator.cc",
+        "base/arena_allocator.cc",
+        "base/arena_bit_vector.cc",
         "base/bit_vector.cc",
         "base/file_magic.cc",
         "base/hex_dump.cc",
         "base/logging.cc",
+        "base/malloc_arena_pool.cc",
+        "base/memory_region.cc",
         "base/os_linux.cc",
         "base/runtime_debug.cc",
         "base/safe_copy.cc",
+        "base/scoped_arena_allocator.cc",
         "base/scoped_flock.cc",
         "base/time_utils.cc",
         "base/unix_file/fd_file.cc",
@@ -90,6 +95,7 @@
         "art_gtest_defaults",
     ],
     srcs: [
+        "base/arena_allocator_test.cc",
         "base/bit_field_test.cc",
         "base/bit_string_test.cc",
         "base/bit_struct_test.cc",
@@ -100,6 +106,7 @@
         "base/histogram_test.cc",
         "base/leb128_test.cc",
         "base/logging_test.cc",
+        "base/memory_region_test.cc",
         "base/safe_copy_test.cc",
         "base/scoped_flock_test.cc",
         "base/time_utils_test.cc",
diff --git a/runtime/base/arena_allocator-inl.h b/libartbase/base/arena_allocator-inl.h
similarity index 86%
rename from runtime/base/arena_allocator-inl.h
rename to libartbase/base/arena_allocator-inl.h
index 0e43837..a03e9df 100644
--- a/runtime/base/arena_allocator-inl.h
+++ b/libartbase/base/arena_allocator-inl.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_ARENA_ALLOCATOR_INL_H_
-#define ART_RUNTIME_BASE_ARENA_ALLOCATOR_INL_H_
+#ifndef ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_INL_H_
+#define ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_INL_H_
 
 #include "arena_allocator.h"
 
@@ -31,4 +31,4 @@
 }  // namespace arena_allocator
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_ARENA_ALLOCATOR_INL_H_
+#endif  // ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_INL_H_
diff --git a/runtime/base/arena_allocator.cc b/libartbase/base/arena_allocator.cc
similarity index 100%
rename from runtime/base/arena_allocator.cc
rename to libartbase/base/arena_allocator.cc
diff --git a/runtime/base/arena_allocator.h b/libartbase/base/arena_allocator.h
similarity index 98%
rename from runtime/base/arena_allocator.h
rename to libartbase/base/arena_allocator.h
index f59cfdd..3143fba 100644
--- a/runtime/base/arena_allocator.h
+++ b/libartbase/base/arena_allocator.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_ARENA_ALLOCATOR_H_
-#define ART_RUNTIME_BASE_ARENA_ALLOCATOR_H_
+#ifndef ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_H_
+#define ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_H_
 
 #include <stddef.h>
 #include <stdint.h>
@@ -423,4 +423,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_ARENA_ALLOCATOR_H_
+#endif  // ART_LIBARTBASE_BASE_ARENA_ALLOCATOR_H_
diff --git a/runtime/base/arena_allocator_test.cc b/libartbase/base/arena_allocator_test.cc
similarity index 100%
rename from runtime/base/arena_allocator_test.cc
rename to libartbase/base/arena_allocator_test.cc
diff --git a/runtime/base/arena_bit_vector.cc b/libartbase/base/arena_bit_vector.cc
similarity index 100%
rename from runtime/base/arena_bit_vector.cc
rename to libartbase/base/arena_bit_vector.cc
diff --git a/runtime/base/arena_bit_vector.h b/libartbase/base/arena_bit_vector.h
similarity index 92%
rename from runtime/base/arena_bit_vector.h
rename to libartbase/base/arena_bit_vector.h
index ca1d5b1..2b2322e 100644
--- a/runtime/base/arena_bit_vector.h
+++ b/libartbase/base/arena_bit_vector.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_ARENA_BIT_VECTOR_H_
-#define ART_RUNTIME_BASE_ARENA_BIT_VECTOR_H_
+#ifndef ART_LIBARTBASE_BASE_ARENA_BIT_VECTOR_H_
+#define ART_LIBARTBASE_BASE_ARENA_BIT_VECTOR_H_
 
 #include "base/arena_object.h"
 #include "base/bit_vector.h"
@@ -55,4 +55,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_ARENA_BIT_VECTOR_H_
+#endif  // ART_LIBARTBASE_BASE_ARENA_BIT_VECTOR_H_
diff --git a/runtime/base/arena_containers.h b/libartbase/base/arena_containers.h
similarity index 97%
rename from runtime/base/arena_containers.h
rename to libartbase/base/arena_containers.h
index 4f57212..40cf23c 100644
--- a/runtime/base/arena_containers.h
+++ b/libartbase/base/arena_containers.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_ARENA_CONTAINERS_H_
-#define ART_RUNTIME_BASE_ARENA_CONTAINERS_H_
+#ifndef ART_LIBARTBASE_BASE_ARENA_CONTAINERS_H_
+#define ART_LIBARTBASE_BASE_ARENA_CONTAINERS_H_
 
 #include <deque>
 #include <queue>
@@ -241,4 +241,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_ARENA_CONTAINERS_H_
+#endif  // ART_LIBARTBASE_BASE_ARENA_CONTAINERS_H_
diff --git a/runtime/base/arena_object.h b/libartbase/base/arena_object.h
similarity index 93%
rename from runtime/base/arena_object.h
rename to libartbase/base/arena_object.h
index d01e346..de7cb64 100644
--- a/runtime/base/arena_object.h
+++ b/libartbase/base/arena_object.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_ARENA_OBJECT_H_
-#define ART_RUNTIME_BASE_ARENA_OBJECT_H_
+#ifndef ART_LIBARTBASE_BASE_ARENA_OBJECT_H_
+#define ART_LIBARTBASE_BASE_ARENA_OBJECT_H_
 
 #include <android-base/logging.h>
 
@@ -69,4 +69,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_ARENA_OBJECT_H_
+#endif  // ART_LIBARTBASE_BASE_ARENA_OBJECT_H_
diff --git a/runtime/bit_memory_region.h b/libartbase/base/bit_memory_region.h
similarity index 93%
rename from runtime/bit_memory_region.h
rename to libartbase/base/bit_memory_region.h
index 3a696f1..f3926bc 100644
--- a/runtime/bit_memory_region.h
+++ b/libartbase/base/bit_memory_region.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BIT_MEMORY_REGION_H_
-#define ART_RUNTIME_BIT_MEMORY_REGION_H_
+#ifndef ART_LIBARTBASE_BASE_BIT_MEMORY_REGION_H_
+#define ART_LIBARTBASE_BASE_BIT_MEMORY_REGION_H_
 
 #include "memory_region.h"
 
@@ -70,4 +70,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BIT_MEMORY_REGION_H_
+#endif  // ART_LIBARTBASE_BASE_BIT_MEMORY_REGION_H_
diff --git a/runtime/base/dumpable.h b/libartbase/base/dumpable.h
similarity index 63%
rename from runtime/base/dumpable.h
rename to libartbase/base/dumpable.h
index 9ef8d69..6621397 100644
--- a/runtime/base/dumpable.h
+++ b/libartbase/base/dumpable.h
@@ -14,13 +14,12 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_DUMPABLE_H_
-#define ART_RUNTIME_BASE_DUMPABLE_H_
+#ifndef ART_LIBARTBASE_BASE_DUMPABLE_H_
+#define ART_LIBARTBASE_BASE_DUMPABLE_H_
 
 #include <ostream>
 
 #include "base/macros.h"
-#include "base/mutex.h"
 
 namespace art {
 
@@ -51,27 +50,6 @@
   return os;
 }
 
-template<typename T>
-class MutatorLockedDumpable {
- public:
-  explicit MutatorLockedDumpable(T& value) REQUIRES_SHARED(Locks::mutator_lock_) : value_(value) {}
-
-  void Dump(std::ostream& os) const REQUIRES_SHARED(Locks::mutator_lock_) {
-    value_.Dump(os);
-  }
-
- private:
-  const T& value_;
-
-  DISALLOW_COPY_AND_ASSIGN(MutatorLockedDumpable);
-};
-
-template<typename T>
-std::ostream& operator<<(std::ostream& os, const MutatorLockedDumpable<T>& rhs)
-  // TODO: should be REQUIRES_SHARED(Locks::mutator_lock_) however annotalysis
-  //       currently fails for this.
-    NO_THREAD_SAFETY_ANALYSIS;
-
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_DUMPABLE_H_
+#endif  // ART_LIBARTBASE_BASE_DUMPABLE_H_
diff --git a/runtime/base/malloc_arena_pool.cc b/libartbase/base/malloc_arena_pool.cc
similarity index 100%
rename from runtime/base/malloc_arena_pool.cc
rename to libartbase/base/malloc_arena_pool.cc
diff --git a/runtime/base/malloc_arena_pool.h b/libartbase/base/malloc_arena_pool.h
similarity index 89%
rename from runtime/base/malloc_arena_pool.h
rename to libartbase/base/malloc_arena_pool.h
index 9cd2572..8720189 100644
--- a/runtime/base/malloc_arena_pool.h
+++ b/libartbase/base/malloc_arena_pool.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_MALLOC_ARENA_POOL_H_
-#define ART_RUNTIME_BASE_MALLOC_ARENA_POOL_H_
+#ifndef ART_LIBARTBASE_BASE_MALLOC_ARENA_POOL_H_
+#define ART_LIBARTBASE_BASE_MALLOC_ARENA_POOL_H_
 
 #include <mutex>
 
@@ -45,4 +45,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_MALLOC_ARENA_POOL_H_
+#endif  // ART_LIBARTBASE_BASE_MALLOC_ARENA_POOL_H_
diff --git a/runtime/memory_region.cc b/libartbase/base/memory_region.cc
similarity index 100%
rename from runtime/memory_region.cc
rename to libartbase/base/memory_region.cc
diff --git a/runtime/memory_region.h b/libartbase/base/memory_region.h
similarity index 95%
rename from runtime/memory_region.h
rename to libartbase/base/memory_region.h
index 23e0aec..7add466 100644
--- a/runtime/memory_region.h
+++ b/libartbase/base/memory_region.h
@@ -14,17 +14,17 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_MEMORY_REGION_H_
-#define ART_RUNTIME_MEMORY_REGION_H_
+#ifndef ART_LIBARTBASE_BASE_MEMORY_REGION_H_
+#define ART_LIBARTBASE_BASE_MEMORY_REGION_H_
 
 #include <stdint.h>
 #include <type_traits>
 
 #include <android-base/logging.h>
 
-#include "arch/instruction_set.h"
 #include "base/bit_utils.h"
 #include "base/casts.h"
+#include "base/enums.h"
 #include "base/macros.h"
 #include "base/value_object.h"
 #include "globals.h"
@@ -211,9 +211,8 @@
 
   // Is `address` aligned on a machine word?
   template<typename T> static constexpr bool IsWordAligned(const T* address) {
-    // Word alignment in bytes.
-    size_t kWordAlignment = static_cast<size_t>(GetInstructionSetPointerSize(kRuntimeISA));
-    return IsAlignedParam(address, kWordAlignment);
+    // Word alignment in bytes.  Determined from pointer size.
+    return IsAligned<kRuntimePointerSize>(address);
   }
 
   void* pointer_;
@@ -222,4 +221,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_MEMORY_REGION_H_
+#endif  // ART_LIBARTBASE_BASE_MEMORY_REGION_H_
diff --git a/runtime/memory_region_test.cc b/libartbase/base/memory_region_test.cc
similarity index 100%
rename from runtime/memory_region_test.cc
rename to libartbase/base/memory_region_test.cc
diff --git a/runtime/base/scoped_arena_allocator.cc b/libartbase/base/scoped_arena_allocator.cc
similarity index 100%
rename from runtime/base/scoped_arena_allocator.cc
rename to libartbase/base/scoped_arena_allocator.cc
diff --git a/runtime/base/scoped_arena_allocator.h b/libartbase/base/scoped_arena_allocator.h
similarity index 96%
rename from runtime/base/scoped_arena_allocator.h
rename to libartbase/base/scoped_arena_allocator.h
index a253e2f..d5f6df8 100644
--- a/runtime/base/scoped_arena_allocator.h
+++ b/libartbase/base/scoped_arena_allocator.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_
-#define ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_
+#ifndef ART_LIBARTBASE_BASE_SCOPED_ARENA_ALLOCATOR_H_
+#define ART_LIBARTBASE_BASE_SCOPED_ARENA_ALLOCATOR_H_
 
 #include <android-base/logging.h>
 
@@ -185,4 +185,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_SCOPED_ARENA_ALLOCATOR_H_
+#endif  // ART_LIBARTBASE_BASE_SCOPED_ARENA_ALLOCATOR_H_
diff --git a/runtime/base/scoped_arena_containers.h b/libartbase/base/scoped_arena_containers.h
similarity index 97%
rename from runtime/base/scoped_arena_containers.h
rename to libartbase/base/scoped_arena_containers.h
index f8ee3f3..4df02b6 100644
--- a/runtime/base/scoped_arena_containers.h
+++ b/libartbase/base/scoped_arena_containers.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_BASE_SCOPED_ARENA_CONTAINERS_H_
-#define ART_RUNTIME_BASE_SCOPED_ARENA_CONTAINERS_H_
+#ifndef ART_LIBARTBASE_BASE_SCOPED_ARENA_CONTAINERS_H_
+#define ART_LIBARTBASE_BASE_SCOPED_ARENA_CONTAINERS_H_
 
 #include <deque>
 #include <queue>
@@ -272,4 +272,4 @@
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_BASE_SCOPED_ARENA_CONTAINERS_H_
+#endif  // ART_LIBARTBASE_BASE_SCOPED_ARENA_CONTAINERS_H_
diff --git a/runtime/Android.bp b/runtime/Android.bp
index b380dab..7126687 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -32,14 +32,10 @@
         "art_field.cc",
         "art_method.cc",
         "barrier.cc",
-        "base/arena_allocator.cc",
-        "base/arena_bit_vector.cc",
         "base/file_utils.cc",
-        "base/malloc_arena_pool.cc",
         "base/mem_map_arena_pool.cc",
         "base/mutex.cc",
         "base/quasi_atomic.cc",
-        "base/scoped_arena_allocator.cc",
         "base/timing_logger.cc",
         "cha.cc",
         "check_jni.cc",
@@ -124,7 +120,6 @@
         "linear_alloc.cc",
         "managed_stack.cc",
         "mem_map.cc",
-        "memory_region.cc",
         "method_handles.cc",
         "mirror/array.cc",
         "mirror/call_site.cc",
@@ -543,7 +538,6 @@
         "arch/x86/instruction_set_features_x86_test.cc",
         "arch/x86_64/instruction_set_features_x86_64_test.cc",
         "barrier_test.cc",
-        "base/arena_allocator_test.cc",
         "base/file_utils_test.cc",
         "base/mutex_test.cc",
         "base/timing_logger_test.cc",
@@ -587,7 +581,6 @@
         "java_vm_ext_test.cc",
         "jit/profile_compilation_info_test.cc",
         "mem_map_test.cc",
-        "memory_region_test.cc",
         "method_handles_test.cc",
         "mirror/dex_cache_test.cc",
         "mirror/method_type_test.cc",
diff --git a/runtime/base/dumpable-inl.h b/runtime/base/dumpable-inl.h
deleted file mode 100644
index 9d7fc39..0000000
--- a/runtime/base/dumpable-inl.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ART_RUNTIME_BASE_DUMPABLE_INL_H_
-#define ART_RUNTIME_BASE_DUMPABLE_INL_H_
-
-#include "base/dumpable.h"
-#include "base/mutex.h"
-#include "thread-current-inl.h"
-
-namespace art {
-
-template<typename T>
-inline std::ostream& operator<<(std::ostream& os, const MutatorLockedDumpable<T>& rhs) {
-  Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
-  rhs.Dump(os);
-  return os;
-}
-
-}  // namespace art
-
-#endif  // ART_RUNTIME_BASE_DUMPABLE_INL_H_
diff --git a/runtime/base/mutator_locked_dumpable.h b/runtime/base/mutator_locked_dumpable.h
new file mode 100644
index 0000000..cf2199c
--- /dev/null
+++ b/runtime/base/mutator_locked_dumpable.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ART_RUNTIME_BASE_MUTATOR_LOCKED_DUMPABLE_H_
+#define ART_RUNTIME_BASE_MUTATOR_LOCKED_DUMPABLE_H_
+
+#include "base/mutex.h"
+#include "thread-current-inl.h"
+
+namespace art {
+
+template<typename T>
+class MutatorLockedDumpable {
+ public:
+  explicit MutatorLockedDumpable(T& value) REQUIRES_SHARED(Locks::mutator_lock_) : value_(value) {}
+
+  void Dump(std::ostream& os) const REQUIRES_SHARED(Locks::mutator_lock_) {
+    value_.Dump(os);
+  }
+
+ private:
+  const T& value_;
+
+  DISALLOW_COPY_AND_ASSIGN(MutatorLockedDumpable);
+};
+
+// template<typename T>
+// std::ostream& operator<<(std::ostream& os, const MutatorLockedDumpable<T>& rhs)
+//   // TODO: should be REQUIRES_SHARED(Locks::mutator_lock_) however annotalysis
+//   //       currently fails for this.
+//     NO_THREAD_SAFETY_ANALYSIS;
+
+template<typename T>
+inline std::ostream& operator<<(std::ostream& os, const MutatorLockedDumpable<T>& rhs)
+    NO_THREAD_SAFETY_ANALYSIS {
+  Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
+  rhs.Dump(os);
+  return os;
+}
+
+}  // namespace art
+
+#endif  // ART_RUNTIME_BASE_MUTATOR_LOCKED_DUMPABLE_H_
diff --git a/runtime/indirect_reference_table.cc b/runtime/indirect_reference_table.cc
index 3b9cc0f..6143ba6 100644
--- a/runtime/indirect_reference_table.cc
+++ b/runtime/indirect_reference_table.cc
@@ -16,7 +16,7 @@
 
 #include "indirect_reference_table-inl.h"
 
-#include "base/dumpable-inl.h"
+#include "base/mutator_locked_dumpable.h"
 #include "base/systrace.h"
 #include "base/utils.h"
 #include "java_vm_ext.h"
diff --git a/runtime/jit/profile_compilation_info.cc b/runtime/jit/profile_compilation_info.cc
index f4132c2..6bbe78f 100644
--- a/runtime/jit/profile_compilation_info.cc
+++ b/runtime/jit/profile_compilation_info.cc
@@ -34,10 +34,8 @@
 
 #include "base/arena_allocator.h"
 #include "base/dumpable.h"
-#include "base/file_utils.h"
 #include "base/logging.h"  // For VLOG.
 #include "base/malloc_arena_pool.h"
-#include "base/mutex.h"
 #include "base/os.h"
 #include "base/safe_map.h"
 #include "base/scoped_flock.h"
diff --git a/runtime/jit/profile_compilation_info.h b/runtime/jit/profile_compilation_info.h
index 4ac8c61..f8334ce 100644
--- a/runtime/jit/profile_compilation_info.h
+++ b/runtime/jit/profile_compilation_info.h
@@ -23,9 +23,9 @@
 #include "base/arena_containers.h"
 #include "base/arena_object.h"
 #include "base/atomic.h"
+#include "base/bit_memory_region.h"
 #include "base/malloc_arena_pool.h"
 #include "base/safe_map.h"
-#include "bit_memory_region.h"
 #include "dex/dex_cache_resolved_classes.h"
 #include "dex/dex_file.h"
 #include "dex/dex_file_types.h"
diff --git a/runtime/method_info.h b/runtime/method_info.h
index fe06256..b00ddc6 100644
--- a/runtime/method_info.h
+++ b/runtime/method_info.h
@@ -21,7 +21,7 @@
 
 #include "base/leb128.h"
 #include "base/macros.h"
-#include "memory_region.h"
+#include "base/memory_region.h"
 
 namespace art {
 
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index bde3462..3839764 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -20,12 +20,12 @@
 #include <limits>
 
 #include "arch/code_offset.h"
+#include "base/bit_memory_region.h"
 #include "base/bit_utils.h"
 #include "base/bit_vector.h"
 #include "base/leb128.h"
-#include "bit_memory_region.h"
+#include "base/memory_region.h"
 #include "dex/dex_file_types.h"
-#include "memory_region.h"
 #include "method_info.h"
 
 namespace art {