Svelter libart-compiler
Added new environment variable ART_{TARGET,HOST}_CODEGEN_ARCHS which
may be set to 'all', 'svelte' or a space separated list of architectures.
When compiled with ART_{TARGET,HOST}_CODEGEN_ARCHS='all' (the default
value) dex2oat will be able to generate output for all supported
architectures.
When compiled with ART_TARGET_CODEGEN_ARCHS='svelte'
only the architectures of the TARGET will be included. When
ART_HOST_CODEGEN_ARCHS='svelte' all architectures the target includes
and the host architectures will be included on the host dex2oat.
If a list of architectures is given only those will be included.
Change-Id: I87f4ad0131ab1b37544d8799e947ce4733b6daec
diff --git a/compiler/Android.mk b/compiler/Android.mk
index 4944915..7d368a2 100644
--- a/compiler/Android.mk
+++ b/compiler/Android.mk
@@ -24,18 +24,6 @@
dex/gvn_dead_code_elimination.cc \
dex/local_value_numbering.cc \
dex/type_inference.cc \
- dex/quick/arm/assemble_arm.cc \
- dex/quick/arm/call_arm.cc \
- dex/quick/arm/fp_arm.cc \
- dex/quick/arm/int_arm.cc \
- dex/quick/arm/target_arm.cc \
- dex/quick/arm/utility_arm.cc \
- dex/quick/arm64/assemble_arm64.cc \
- dex/quick/arm64/call_arm64.cc \
- dex/quick/arm64/fp_arm64.cc \
- dex/quick/arm64/int_arm64.cc \
- dex/quick/arm64/target_arm64.cc \
- dex/quick/arm64/utility_arm64.cc \
dex/quick/codegen_util.cc \
dex/quick/dex_file_method_inliner.cc \
dex/quick/dex_file_to_method_inliner_map.cc \
@@ -44,22 +32,10 @@
dex/quick/gen_loadstore.cc \
dex/quick/lazy_debug_frame_opcode_writer.cc \
dex/quick/local_optimizations.cc \
- dex/quick/mips/assemble_mips.cc \
- dex/quick/mips/call_mips.cc \
- dex/quick/mips/fp_mips.cc \
- dex/quick/mips/int_mips.cc \
- dex/quick/mips/target_mips.cc \
- dex/quick/mips/utility_mips.cc \
dex/quick/mir_to_lir.cc \
dex/quick/quick_compiler.cc \
dex/quick/ralloc_util.cc \
dex/quick/resource_mask.cc \
- dex/quick/x86/assemble_x86.cc \
- dex/quick/x86/call_x86.cc \
- dex/quick/x86/fp_x86.cc \
- dex/quick/x86/int_x86.cc \
- dex/quick/x86/target_x86.cc \
- dex/quick/x86/utility_x86.cc \
dex/dex_to_dex_compiler.cc \
dex/bb_optimizations.cc \
dex/compiler_ir.cc \
@@ -82,30 +58,13 @@
driver/compiler_options.cc \
driver/dex_compilation_unit.cc \
linker/relative_patcher.cc \
- linker/arm/relative_patcher_arm_base.cc \
- linker/arm/relative_patcher_thumb2.cc \
- linker/arm64/relative_patcher_arm64.cc \
- linker/x86/relative_patcher_x86_base.cc \
- linker/x86/relative_patcher_x86.cc \
- linker/x86_64/relative_patcher_x86_64.cc \
jit/jit_compiler.cc \
- jni/quick/arm/calling_convention_arm.cc \
- jni/quick/arm64/calling_convention_arm64.cc \
- jni/quick/mips/calling_convention_mips.cc \
- jni/quick/mips64/calling_convention_mips64.cc \
- jni/quick/x86/calling_convention_x86.cc \
- jni/quick/x86_64/calling_convention_x86_64.cc \
jni/quick/calling_convention.cc \
jni/quick/jni_compiler.cc \
optimizing/boolean_simplifier.cc \
optimizing/builder.cc \
optimizing/bounds_check_elimination.cc \
optimizing/code_generator.cc \
- optimizing/code_generator_arm.cc \
- optimizing/code_generator_arm64.cc \
- optimizing/code_generator_mips64.cc \
- optimizing/code_generator_x86.cc \
- optimizing/code_generator_x86_64.cc \
optimizing/code_generator_utils.cc \
optimizing/constant_folding.cc \
optimizing/dead_code_elimination.cc \
@@ -115,10 +74,6 @@
optimizing/inliner.cc \
optimizing/instruction_simplifier.cc \
optimizing/intrinsics.cc \
- optimizing/intrinsics_arm.cc \
- optimizing/intrinsics_arm64.cc \
- optimizing/intrinsics_x86.cc \
- optimizing/intrinsics_x86_64.cc \
optimizing/licm.cc \
optimizing/locations.cc \
optimizing/nodes.cc \
@@ -136,21 +91,7 @@
optimizing/stack_map_stream.cc \
trampolines/trampoline_compiler.cc \
utils/arena_bit_vector.cc \
- utils/arm/assembler_arm.cc \
- utils/arm/assembler_arm32.cc \
- utils/arm/assembler_thumb2.cc \
- utils/arm/managed_register_arm.cc \
- utils/arm64/assembler_arm64.cc \
- utils/arm64/managed_register_arm64.cc \
utils/assembler.cc \
- utils/mips/assembler_mips.cc \
- utils/mips/managed_register_mips.cc \
- utils/mips64/assembler_mips64.cc \
- utils/mips64/managed_register_mips64.cc \
- utils/x86/assembler_x86.cc \
- utils/x86/managed_register_x86.cc \
- utils/x86_64/assembler_x86_64.cc \
- utils/x86_64/managed_register_x86_64.cc \
utils/swap_space.cc \
buffered_output_stream.cc \
compiler.cc \
@@ -163,12 +104,89 @@
output_stream.cc \
vector_output_stream.cc
+LIBART_COMPILER_SRC_FILES_arm := \
+ dex/quick/arm/assemble_arm.cc \
+ dex/quick/arm/call_arm.cc \
+ dex/quick/arm/fp_arm.cc \
+ dex/quick/arm/int_arm.cc \
+ dex/quick/arm/target_arm.cc \
+ dex/quick/arm/utility_arm.cc \
+ jni/quick/arm/calling_convention_arm.cc \
+ linker/arm/relative_patcher_arm_base.cc \
+ linker/arm/relative_patcher_thumb2.cc \
+ optimizing/code_generator_arm.cc \
+ optimizing/intrinsics_arm.cc \
+ utils/arm/assembler_arm.cc \
+ utils/arm/assembler_arm32.cc \
+ utils/arm/assembler_thumb2.cc \
+ utils/arm/managed_register_arm.cc \
+
+# TODO We should really separate out those files that are actually needed for both variants of an
+# architecture into its own category. Currently we just include all of the 32bit variant in the
+# 64bit variant. It also might be good to allow one to compile only the 64bit variant without the
+# 32bit one.
+LIBART_COMPILER_SRC_FILES_arm64 := \
+ $(LIBART_COMPILER_SRC_FILES_arm) \
+ dex/quick/arm64/assemble_arm64.cc \
+ dex/quick/arm64/call_arm64.cc \
+ dex/quick/arm64/fp_arm64.cc \
+ dex/quick/arm64/int_arm64.cc \
+ dex/quick/arm64/target_arm64.cc \
+ dex/quick/arm64/utility_arm64.cc \
+ jni/quick/arm64/calling_convention_arm64.cc \
+ linker/arm64/relative_patcher_arm64.cc \
+ optimizing/code_generator_arm64.cc \
+ optimizing/intrinsics_arm64.cc \
+ utils/arm64/assembler_arm64.cc \
+ utils/arm64/managed_register_arm64.cc \
+
+LIBART_COMPILER_SRC_FILES_mips := \
+ dex/quick/mips/assemble_mips.cc \
+ dex/quick/mips/call_mips.cc \
+ dex/quick/mips/fp_mips.cc \
+ dex/quick/mips/int_mips.cc \
+ dex/quick/mips/target_mips.cc \
+ dex/quick/mips/utility_mips.cc \
+ jni/quick/mips/calling_convention_mips.cc \
+ utils/mips/assembler_mips.cc \
+ utils/mips/managed_register_mips.cc \
+
+LIBART_COMPILER_SRC_FILES_mips64 := \
+ $(LIBART_COMPILER_SRC_FILES_mips) \
+ jni/quick/mips64/calling_convention_mips64.cc \
+ optimizing/code_generator_mips64.cc \
+ utils/mips64/assembler_mips64.cc \
+ utils/mips64/managed_register_mips64.cc \
+
+
+LIBART_COMPILER_SRC_FILES_x86 := \
+ dex/quick/x86/assemble_x86.cc \
+ dex/quick/x86/call_x86.cc \
+ dex/quick/x86/fp_x86.cc \
+ dex/quick/x86/int_x86.cc \
+ dex/quick/x86/target_x86.cc \
+ dex/quick/x86/utility_x86.cc \
+ jni/quick/x86/calling_convention_x86.cc \
+ linker/x86/relative_patcher_x86.cc \
+ linker/x86/relative_patcher_x86_base.cc \
+ optimizing/code_generator_x86.cc \
+ optimizing/intrinsics_x86.cc \
+ utils/x86/assembler_x86.cc \
+ utils/x86/managed_register_x86.cc \
+
+LIBART_COMPILER_SRC_FILES_x86_64 := \
+ $(LIBART_COMPILER_SRC_FILES_x86) \
+ jni/quick/x86_64/calling_convention_x86_64.cc \
+ linker/x86_64/relative_patcher_x86_64.cc \
+ optimizing/intrinsics_x86_64.cc \
+ optimizing/code_generator_x86_64.cc \
+ utils/x86_64/assembler_x86_64.cc \
+ utils/x86_64/managed_register_x86_64.cc \
+
+
LIBART_COMPILER_CFLAGS :=
LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES := \
- dex/quick/arm/arm_lir.h \
- dex/quick/arm64/arm64_lir.h \
- dex/quick/mips/mips_lir.h \
dex/quick/resource_mask.h \
dex/compiler_enums.h \
dex/dex_to_dex_compiler.h \
@@ -177,9 +195,26 @@
driver/compiler_driver.h \
driver/compiler_options.h \
image_writer.h \
- optimizing/locations.h \
+ optimizing/locations.h
+
+LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_arm := \
+ dex/quick/arm/arm_lir.h \
utils/arm/constants_arm.h
+LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_arm64 := \
+ $(LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_arm) \
+ dex/quick/arm64/arm64_lir.h
+
+LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_mips := \
+ dex/quick/mips/mips_lir.h
+
+LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_mips64 := \
+ $(LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_mips)
+
+LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_x86 :=
+LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_x86_64 := \
+ $(LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_x86)
+
# $(1): target or host
# $(2): ndebug or debug
# $(3): static or shared (empty means shared, applies only for host)
@@ -202,6 +237,9 @@
include $(CLEAR_VARS)
ifeq ($$(art_target_or_host),host)
LOCAL_IS_HOST_MODULE := true
+ art_codegen_targets := $(ART_HOST_CODEGEN_ARCHS)
+ else
+ art_codegen_targets := $(ART_TARGET_CODEGEN_ARCHS)
endif
LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
ifeq ($$(art_ndebug_or_debug),ndebug)
@@ -230,10 +268,14 @@
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
endif
- LOCAL_SRC_FILES := $$(LIBART_COMPILER_SRC_FILES)
+ # Sort removes duplicates.
+ LOCAL_SRC_FILES := $$(LIBART_COMPILER_SRC_FILES) \
+ $$(sort $$(foreach arch,$$(art_codegen_targets), $$(LIBART_COMPILER_SRC_FILES_$$(arch))))
GENERATED_SRC_DIR := $$(call local-generated-sources-dir)
- ENUM_OPERATOR_OUT_CC_FILES := $$(patsubst %.h,%_operator_out.cc,$$(LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES))
+ ENUM_OPERATOR_OUT_CC_FILES := $$(patsubst %.h,%_operator_out.cc,\
+ $$(LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES) \
+ $$(sort $$(foreach arch,$$(art_codegen_targets), $$(LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES_$$(arch)))))
ENUM_OPERATOR_OUT_GEN := $$(addprefix $$(GENERATED_SRC_DIR)/,$$(ENUM_OPERATOR_OUT_CC_FILES))
$$(ENUM_OPERATOR_OUT_GEN): art/tools/generate-operator-out.py
@@ -326,6 +368,7 @@
art_target_or_host :=
art_ndebug_or_debug :=
art_static_or_shared :=
+ art_codegen_targets :=
endef
# We always build dex2oat and dependencies, even if the host build is otherwise disabled, since they are used to cross compile for the target.