summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Sehr <sehr@google.com> 2018-04-05 12:23:54 -0700
committer David Sehr <sehr@google.com> 2018-04-09 23:30:08 +0000
commit9c4a015cf01989597fd899011dba310b704dacaa (patch)
tree17101dd177beb28c1d28c8eddab645bc7d1af984
parent6485701497edf2fd4e5296c3715929ad44ea9752 (diff)
Move more runtime code to libartbase, libdexfile
Move some code that logically belongs to libartbase or libdexfile to those places respectively. Bug: 22322814 Test: make -j 50 checkbuild Change-Id: Idfded5d24b40d8587011681e6235b6672846da19
-rw-r--r--compiler/verifier_deps_test.cc2
-rw-r--r--dex2oat/linker/oat_writer.cc2
-rw-r--r--dexlayout/dexlayout.cc1
-rw-r--r--libartbase/Android.bp1
-rw-r--r--libartbase/base/indenter.h (renamed from runtime/indenter.h)6
-rw-r--r--libartbase/base/indenter_test.cc (renamed from runtime/indenter_test.cc)0
-rw-r--r--libartbase/base/logging_test.cc6
-rw-r--r--libartbase/base/safe_copy_test.cc7
-rw-r--r--libdexfile/Android.bp2
-rw-r--r--libdexfile/dex/type_lookup_table.cc (renamed from runtime/type_lookup_table.cc)1
-rw-r--r--libdexfile/dex/type_lookup_table.h (renamed from runtime/type_lookup_table.h)6
-rw-r--r--libdexfile/dex/type_lookup_table_test.cc (renamed from runtime/type_lookup_table_test.cc)0
-rw-r--r--oatdump/oatdump.cc4
-rw-r--r--runtime/Android.bp3
-rw-r--r--runtime/oat_file.cc2
-rw-r--r--runtime/oat_file.h2
-rw-r--r--runtime/stack_map.cc2
-rw-r--r--runtime/verifier/method_verifier.cc2
-rw-r--r--runtime/verifier/verifier_deps.cc2
19 files changed, 25 insertions, 26 deletions
diff --git a/compiler/verifier_deps_test.cc b/compiler/verifier_deps_test.cc
index 76448d819c..553d131e2f 100644
--- a/compiler/verifier_deps_test.cc
+++ b/compiler/verifier_deps_test.cc
@@ -18,6 +18,7 @@
#include "verifier/verifier_deps.h"
#include "art_method-inl.h"
+#include "base/indenter.h"
#include "class_linker.h"
#include "common_compiler_test.h"
#include "compiler_callbacks.h"
@@ -28,7 +29,6 @@
#include "driver/compiler_driver-inl.h"
#include "driver/compiler_options.h"
#include "handle_scope-inl.h"
-#include "indenter.h"
#include "mirror/class_loader.h"
#include "runtime.h"
#include "scoped_thread_state_change-inl.h"
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index bcc59098e5..690b565090 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -40,6 +40,7 @@
#include "dex/dex_file_loader.h"
#include "dex/dex_file_types.h"
#include "dex/standard_dex_file.h"
+#include "dex/type_lookup_table.h"
#include "dex/verification_results.h"
#include "dex_container.h"
#include "dexlayout.h"
@@ -63,7 +64,6 @@
#include "oat_quick_method_header.h"
#include "quicken_info.h"
#include "scoped_thread_state_change-inl.h"
-#include "type_lookup_table.h"
#include "utils/dex_cache_arrays_layout-inl.h"
#include "vdex_file.h"
#include "verifier/verifier_deps.h"
diff --git a/dexlayout/dexlayout.cc b/dexlayout/dexlayout.cc
index ec0cbe6a60..da1573cef1 100644
--- a/dexlayout/dexlayout.cc
+++ b/dexlayout/dexlayout.cc
@@ -49,7 +49,6 @@
#include "dex_visualize.h"
#include "dex_writer.h"
#include "jit/profile_compilation_info.h"
-#include "mem_map.h"
namespace art {
diff --git a/libartbase/Android.bp b/libartbase/Android.bp
index 62157e196d..e68c2fba5b 100644
--- a/libartbase/Android.bp
+++ b/libartbase/Android.bp
@@ -104,6 +104,7 @@ art_cc_test {
"base/hash_set_test.cc",
"base/hex_dump_test.cc",
"base/histogram_test.cc",
+ "base/indenter_test.cc",
"base/leb128_test.cc",
"base/logging_test.cc",
"base/memory_region_test.cc",
diff --git a/runtime/indenter.h b/libartbase/base/indenter.h
index 6361dd2092..850b7c4f73 100644
--- a/runtime/indenter.h
+++ b/libartbase/base/indenter.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_RUNTIME_INDENTER_H_
-#define ART_RUNTIME_INDENTER_H_
+#ifndef ART_LIBARTBASE_BASE_INDENTER_H_
+#define ART_LIBARTBASE_BASE_INDENTER_H_
#include <ostream>
#include <streambuf>
@@ -160,4 +160,4 @@ class ScopedIndentation {
} // namespace art
-#endif // ART_RUNTIME_INDENTER_H_
+#endif // ART_LIBARTBASE_BASE_INDENTER_H_
diff --git a/runtime/indenter_test.cc b/libartbase/base/indenter_test.cc
index 09c0c54e5a..09c0c54e5a 100644
--- a/runtime/indenter_test.cc
+++ b/libartbase/base/indenter_test.cc
diff --git a/libartbase/base/logging_test.cc b/libartbase/base/logging_test.cc
index 404e080b03..1456eb30fa 100644
--- a/libartbase/base/logging_test.cc
+++ b/libartbase/base/logging_test.cc
@@ -21,7 +21,7 @@
#include "android-base/logging.h"
#include "base/bit_utils.h"
#include "base/macros.h"
-#include "common_runtime_test.h"
+#include "gtest/gtest.h"
#include "runtime_debug.h"
namespace art {
@@ -31,9 +31,9 @@ static void SimpleAborter(const char* msg) {
_exit(1);
}
-class LoggingTest : public CommonRuntimeTest {
+class LoggingTest : public testing::Test {
protected:
- void PostRuntimeCreate() OVERRIDE {
+ LoggingTest() {
// In our abort tests we really don't want the runtime to create a real dump.
android::base::SetAborter(SimpleAborter);
}
diff --git a/libartbase/base/safe_copy_test.cc b/libartbase/base/safe_copy_test.cc
index a9ec9528a1..f1d7c55e77 100644
--- a/libartbase/base/safe_copy_test.cc
+++ b/libartbase/base/safe_copy_test.cc
@@ -16,14 +16,15 @@
#include "safe_copy.h"
-#include "common_runtime_test.h"
-
#include <errno.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/user.h>
-#include "globals.h"
+#include "android-base/logging.h"
+#include "base/globals.h"
+#include "gtest/gtest.h"
+
namespace art {
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index 3fd61ee251..b2c041c81f 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -32,6 +32,7 @@ cc_defaults {
"dex/modifiers.cc",
"dex/primitive.cc",
"dex/standard_dex_file.cc",
+ "dex/type_lookup_table.cc",
"dex/utf.cc",
],
@@ -123,6 +124,7 @@ art_cc_test {
"dex/dex_instruction_test.cc",
"dex/primitive_test.cc",
"dex/string_reference_test.cc",
+ "dex/type_lookup_table_test.cc",
"dex/utf_test.cc",
],
shared_libs: [
diff --git a/runtime/type_lookup_table.cc b/libdexfile/dex/type_lookup_table.cc
index 7e204fc03a..ca5ec2f798 100644
--- a/runtime/type_lookup_table.cc
+++ b/libdexfile/dex/type_lookup_table.cc
@@ -20,7 +20,6 @@
#include <memory>
#include "base/bit_utils.h"
-#include "base/utils.h"
#include "dex/dex_file-inl.h"
#include "dex/utf-inl.h"
diff --git a/runtime/type_lookup_table.h b/libdexfile/dex/type_lookup_table.h
index 3352d60ed1..0ba2b75dc6 100644
--- a/runtime/type_lookup_table.h
+++ b/libdexfile/dex/type_lookup_table.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_RUNTIME_TYPE_LOOKUP_TABLE_H_
-#define ART_RUNTIME_TYPE_LOOKUP_TABLE_H_
+#ifndef ART_LIBDEXFILE_DEX_TYPE_LOOKUP_TABLE_H_
+#define ART_LIBDEXFILE_DEX_TYPE_LOOKUP_TABLE_H_
#include "base/leb128.h"
#include "dex/dex_file_types.h"
@@ -172,4 +172,4 @@ class TypeLookupTable {
} // namespace art
-#endif // ART_RUNTIME_TYPE_LOOKUP_TABLE_H_
+#endif // ART_LIBDEXFILE_DEX_TYPE_LOOKUP_TABLE_H_
diff --git a/runtime/type_lookup_table_test.cc b/libdexfile/dex/type_lookup_table_test.cc
index b6ab6da78c..b6ab6da78c 100644
--- a/runtime/type_lookup_table_test.cc
+++ b/libdexfile/dex/type_lookup_table_test.cc
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 3bff123386..7530a9c5a8 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -34,6 +34,7 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
#include "base/bit_utils_iterator.h"
+#include "base/indenter.h"
#include "base/os.h"
#include "base/safe_map.h"
#include "base/stl_util.h"
@@ -49,6 +50,7 @@
#include "dex/dex_file-inl.h"
#include "dex/dex_instruction-inl.h"
#include "dex/string_reference.h"
+#include "dex/type_lookup_table.h"
#include "disassembler.h"
#include "gc/accounting/space_bitmap-inl.h"
#include "gc/space/image_space.h"
@@ -56,7 +58,6 @@
#include "gc/space/space-inl.h"
#include "image-inl.h"
#include "imtable-inl.h"
-#include "indenter.h"
#include "subtype_check.h"
#include "index_bss_mapping.h"
#include "interpreter/unstarted_runtime.h"
@@ -75,7 +76,6 @@
#include "stack.h"
#include "stack_map.h"
#include "thread_list.h"
-#include "type_lookup_table.h"
#include "vdex_file.h"
#include "verifier/method_verifier.h"
#include "verifier/verifier_deps.h"
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 00d4a6080a..d643509af7 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -199,7 +199,6 @@ cc_defaults {
"ti/agent.cc",
"trace.cc",
"transaction.cc",
- "type_lookup_table.cc",
"vdex_file.cc",
"verifier/instruction_flags.cc",
"verifier/method_verifier.cc",
@@ -571,7 +570,6 @@ art_cc_test {
"handle_scope_test.cc",
"hidden_api_test.cc",
"imtable_test.cc",
- "indenter_test.cc",
"indirect_reference_table_test.cc",
"instrumentation_test.cc",
"intern_table_test.cc",
@@ -598,7 +596,6 @@ art_cc_test {
"subtype_check_test.cc",
"thread_pool_test.cc",
"transaction_test.cc",
- "type_lookup_table_test.cc",
"vdex_file_test.cc",
"verifier/method_verifier_test.cc",
"verifier/reg_type_test.cc",
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index cfbcda36b9..bda6604724 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -49,6 +49,7 @@
#include "dex/dex_file_loader.h"
#include "dex/dex_file_types.h"
#include "dex/standard_dex_file.h"
+#include "dex/type_lookup_table.h"
#include "dex/utf-inl.h"
#include "elf_file.h"
#include "elf_utils.h"
@@ -61,7 +62,6 @@
#include "oat_file-inl.h"
#include "oat_file_manager.h"
#include "runtime.h"
-#include "type_lookup_table.h"
#include "vdex_file.h"
namespace art {
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index 24868dd55d..6494b4c58e 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -32,11 +32,11 @@
#include "compiler_filter.h"
#include "dex/dex_file.h"
#include "dex/dex_file_layout.h"
+#include "dex/type_lookup_table.h"
#include "dex/utf.h"
#include "index_bss_mapping.h"
#include "mirror/object.h"
#include "oat.h"
-#include "type_lookup_table.h"
namespace art {
diff --git a/runtime/stack_map.cc b/runtime/stack_map.cc
index 250ff2af1a..9c7b6875cf 100644
--- a/runtime/stack_map.cc
+++ b/runtime/stack_map.cc
@@ -19,7 +19,7 @@
#include <stdint.h>
#include "art_method.h"
-#include "indenter.h"
+#include "base/indenter.h"
#include "scoped_thread_state_change-inl.h"
namespace art {
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index cee717610d..72292c33f8 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -25,6 +25,7 @@
#include "base/aborting.h"
#include "base/enums.h"
#include "base/leb128.h"
+#include "base/indenter.h"
#include "base/logging.h" // For VLOG.
#include "base/mutex-inl.h"
#include "base/stl_util.h"
@@ -41,7 +42,6 @@
#include "experimental_flags.h"
#include "gc/accounting/card_table-inl.h"
#include "handle_scope-inl.h"
-#include "indenter.h"
#include "intern_table.h"
#include "mirror/class-inl.h"
#include "mirror/class.h"
diff --git a/runtime/verifier/verifier_deps.cc b/runtime/verifier/verifier_deps.cc
index 4772e538aa..fe839f7312 100644
--- a/runtime/verifier/verifier_deps.cc
+++ b/runtime/verifier/verifier_deps.cc
@@ -20,11 +20,11 @@
#include "art_field-inl.h"
#include "art_method-inl.h"
+#include "base/indenter.h"
#include "base/leb128.h"
#include "base/stl_util.h"
#include "compiler_callbacks.h"
#include "dex/dex_file-inl.h"
-#include "indenter.h"
#include "mirror/class-inl.h"
#include "mirror/class_loader.h"
#include "obj_ptr-inl.h"