summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2019-03-04 12:53:20 +0000
committer Vladimir Marko <vmarko@google.com> 2019-03-11 06:59:41 +0000
commit327497e303903f300b01f77f2259fd5b61238ee3 (patch)
tree3f714d2d2ee7d9b6c0ecf71a10c157d4952e5758
parentef764ad3e6d7f07ea9e32642dc3e163bb4eb44fb (diff)
Move CompilerDriver to dex2oat/.
Also DexToDexCompiler, QuickCompilerCallbacks and tests. aosp_taimen-userdebug: - before: lib64/libart-compiler.so: 3112344 lib/libart-compiler.so: 2312908 bin/dex2oat: 563176 - after: lib64/libart-compiler.so: 2986720 (-123KiB) lib/libart-compiler.so: 2219852 (-91KiB) bin/dex2oat: 635832 (+71KiB) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Change-Id: I36e63b83dff1d5c731d05de27d3663cfc81de6ad
-rw-r--r--CleanSpec.mk1
-rw-r--r--compiler/Android.bp9
-rw-r--r--compiler/trampolines/trampoline_compiler.h12
-rw-r--r--dex2oat/Android.bp32
-rw-r--r--dex2oat/common_compiler_driver_test.cc (renamed from compiler/common_compiler_driver_test.cc)2
-rw-r--r--dex2oat/common_compiler_driver_test.h (renamed from compiler/common_compiler_driver_test.h)8
-rw-r--r--dex2oat/dex/dex_to_dex_compiler.cc (renamed from compiler/dex/dex_to_dex_compiler.cc)0
-rw-r--r--dex2oat/dex/dex_to_dex_compiler.h (renamed from compiler/dex/dex_to_dex_compiler.h)6
-rw-r--r--dex2oat/dex/dex_to_dex_decompiler_test.cc (renamed from compiler/dex/dex_to_dex_decompiler_test.cc)0
-rw-r--r--dex2oat/dex/quick_compiler_callbacks.cc (renamed from compiler/dex/quick_compiler_callbacks.cc)2
-rw-r--r--dex2oat/dex/quick_compiler_callbacks.h (renamed from compiler/dex/quick_compiler_callbacks.h)6
-rw-r--r--dex2oat/driver/compiler_driver-inl.h (renamed from compiler/driver/compiler_driver-inl.h)8
-rw-r--r--dex2oat/driver/compiler_driver.cc (renamed from compiler/driver/compiler_driver.cc)2
-rw-r--r--dex2oat/driver/compiler_driver.h (renamed from compiler/driver/compiler_driver.h)15
-rw-r--r--dex2oat/driver/compiler_driver_test.cc (renamed from compiler/driver/compiler_driver_test.cc)0
-rw-r--r--dex2oat/verifier_deps_test.cc (renamed from compiler/verifier_deps_test.cc)0
16 files changed, 64 insertions, 39 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 55c7285811..b40f4711c3 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -60,6 +60,7 @@ $(call add-clean-step, rm -f $(PRODUCT_OUT)/system/lib*/libpac.so)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest*/art_libdexfile_support_tests/dex_file_supp_test)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest*/)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest*/)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/nativetest*/)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/compiler/Android.bp b/compiler/Android.bp
index 04c6cc5b1f..341727dc0d 100644
--- a/compiler/Android.bp
+++ b/compiler/Android.bp
@@ -27,13 +27,10 @@ art_cc_defaults {
"compiled_method.cc",
"debug/elf_debug_writer.cc",
"debug/xz_utils.cc",
- "dex/dex_to_dex_compiler.cc",
"dex/inline_method_analyser.cc",
"dex/verified_method.cc",
"dex/verification_results.cc",
- "dex/quick_compiler_callbacks.cc",
"driver/compiled_method_storage.cc",
- "driver/compiler_driver.cc",
"driver/compiler_options.cc",
"driver/dex_compilation_unit.cc",
"linker/buffered_output_stream.cc",
@@ -204,8 +201,6 @@ gensrcs {
cmd: "$(location generate_operator_out) art/compiler $(in) > $(out)",
tools: ["generate_operator_out"],
srcs: [
- "dex/dex_to_dex_compiler.h",
- "driver/compiler_driver.h",
"driver/compiler_options.h",
"linker/linker_patch.h",
"optimizing/locations.h",
@@ -340,7 +335,6 @@ art_cc_library {
name: "libart-compiler-gtest",
defaults: ["libart-gtest-defaults"],
srcs: [
- "common_compiler_driver_test.cc",
"common_compiler_test.cc",
],
shared_libs: [
@@ -359,9 +353,7 @@ art_cc_test {
srcs: [
"debug/dwarf/dwarf_test.cc",
"debug/src_map_elem_test.cc",
- "dex/dex_to_dex_decompiler_test.cc",
"driver/compiled_method_storage_test.cc",
- "driver/compiler_driver_test.cc",
"exception_test.cc",
"jni/jni_compiler_test.cc",
"linker/linker_patch_test.cc",
@@ -394,7 +386,6 @@ art_cc_test {
"utils/dedupe_set_test.cc",
"utils/intrusive_forward_list_test.cc",
"utils/swap_space_test.cc",
- "verifier_deps_test.cc",
"jni/jni_cfi_test.cc",
"optimizing/codegen_test.cc",
diff --git a/compiler/trampolines/trampoline_compiler.h b/compiler/trampolines/trampoline_compiler.h
index 64c1eb5022..f0086b58d5 100644
--- a/compiler/trampolines/trampoline_compiler.h
+++ b/compiler/trampolines/trampoline_compiler.h
@@ -18,13 +18,23 @@
#define ART_COMPILER_TRAMPOLINES_TRAMPOLINE_COMPILER_H_
#include <stdint.h>
+#include <memory>
#include <vector>
-#include "driver/compiler_driver.h"
+#include "arch/instruction_set.h"
#include "offsets.h"
namespace art {
+enum EntryPointCallingConvention {
+ // ABI of invocations to a method's interpreter entry point.
+ kInterpreterAbi,
+ // ABI of calls to a method's native code, only used for native methods.
+ kJniAbi,
+ // ABI of calls to a method's quick code entry point.
+ kQuickAbi
+};
+
// Create code that will invoke the function held in thread local storage.
std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline32(InstructionSet isa,
EntryPointCallingConvention abi,
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index 20d41b4d0a..a196737d4c 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -19,6 +19,9 @@ art_cc_defaults {
defaults: ["art_defaults"],
host_supported: true,
srcs: [
+ "dex/dex_to_dex_compiler.cc",
+ "dex/quick_compiler_callbacks.cc",
+ "driver/compiler_driver.cc",
"linker/elf_writer.cc",
"linker/elf_writer_quick.cc",
"linker/image_writer.cc",
@@ -102,6 +105,8 @@ gensrcs {
cmd: "$(location generate_operator_out) art/dex2oat $(in) > $(out)",
tools: ["generate_operator_out"],
srcs: [
+ "dex/dex_to_dex_compiler.h",
+ "driver/compiler_driver.h",
"linker/image_writer.h",
],
output_extension: "operator_out.cc",
@@ -114,6 +119,7 @@ art_cc_library_static {
"libart-compiler",
"libart-dexlayout",
"libart",
+ "libartpalette",
"libprofile",
],
}
@@ -142,6 +148,7 @@ art_cc_library_static {
"libartd-compiler",
"libartd-dexlayout",
"libartd",
+ "libartpalette",
"libprofiled",
],
}
@@ -240,6 +247,7 @@ art_cc_binary {
"libart",
"libdexfile",
"libartbase",
+ "libartpalette",
"libbase",
"libsigchain",
],
@@ -285,6 +293,7 @@ art_cc_binary {
"libartd",
"libdexfiled",
"libartbased",
+ "libartpalette",
"libbase",
"libsigchain",
],
@@ -380,6 +389,24 @@ art_cc_binary {
use_clang_lld: false,
}
+art_cc_library_static {
+ name: "libart-dex2oat-gtest",
+ defaults: ["libart-gtest-defaults"],
+ srcs: [
+ "common_compiler_driver_test.cc",
+ ],
+ shared_libs: [
+ "libartd-compiler",
+ "libartd-disassembler",
+ "libart-compiler-gtest",
+ "libart-runtime-gtest",
+ "libbase",
+ ],
+ static_libs: [
+ "libartd-dex2oat",
+ ],
+}
+
art_cc_test {
name: "art_dex2oat_tests",
defaults: [
@@ -388,12 +415,15 @@ art_cc_test {
srcs: [
"dex2oat_test.cc",
"dex2oat_image_test.cc",
+ "dex/dex_to_dex_decompiler_test.cc",
+ "driver/compiler_driver_test.cc",
"linker/elf_writer_test.cc",
"linker/image_test.cc",
"linker/image_write_read_test.cc",
"linker/index_bss_mapping_encoder_test.cc",
"linker/multi_oat_relative_patcher_test.cc",
"linker/oat_writer_test.cc",
+ "verifier_deps_test.cc",
],
codegen: {
@@ -438,12 +468,14 @@ art_cc_test {
"libartbased",
"libartd-compiler",
"libartd-dexlayout",
+ "libartpalette",
"libbase",
"libprofiled",
"libsigchain",
"libziparchive",
],
static_libs: [
+ "libart-dex2oat-gtest",
"libartd-dex2oat",
],
}
diff --git a/compiler/common_compiler_driver_test.cc b/dex2oat/common_compiler_driver_test.cc
index bba2c2f1c2..db64fe4851 100644
--- a/compiler/common_compiler_driver_test.cc
+++ b/dex2oat/common_compiler_driver_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2019 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.
diff --git a/compiler/common_compiler_driver_test.h b/dex2oat/common_compiler_driver_test.h
index e3354d4ad4..1ff88e5b61 100644
--- a/compiler/common_compiler_driver_test.h
+++ b/dex2oat/common_compiler_driver_test.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_COMMON_COMPILER_DRIVER_TEST_H_
-#define ART_COMPILER_COMMON_COMPILER_DRIVER_TEST_H_
+#ifndef ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_
+#define ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_
#include <vector>
@@ -71,4 +71,4 @@ class CommonCompilerDriverTest : public CommonCompilerTest {
} // namespace art
-#endif // ART_COMPILER_COMMON_COMPILER_DRIVER_TEST_H_
+#endif // ART_DEX2OAT_COMMON_COMPILER_DRIVER_TEST_H_
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/dex2oat/dex/dex_to_dex_compiler.cc
index 23ce37ef1a..23ce37ef1a 100644
--- a/compiler/dex/dex_to_dex_compiler.cc
+++ b/dex2oat/dex/dex_to_dex_compiler.cc
diff --git a/compiler/dex/dex_to_dex_compiler.h b/dex2oat/dex/dex_to_dex_compiler.h
index 78309ae7ac..06e16e40d2 100644
--- a/compiler/dex/dex_to_dex_compiler.h
+++ b/dex2oat/dex/dex_to_dex_compiler.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_DEX_DEX_TO_DEX_COMPILER_H_
-#define ART_COMPILER_DEX_DEX_TO_DEX_COMPILER_H_
+#ifndef ART_DEX2OAT_DEX_DEX_TO_DEX_COMPILER_H_
+#define ART_DEX2OAT_DEX_DEX_TO_DEX_COMPILER_H_
#include <set>
#include <unordered_map>
@@ -123,4 +123,4 @@ std::ostream& operator<<(std::ostream& os, const DexToDexCompiler::CompilationLe
} // namespace art
-#endif // ART_COMPILER_DEX_DEX_TO_DEX_COMPILER_H_
+#endif // ART_DEX2OAT_DEX_DEX_TO_DEX_COMPILER_H_
diff --git a/compiler/dex/dex_to_dex_decompiler_test.cc b/dex2oat/dex/dex_to_dex_decompiler_test.cc
index b5525dc6a4..b5525dc6a4 100644
--- a/compiler/dex/dex_to_dex_decompiler_test.cc
+++ b/dex2oat/dex/dex_to_dex_decompiler_test.cc
diff --git a/compiler/dex/quick_compiler_callbacks.cc b/dex2oat/dex/quick_compiler_callbacks.cc
index baf97a852e..c277f033d2 100644
--- a/compiler/dex/quick_compiler_callbacks.cc
+++ b/dex2oat/dex/quick_compiler_callbacks.cc
@@ -16,12 +16,12 @@
#include "quick_compiler_callbacks.h"
+#include "dex/verification_results.h"
#include "driver/compiler_driver.h"
#include "mirror/class-inl.h"
#include "mirror/object.h"
#include "obj_ptr-inl.h"
#include "thread-current-inl.h"
-#include "verification_results.h"
#include "verifier/method_verifier-inl.h"
namespace art {
diff --git a/compiler/dex/quick_compiler_callbacks.h b/dex2oat/dex/quick_compiler_callbacks.h
index e92b67a0e8..578a1f56e7 100644
--- a/compiler/dex/quick_compiler_callbacks.h
+++ b/dex2oat/dex/quick_compiler_callbacks.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_
-#define ART_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_
+#ifndef ART_DEX2OAT_DEX_QUICK_COMPILER_CALLBACKS_H_
+#define ART_DEX2OAT_DEX_QUICK_COMPILER_CALLBACKS_H_
#include "compiler_callbacks.h"
#include "verifier/verifier_deps.h"
@@ -78,4 +78,4 @@ class QuickCompilerCallbacks final : public CompilerCallbacks {
} // namespace art
-#endif // ART_COMPILER_DEX_QUICK_COMPILER_CALLBACKS_H_
+#endif // ART_DEX2OAT_DEX_QUICK_COMPILER_CALLBACKS_H_
diff --git a/compiler/driver/compiler_driver-inl.h b/dex2oat/driver/compiler_driver-inl.h
index ec2e38bc7f..7bc2f02bb5 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/dex2oat/driver/compiler_driver-inl.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_DRIVER_COMPILER_DRIVER_INL_H_
-#define ART_COMPILER_DRIVER_COMPILER_DRIVER_INL_H_
+#ifndef ART_DEX2OAT_DRIVER_COMPILER_DRIVER_INL_H_
+#define ART_DEX2OAT_DRIVER_COMPILER_DRIVER_INL_H_
#include "compiler_driver.h"
@@ -23,7 +23,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
#include "class_linker-inl.h"
-#include "dex_compilation_unit.h"
+#include "driver/dex_compilation_unit.h"
#include "handle_scope-inl.h"
#include "mirror/class_loader.h"
#include "mirror/dex_cache-inl.h"
@@ -101,4 +101,4 @@ inline std::pair<bool, bool> CompilerDriver::IsFastInstanceField(
} // namespace art
-#endif // ART_COMPILER_DRIVER_COMPILER_DRIVER_INL_H_
+#endif // ART_DEX2OAT_DRIVER_COMPILER_DRIVER_INL_H_
diff --git a/compiler/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc
index 3be5627c13..4b6115ac0a 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/dex2oat/driver/compiler_driver.cc
@@ -54,8 +54,8 @@
#include "dex/dex_to_dex_compiler.h"
#include "dex/verification_results.h"
#include "dex/verified_method.h"
-#include "dex_compilation_unit.h"
#include "driver/compiler_options.h"
+#include "driver/dex_compilation_unit.h"
#include "gc/accounting/card_table-inl.h"
#include "gc/accounting/heap_bitmap.h"
#include "gc/space/image_space.h"
diff --git a/compiler/driver/compiler_driver.h b/dex2oat/driver/compiler_driver.h
index 85f0e172e9..b474de5f8d 100644
--- a/compiler/driver/compiler_driver.h
+++ b/dex2oat/driver/compiler_driver.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_COMPILER_DRIVER_COMPILER_DRIVER_H_
-#define ART_COMPILER_DRIVER_COMPILER_DRIVER_H_
+#ifndef ART_DEX2OAT_DRIVER_COMPILER_DRIVER_H_
+#define ART_DEX2OAT_DRIVER_COMPILER_DRIVER_H_
#include <atomic>
#include <set>
@@ -79,15 +79,6 @@ class TimingLogger;
class VdexFile;
class VerificationResults;
-enum EntryPointCallingConvention {
- // ABI of invocations to a method's interpreter entry point.
- kInterpreterAbi,
- // ABI of calls to a method's native code, only used for native methods.
- kJniAbi,
- // ABI of calls to a method's quick code entry point.
- kQuickAbi
-};
-
class CompilerDriver {
public:
// Create a compiler targeting the requested "instruction_set".
@@ -357,4 +348,4 @@ class CompilerDriver {
} // namespace art
-#endif // ART_COMPILER_DRIVER_COMPILER_DRIVER_H_
+#endif // ART_DEX2OAT_DRIVER_COMPILER_DRIVER_H_
diff --git a/compiler/driver/compiler_driver_test.cc b/dex2oat/driver/compiler_driver_test.cc
index dd2b3abe14..dd2b3abe14 100644
--- a/compiler/driver/compiler_driver_test.cc
+++ b/dex2oat/driver/compiler_driver_test.cc
diff --git a/compiler/verifier_deps_test.cc b/dex2oat/verifier_deps_test.cc
index b2277adb67..b2277adb67 100644
--- a/compiler/verifier_deps_test.cc
+++ b/dex2oat/verifier_deps_test.cc