Move casts.h and stl_util.h into base/.

Change-Id: Idb3bfa5cec3d146e488031d91265737cde2b4cf4
diff --git a/src/atomic.cc b/src/atomic.cc
index 5cc750d..480e456 100644
--- a/src/atomic.cc
+++ b/src/atomic.cc
@@ -20,7 +20,7 @@
 #include <vector>
 
 #include "base/mutex.h"
-#include "stl_util.h"
+#include "base/stl_util.h"
 #include "stringprintf.h"
 #include "thread.h"
 
diff --git a/src/casts.h b/src/base/casts.h
similarity index 97%
rename from src/casts.h
rename to src/base/casts.h
index f996dcd..34c05af 100644
--- a/src/casts.h
+++ b/src/base/casts.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_SRC_CASTS_H_
-#define ART_SRC_CASTS_H_
+#ifndef ART_SRC_BASE_CASTS_H_
+#define ART_SRC_BASE_CASTS_H_
 
 #include <assert.h>
 #include <string.h>
@@ -90,4 +90,4 @@
 
 }  // namespace art
 
-#endif  // ART_SRC_CASTS_H_
+#endif  // ART_SRC_BASE_CASTS_H_
diff --git a/src/stl_util.h b/src/base/stl_util.h
similarity index 95%
rename from src/stl_util.h
rename to src/base/stl_util.h
index 1282cc4..eb8be42 100644
--- a/src/stl_util.h
+++ b/src/base/stl_util.h
@@ -14,11 +14,11 @@
  * limitations under the License.
  */
 
-#ifndef ART_SRC_STL_UTIL_H_
-#define ART_SRC_STL_UTIL_H_
+#ifndef ART_SRC_BASE_STL_UTIL_H_
+#define ART_SRC_BASE_STL_UTIL_H_
 
 #include <algorithm>
-#include <iostream>
+#include <sstream>
 
 namespace art {
 
@@ -94,4 +94,4 @@
 
 }  // namespace art
 
-#endif  // ART_SRC_STL_UTIL_H_
+#endif  // ART_SRC_BASE_STL_UTIL_H_
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 626b1d9..ca8a532 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -27,9 +27,10 @@
 #include <utility>
 #include <vector>
 
+#include "base/casts.h"
 #include "base/logging.h"
+#include "base/stl_util.h"
 #include "base/unix_file/fd_file.h"
-#include "casts.h"
 #include "class_loader.h"
 #include "debugger.h"
 #include "dex_cache.h"
@@ -53,7 +54,6 @@
 #include "gc/space.h"
 #include "gc/space_bitmap.h"
 #include "stack_indirect_reference_table.h"
-#include "stl_util.h"
 #include "thread.h"
 #include "UniquePtr.h"
 #include "utils.h"
diff --git a/src/common_test.h b/src/common_test.h
index e4996a3..60f665a 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -22,6 +22,7 @@
 
 #include "../../external/icu4c/common/unicode/uvernum.h"
 #include "base/macros.h"
+#include "base/stl_util.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "class_loader.h"
@@ -36,7 +37,6 @@
 #include "runtime.h"
 #include "ScopedLocalRef.h"
 #include "scoped_thread_state_change.h"
-#include "stl_util.h"
 #include "stringprintf.h"
 #include "thread.h"
 #include "UniquePtr.h"
diff --git a/src/compiler.cc b/src/compiler.cc
index 522b8c8..b125fdf 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -21,6 +21,7 @@
 #include <dlfcn.h>
 #include <unistd.h>
 
+#include "base/stl_util.h"
 #include "class_linker.h"
 #include "class_loader.h"
 #include "dex_cache.h"
@@ -33,7 +34,6 @@
 #include "gc/space.h"
 #include "scoped_thread_state_change.h"
 #include "ScopedLocalRef.h"
-#include "stl_util.h"
 #include "thread.h"
 #include "thread_pool.h"
 #include "timing_logger.h"
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc
index 7843407..954e2f4 100644
--- a/src/compiler_llvm/compiler_llvm.cc
+++ b/src/compiler_llvm/compiler_llvm.cc
@@ -16,6 +16,7 @@
 
 #include "compiler_llvm.h"
 
+#include "base/stl_util.h"
 #include "backend_options.h"
 #include "class_linker.h"
 #include "compilation_unit.h"
@@ -28,7 +29,6 @@
 #endif
 #include "oat_compilation_unit.h"
 #include "oat_file.h"
-#include "stl_util.h"
 #include "stub_compiler.h"
 #include "utils_llvm.h"
 #include "verifier/method_verifier.h"
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index d989728..52fb02c 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -18,6 +18,7 @@
 
 #include "backend_types.h"
 #include "base/logging.h"
+#include "base/stl_util.h"
 #include "compilation_unit.h"
 #include "compiler.h"
 #include "dalvik_reg.h"
@@ -28,7 +29,6 @@
 #include "object_utils.h"
 #include "runtime_support_func.h"
 #include "runtime_support_llvm.h"
-#include "stl_util.h"
 #include "stringprintf.h"
 #include "utils_llvm.h"
 #include "verifier/method_verifier.h"
diff --git a/src/constants_arm.h b/src/constants_arm.h
index 022bc6e..601c572 100644
--- a/src/constants_arm.h
+++ b/src/constants_arm.h
@@ -21,8 +21,8 @@
 
 #include <iosfwd>
 
+#include "base/casts.h"
 #include "base/logging.h"
-#include "casts.h"
 #include "globals.h"
 
 namespace art {
diff --git a/src/dex2oat.cc b/src/dex2oat.cc
index 550f857..70b2a6b 100644
--- a/src/dex2oat.cc
+++ b/src/dex2oat.cc
@@ -23,6 +23,7 @@
 #include <string>
 #include <vector>
 
+#include "base/stl_util.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "class_loader.h"
@@ -36,7 +37,6 @@
 #include "ScopedLocalRef.h"
 #include "scoped_thread_state_change.h"
 #include "sirt_ref.h"
-#include "stl_util.h"
 #include "stringpiece.h"
 #include "timing_logger.h"
 #include "well_known_classes.h"
diff --git a/src/gc/large_object_space.cc b/src/gc/large_object_space.cc
index 0247e8d..1b93e5d 100644
--- a/src/gc/large_object_space.cc
+++ b/src/gc/large_object_space.cc
@@ -15,13 +15,13 @@
  */
 
 #include "base/logging.h"
+#include "base/stl_util.h"
 #include "large_object_space.h"
 #include "UniquePtr.h"
 #include "dlmalloc.h"
 #include "image.h"
 #include "os.h"
 #include "space_bitmap.h"
-#include "stl_util.h"
 #include "utils.h"
 
 namespace art {
diff --git a/src/gc/mod_union_table.cc b/src/gc/mod_union_table.cc
index 4d9ffe2..8953c5a 100644
--- a/src/gc/mod_union_table.cc
+++ b/src/gc/mod_union_table.cc
@@ -14,12 +14,13 @@
  * limitations under the License.
  */
 
+#include "mod_union_table.h"
+
+#include "base/stl_util.h"
 #include "heap.h"
 #include "heap_bitmap.h"
 #include "mark_sweep.h"
-#include "mod_union_table.h"
 #include "space.h"
-#include "stl_util.h"
 #include "UniquePtr.h"
 
 namespace art {
diff --git a/src/gc/space.cc b/src/gc/space.cc
index bf25358..37565db 100644
--- a/src/gc/space.cc
+++ b/src/gc/space.cc
@@ -16,14 +16,14 @@
 
 #include "space.h"
 
-#include "UniquePtr.h"
 #include "base/logging.h"
+#include "base/stl_util.h"
 #include "base/unix_file/fd_file.h"
 #include "dlmalloc.h"
 #include "image.h"
 #include "os.h"
 #include "space_bitmap.h"
-#include "stl_util.h"
+#include "UniquePtr.h"
 #include "utils.h"
 
 namespace art {
diff --git a/src/greenland/inferred_reg_category_map.cc b/src/greenland/inferred_reg_category_map.cc
index 0c31634..b4ce12c 100644
--- a/src/greenland/inferred_reg_category_map.cc
+++ b/src/greenland/inferred_reg_category_map.cc
@@ -16,11 +16,12 @@
 
 #include "inferred_reg_category_map.h"
 
-#include "stl_util.h"
-
 #include <stdint.h>
+
 #include <vector>
 
+#include "base/stl_util.h"
+
 namespace art {
 namespace greenland {
 
diff --git a/src/heap.cc b/src/heap.cc
index 13f6ee8..7edbcf0 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -22,6 +22,7 @@
 #include <limits>
 #include <vector>
 
+#include "base/stl_util.h"
 #include "debugger.h"
 #include "gc/atomic_stack.h"
 #include "gc/card_table.h"
@@ -39,7 +40,6 @@
 #include "ScopedLocalRef.h"
 #include "scoped_thread_state_change.h"
 #include "sirt_ref.h"
-#include "stl_util.h"
 #include "thread_list.h"
 #include "timing_logger.h"
 #include "UniquePtr.h"
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index db72a99..fc7bdd4 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -24,6 +24,7 @@
 
 #include "base/logging.h"
 #include "base/mutex.h"
+#include "base/stl_util.h"
 #include "class_linker.h"
 #include "class_loader.h"
 #include "invoke_arg_array_builder.h"
@@ -34,7 +35,6 @@
 #include "safe_map.h"
 #include "scoped_thread_state_change.h"
 #include "ScopedLocalRef.h"
-#include "stl_util.h"
 #include "stringpiece.h"
 #include "thread.h"
 #include "UniquePtr.h"
diff --git a/src/monitor.cc b/src/monitor.cc
index d58f462..6172136 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -19,12 +19,12 @@
 #include <vector>
 
 #include "base/mutex.h"
+#include "base/stl_util.h"
 #include "class_linker.h"
 #include "dex_instruction.h"
 #include "object.h"
 #include "object_utils.h"
 #include "scoped_thread_state_change.h"
-#include "stl_util.h"
 #include "thread.h"
 #include "thread_list.h"
 #include "verifier/method_verifier.h"
diff --git a/src/oat/utils/mips/assembler_mips.cc b/src/oat/utils/mips/assembler_mips.cc
index be1aceb..25ba9b2 100644
--- a/src/oat/utils/mips/assembler_mips.cc
+++ b/src/oat/utils/mips/assembler_mips.cc
@@ -16,7 +16,7 @@
 
 #include "assembler_mips.h"
 
-#include "casts.h"
+#include "base/casts.h"
 #include "memory_region.h"
 #include "oat/runtime/oat_support_entrypoints.h"
 #include "thread.h"
diff --git a/src/oat/utils/x86/assembler_x86.cc b/src/oat/utils/x86/assembler_x86.cc
index 010318b..fd8f152 100644
--- a/src/oat/utils/x86/assembler_x86.cc
+++ b/src/oat/utils/x86/assembler_x86.cc
@@ -16,7 +16,7 @@
 
 #include "assembler_x86.h"
 
-#include "casts.h"
+#include "base/casts.h"
 #include "memory_region.h"
 #include "oat/runtime/oat_support_entrypoints.h"
 #include "thread.h"
diff --git a/src/oat_file.cc b/src/oat_file.cc
index d3e1079..b201630 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -16,9 +16,9 @@
 
 #include "oat_file.h"
 
+#include "base/stl_util.h"
 #include "base/unix_file/fd_file.h"
 #include "os.h"
-#include "stl_util.h"
 
 namespace art {
 
diff --git a/src/oat_writer.cc b/src/oat_writer.cc
index 49d4e25..284578b 100644
--- a/src/oat_writer.cc
+++ b/src/oat_writer.cc
@@ -18,6 +18,7 @@
 
 #include <zlib.h>
 
+#include "base/stl_util.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "class_loader.h"
@@ -25,7 +26,6 @@
 #include "safe_map.h"
 #include "scoped_thread_state_change.h"
 #include "gc/space.h"
-#include "stl_util.h"
 #include "verifier/method_verifier.h"
 
 namespace art {
diff --git a/src/object.h b/src/object.h
index f577f0a..2ae3ac1 100644
--- a/src/object.h
+++ b/src/object.h
@@ -22,9 +22,9 @@
 
 #include "UniquePtr.h"
 #include "atomic.h"
+#include "base/casts.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "casts.h"
 #include "globals.h"
 #include "heap.h"
 #include "invoke_type.h"
diff --git a/src/scoped_thread_state_change.h b/src/scoped_thread_state_change.h
index c0fb649..5eabbdf 100644
--- a/src/scoped_thread_state_change.h
+++ b/src/scoped_thread_state_change.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_SCOPED_THREAD_STATE_CHANGE_H_
 #define ART_SRC_SCOPED_THREAD_STATE_CHANGE_H_
 
-#include "casts.h"
+#include "base/casts.h"
 #include "jni_internal.h"
 #include "thread.h"
 
diff --git a/src/thread_pool.cc b/src/thread_pool.cc
index 1686ea6..a06f9d3 100644
--- a/src/thread_pool.cc
+++ b/src/thread_pool.cc
@@ -1,9 +1,26 @@
-#include "casts.h"
-#include "runtime.h"
-#include "stl_util.h"
-#include "thread.h"
+/*
+ * Copyright (C) 2012 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.
+ */
+
 #include "thread_pool.h"
 
+#include "base/casts.h"
+#include "base/stl_util.h"
+#include "runtime.h"
+#include "thread.h"
+
 namespace art {
 
 ThreadPoolWorker::ThreadPoolWorker(ThreadPool* thread_pool, const std::string& name,
diff --git a/src/verifier/method_verifier.h b/src/verifier/method_verifier.h
index 99801c6..b676269 100644
--- a/src/verifier/method_verifier.h
+++ b/src/verifier/method_verifier.h
@@ -22,8 +22,9 @@
 #include <set>
 #include <vector>
 
+#include "base/casts.h"
 #include "base/macros.h"
-#include "casts.h"
+#include "base/stl_util.h"
 #include "compiler.h"
 #include "dex_file.h"
 #include "dex_instruction.h"
@@ -32,7 +33,6 @@
 #include "reg_type_cache.h"
 #include "register_line.h"
 #include "safe_map.h"
-#include "stl_util.h"
 #include "UniquePtr.h"
 
 namespace art {
diff --git a/src/verifier/reg_type_cache.h b/src/verifier/reg_type_cache.h
index c86f65b..1cd3fba 100644
--- a/src/verifier/reg_type_cache.h
+++ b/src/verifier/reg_type_cache.h
@@ -18,8 +18,8 @@
 #define ART_SRC_VERIFIER_REG_TYPE_CACHE_H_
 
 #include "base/macros.h"
+#include "base/stl_util.h"
 #include "reg_type.h"
-#include "stl_util.h"
 
 namespace art {
 namespace verifier {