diff options
47 files changed, 156 insertions, 146 deletions
diff --git a/build/Android.libart-compiler-llvm.mk b/build/Android.libart-compiler-llvm.mk index c8dda8a029..3265246a92 100644 --- a/build/Android.libart-compiler-llvm.mk +++ b/build/Android.libart-compiler-llvm.mk @@ -21,13 +21,12 @@ ifeq ($(ART_USE_PORTABLE_COMPILER),true) endif LIBART_COMPILER_LLVM_SRC_FILES += \ - src/elf_writer.cc \ src/compiler/write_elf.cc \ - src/compiler_llvm/compilation_unit.cc \ src/compiler_llvm/compiler_llvm.cc \ src/compiler_llvm/generated/art_module.cc \ src/compiler_llvm/ir_builder.cc \ src/compiler_llvm/jni_compiler.cc \ + src/compiler_llvm/llvm_compilation_unit.cc \ src/compiler_llvm/md_builder.cc \ src/compiler_llvm/runtime_support_builder.cc \ src/compiler_llvm/runtime_support_builder_arm.cc \ @@ -35,42 +34,43 @@ LIBART_COMPILER_LLVM_SRC_FILES += \ src/compiler_llvm/runtime_support_builder_x86.cc \ src/compiler_llvm/runtime_support_llvm.cc \ src/compiler_llvm/stub_compiler.cc \ + src/elf_writer.cc \ src/greenland/inferred_reg_category_map.cc ifeq ($(ART_USE_PORTABLE_COMPILER),true) LIBART_COMPILER_LLVM_SRC_FILES += \ - src/compiler/dataflow.cc \ - src/compiler/frontend.cc \ - src/compiler/ralloc.cc \ src/compiler/bb_opt.cc \ - src/compiler/ssa_transformation.cc \ - src/compiler/compiler_utility.cc \ - src/compiler/codegen/ralloc_util.cc \ - src/compiler/codegen/codegen_util.cc \ - src/compiler/codegen/gen_loadstore.cc \ - src/compiler/codegen/gen_common.cc \ - src/compiler/codegen/gen_invoke.cc \ - src/compiler/codegen/mir_to_gbc.cc \ - src/compiler/codegen/mir_to_lir.cc \ - src/compiler/codegen/local_optimizations.cc \ - src/compiler/codegen/arm/target_arm.cc \ src/compiler/codegen/arm/assemble_arm.cc \ - src/compiler/codegen/arm/utility_arm.cc \ src/compiler/codegen/arm/call_arm.cc \ src/compiler/codegen/arm/fp_arm.cc \ src/compiler/codegen/arm/int_arm.cc \ - src/compiler/codegen/mips/target_mips.cc \ + src/compiler/codegen/arm/target_arm.cc \ + src/compiler/codegen/arm/utility_arm.cc \ + src/compiler/codegen/codegen_util.cc \ + src/compiler/codegen/gen_common.cc \ + src/compiler/codegen/gen_invoke.cc \ + src/compiler/codegen/gen_loadstore.cc \ + src/compiler/codegen/local_optimizations.cc \ src/compiler/codegen/mips/assemble_mips.cc \ - src/compiler/codegen/mips/utility_mips.cc \ src/compiler/codegen/mips/call_mips.cc \ src/compiler/codegen/mips/fp_mips.cc \ src/compiler/codegen/mips/int_mips.cc \ - src/compiler/codegen/x86/target_x86.cc \ + src/compiler/codegen/mips/target_mips.cc \ + src/compiler/codegen/mips/utility_mips.cc \ + src/compiler/codegen/mir_to_gbc.cc \ + src/compiler/codegen/mir_to_lir.cc \ + src/compiler/codegen/ralloc_util.cc \ src/compiler/codegen/x86/assemble_x86.cc \ - src/compiler/codegen/x86/utility_x86.cc \ src/compiler/codegen/x86/call_x86.cc \ src/compiler/codegen/x86/fp_x86.cc \ src/compiler/codegen/x86/int_x86.cc \ + src/compiler/codegen/x86/target_x86.cc \ + src/compiler/codegen/x86/utility_x86.cc \ + src/compiler/compiler_utility.cc \ + src/compiler/dataflow.cc \ + src/compiler/frontend.cc \ + src/compiler/ralloc.cc \ + src/compiler/ssa_transformation.cc \ src/compiler_llvm/dalvik_reg.cc \ src/compiler_llvm/gbc_expander.cc \ src/compiler_llvm/method_compiler.cc \ diff --git a/build/Android.libart-compiler.mk b/build/Android.libart-compiler.mk index 339f5918b2..ce5d578d24 100644 --- a/build/Android.libart-compiler.mk +++ b/build/Android.libart-compiler.mk @@ -121,7 +121,7 @@ define build-libart-compiler LOCAL_SHARED_LIBRARIES += libbcc ifeq ($(ART_USE_PORTABLE_COMPILER),true) - ART_TEST_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 + LOCAL_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 endif LOCAL_C_INCLUDES += $(ART_C_INCLUDES) diff --git a/src/compiler/codegen/arm/arm_lir.h b/src/compiler/codegen/arm/arm_lir.h index 09b45b83f3..3fc87924cf 100644 --- a/src/compiler/codegen/arm/arm_lir.h +++ b/src/compiler/codegen/arm/arm_lir.h @@ -17,7 +17,7 @@ #ifndef ART_SRC_COMPILER_CODEGEN_ARM_ARMLIR_H_ #define ART_SRC_COMPILER_CODEGEN_ARM_ARMLIR_H_ -#include "../../compiler_internals.h" +#include "compiler/compiler_internals.h" namespace art { diff --git a/src/compiler/codegen/arm/assemble_arm.cc b/src/compiler/codegen/arm/assemble_arm.cc index 27544d82ec..91f25d68e6 100644 --- a/src/compiler/codegen/arm/assemble_arm.cc +++ b/src/compiler/codegen/arm/assemble_arm.cc @@ -16,7 +16,7 @@ #include "arm_lir.h" #include "codegen_arm.h" -#include "../codegen_util.h" +#include "compiler/codegen/codegen_util.h" namespace art { diff --git a/src/compiler/codegen/arm/call_arm.cc b/src/compiler/codegen/arm/call_arm.cc index 47306f402c..225c3349b5 100644 --- a/src/compiler/codegen/arm/call_arm.cc +++ b/src/compiler/codegen/arm/call_arm.cc @@ -16,12 +16,12 @@ /* This file contains codegen for the Thumb2 ISA. */ -#include "oat_compilation_unit.h" -#include "oat/runtime/oat_support_entrypoints.h" #include "arm_lir.h" #include "codegen_arm.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "oat/runtime/oat_support_entrypoints.h" +#include "oat_compilation_unit.h" namespace art { diff --git a/src/compiler/codegen/arm/codegen_arm.h b/src/compiler/codegen/arm/codegen_arm.h index 8d99049c6b..ea34ff2b26 100644 --- a/src/compiler/codegen/arm/codegen_arm.h +++ b/src/compiler/codegen/arm/codegen_arm.h @@ -17,7 +17,7 @@ #ifndef ART_SRC_COMPILER_CODEGEN_ARM_CODEGENARM_H_ #define ART_SRC_COMPILER_CODEGEN_ARM_CODEGENARM_H_ -#include "../../compiler_internals.h" +#include "compiler/compiler_internals.h" namespace art { diff --git a/src/compiler/codegen/arm/fp_arm.cc b/src/compiler/codegen/arm/fp_arm.cc index 57c55cc436..577e0ab150 100644 --- a/src/compiler/codegen/arm/fp_arm.cc +++ b/src/compiler/codegen/arm/fp_arm.cc @@ -16,8 +16,8 @@ #include "arm_lir.h" #include "codegen_arm.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" namespace art { diff --git a/src/compiler/codegen/arm/int_arm.cc b/src/compiler/codegen/arm/int_arm.cc index 6a1178e340..fcf74f1471 100644 --- a/src/compiler/codegen/arm/int_arm.cc +++ b/src/compiler/codegen/arm/int_arm.cc @@ -16,12 +16,12 @@ /* This file contains codegen for the Thumb2 ISA. */ -#include "oat_compilation_unit.h" -#include "oat/runtime/oat_support_entrypoints.h" #include "arm_lir.h" #include "codegen_arm.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "oat/runtime/oat_support_entrypoints.h" +#include "oat_compilation_unit.h" namespace art { diff --git a/src/compiler/codegen/arm/target_arm.cc b/src/compiler/codegen/arm/target_arm.cc index 493b4a9aca..f871f3da7a 100644 --- a/src/compiler/codegen/arm/target_arm.cc +++ b/src/compiler/codegen/arm/target_arm.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "../../compiler_internals.h" +#include <string> + #include "arm_lir.h" #include "codegen_arm.h" -#include "../ralloc_util.h" -#include "../codegen_util.h" - -#include <string> +#include "compiler/codegen/codegen_util.h" +#include "compiler/compiler_internals.h" +#include "compiler/codegen/ralloc_util.h" namespace art { diff --git a/src/compiler/codegen/arm/utility_arm.cc b/src/compiler/codegen/arm/utility_arm.cc index 5c25eee87a..433111c528 100644 --- a/src/compiler/codegen/arm/utility_arm.cc +++ b/src/compiler/codegen/arm/utility_arm.cc @@ -16,8 +16,8 @@ #include "arm_lir.h" #include "codegen_arm.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" namespace art { diff --git a/src/compiler/codegen/codegen.h b/src/compiler/codegen/codegen.h index 595a1dbb61..03ecb43171 100644 --- a/src/compiler/codegen/codegen.h +++ b/src/compiler/codegen/codegen.h @@ -17,7 +17,7 @@ #ifndef ART_SRC_COMPILER_CODEGEN_CODEGEN_H_ #define ART_SRC_COMPILER_CODEGEN_CODEGEN_H_ -#include "../compiler_ir.h" +#include "compiler/compiler_ir.h" namespace art { diff --git a/src/compiler/codegen/codegen_util.cc b/src/compiler/codegen/codegen_util.cc index 389a41380f..ad05b93c8d 100644 --- a/src/compiler/codegen/codegen_util.cc +++ b/src/compiler/codegen/codegen_util.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "../compiler_internals.h" +#include "compiler/compiler_internals.h" #include "gc_map.h" #include "verifier/dex_gc_map.h" #include "verifier/method_verifier.h" diff --git a/src/compiler/codegen/codegen_util.h b/src/compiler/codegen/codegen_util.h index 3bb4291767..4f146560b2 100644 --- a/src/compiler/codegen/codegen_util.h +++ b/src/compiler/codegen/codegen_util.h @@ -17,8 +17,15 @@ #ifndef ART_SRC_COMPILER_CODEGEN_CODEGENUTIL_H_ #define ART_SRC_COMPILER_CODEGEN_CODEGENUTIL_H_ +#include <stdint.h> + +#include "compiler/compiler_enums.h" + namespace art { +class CompilationUnit; +struct LIR; + void MarkSafepointPC(CompilationUnit* cu, LIR* inst); bool FastInstance(CompilationUnit* cu, uint32_t field_idx, int& field_offset, bool& is_volatile, bool is_put); diff --git a/src/compiler/codegen/gen_common.cc b/src/compiler/codegen/gen_common.cc index acaad5b26b..1d64a71848 100644 --- a/src/compiler/codegen/gen_common.cc +++ b/src/compiler/codegen/gen_common.cc @@ -14,10 +14,10 @@ * limitations under the License. */ +#include "codegen_util.h" +#include "compiler/compiler_ir.h" #include "oat/runtime/oat_support_entrypoints.h" -#include "../compiler_ir.h" #include "ralloc_util.h" -#include "codegen_util.h" namespace art { diff --git a/src/compiler/codegen/gen_invoke.cc b/src/compiler/codegen/gen_invoke.cc index 78425c40bd..816927f75d 100644 --- a/src/compiler/codegen/gen_invoke.cc +++ b/src/compiler/codegen/gen_invoke.cc @@ -14,10 +14,10 @@ * limitations under the License. */ +#include "codegen_util.h" +#include "compiler/compiler_ir.h" #include "oat/runtime/oat_support_entrypoints.h" -#include "../compiler_ir.h" #include "ralloc_util.h" -#include "codegen_util.h" #include "x86/codegen_x86.h" namespace art { diff --git a/src/compiler/codegen/gen_loadstore.cc b/src/compiler/codegen/gen_loadstore.cc index 6c16d40849..b183f9e245 100644 --- a/src/compiler/codegen/gen_loadstore.cc +++ b/src/compiler/codegen/gen_loadstore.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "../compiler_ir.h" -#include "ralloc_util.h" #include "codegen_util.h" +#include "compiler/compiler_ir.h" +#include "ralloc_util.h" namespace art { diff --git a/src/compiler/codegen/local_optimizations.cc b/src/compiler/codegen/local_optimizations.cc index 69b5d8ef36..b6981cac03 100644 --- a/src/compiler/codegen/local_optimizations.cc +++ b/src/compiler/codegen/local_optimizations.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "../compiler_internals.h" +#include "compiler/compiler_internals.h" namespace art { diff --git a/src/compiler/codegen/mips/assemble_mips.cc b/src/compiler/codegen/mips/assemble_mips.cc index c0ed3b68ba..34a91b08e2 100644 --- a/src/compiler/codegen/mips/assemble_mips.cc +++ b/src/compiler/codegen/mips/assemble_mips.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "mips_lir.h" #include "codegen_mips.h" -#include "../codegen_util.h" +#include "compiler/codegen/codegen_util.h" +#include "mips_lir.h" namespace art { diff --git a/src/compiler/codegen/mips/call_mips.cc b/src/compiler/codegen/mips/call_mips.cc index 76c9fbd393..39fdc0335a 100644 --- a/src/compiler/codegen/mips/call_mips.cc +++ b/src/compiler/codegen/mips/call_mips.cc @@ -16,11 +16,11 @@ /* This file contains codegen for the Mips ISA */ -#include "oat/runtime/oat_support_entrypoints.h" -#include "mips_lir.h" #include "codegen_mips.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "mips_lir.h" +#include "oat/runtime/oat_support_entrypoints.h" namespace art { diff --git a/src/compiler/codegen/mips/codegen_mips.h b/src/compiler/codegen/mips/codegen_mips.h index fcd5669422..705ecfa393 100644 --- a/src/compiler/codegen/mips/codegen_mips.h +++ b/src/compiler/codegen/mips/codegen_mips.h @@ -17,7 +17,8 @@ #ifndef ART_SRC_COMPILER_CODEGEN_MIPS_CODEGENMIPS_H_ #define ART_SRC_COMPILER_CODEGEN_MIPS_CODEGENMIPS_H_ -#include "../../compiler_internals.h" +#include "compiler/compiler_internals.h" +#include "mips_lir.h" namespace art { diff --git a/src/compiler/codegen/mips/fp_mips.cc b/src/compiler/codegen/mips/fp_mips.cc index 6ffc5e0e3e..e7b106e87a 100644 --- a/src/compiler/codegen/mips/fp_mips.cc +++ b/src/compiler/codegen/mips/fp_mips.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "oat/runtime/oat_support_entrypoints.h" -#include "mips_lir.h" #include "codegen_mips.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "mips_lir.h" +#include "oat/runtime/oat_support_entrypoints.h" namespace art { diff --git a/src/compiler/codegen/mips/int_mips.cc b/src/compiler/codegen/mips/int_mips.cc index 86f0527bf1..7da4cf684b 100644 --- a/src/compiler/codegen/mips/int_mips.cc +++ b/src/compiler/codegen/mips/int_mips.cc @@ -16,11 +16,11 @@ /* This file contains codegen for the Mips ISA */ -#include "oat/runtime/oat_support_entrypoints.h" -#include "mips_lir.h" #include "codegen_mips.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "mips_lir.h" +#include "oat/runtime/oat_support_entrypoints.h" namespace art { diff --git a/src/compiler/codegen/mips/mips_lir.h b/src/compiler/codegen/mips/mips_lir.h index cecd4ab3ff..41e598fa39 100644 --- a/src/compiler/codegen/mips/mips_lir.h +++ b/src/compiler/codegen/mips/mips_lir.h @@ -17,7 +17,7 @@ #ifndef ART_COMPILER_COMPILER_CODEGEN_MIPS_MIPSLIR_H_ #define ART_COMPILER_COMPILER_CODEGEN_MIPS_MIPSLIR_H_ -#include "../../compiler_internals.h" +#include "compiler/compiler_internals.h" namespace art { diff --git a/src/compiler/codegen/mips/target_mips.cc b/src/compiler/codegen/mips/target_mips.cc index 3bb46896a5..de19ac08a9 100644 --- a/src/compiler/codegen/mips/target_mips.cc +++ b/src/compiler/codegen/mips/target_mips.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "../../compiler_internals.h" -#include "mips_lir.h" #include "codegen_mips.h" -#include "../ralloc_util.h" -#include "../codegen_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/compiler_internals.h" +#include "compiler/codegen/ralloc_util.h" +#include "mips_lir.h" #include <string> diff --git a/src/compiler/codegen/mips/utility_mips.cc b/src/compiler/codegen/mips/utility_mips.cc index 4d4be7600b..1e217fbe75 100644 --- a/src/compiler/codegen/mips/utility_mips.cc +++ b/src/compiler/codegen/mips/utility_mips.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "mips_lir.h" #include "codegen_mips.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "mips_lir.h" namespace art { diff --git a/src/compiler/codegen/mir_to_gbc.cc b/src/compiler/codegen/mir_to_gbc.cc index 2657b791ac..f67f760d40 100644 --- a/src/compiler/codegen/mir_to_gbc.cc +++ b/src/compiler/codegen/mir_to_gbc.cc @@ -27,9 +27,9 @@ #include <llvm/Support/Casting.h> #include <llvm/Support/InstIterator.h> -#include "../compiler_internals.h" -#include "local_optimizations.h" #include "codegen_util.h" +#include "compiler/compiler_internals.h" +#include "local_optimizations.h" #include "ralloc_util.h" static const char* kLabelFormat = "%c0x%x_%d"; diff --git a/src/compiler/codegen/mir_to_lir.cc b/src/compiler/codegen/mir_to_lir.cc index 77d581fd6e..bd26f2d64e 100644 --- a/src/compiler/codegen/mir_to_lir.cc +++ b/src/compiler/codegen/mir_to_lir.cc @@ -16,7 +16,7 @@ #include "object_utils.h" -#include "../compiler_internals.h" +#include "compiler/compiler_internals.h" #include "local_optimizations.h" #include "codegen_util.h" #include "ralloc_util.h" diff --git a/src/compiler/codegen/ralloc_util.cc b/src/compiler/codegen/ralloc_util.cc index accf676fd7..afd49768d0 100644 --- a/src/compiler/codegen/ralloc_util.cc +++ b/src/compiler/codegen/ralloc_util.cc @@ -16,11 +16,11 @@ /* This file contains register alloction support. */ -#include "../compiler_utility.h" -#include "../compiler_ir.h" -#include "../dataflow.h" -#include "ralloc_util.h" #include "codegen_util.h" +#include "compiler/compiler_ir.h" +#include "compiler/compiler_utility.h" +#include "compiler/dataflow.h" +#include "ralloc_util.h" namespace art { diff --git a/src/compiler/codegen/ralloc_util.h b/src/compiler/codegen/ralloc_util.h index 3526f4cd20..a5ed9999da 100644 --- a/src/compiler/codegen/ralloc_util.h +++ b/src/compiler/codegen/ralloc_util.h @@ -21,9 +21,9 @@ * This file contains target independent register alloction support. */ -#include "../compiler_ir.h" -#include "../dataflow.h" -#include "../compiler_utility.h" +#include "compiler/compiler_ir.h" +#include "compiler/compiler_utility.h" +#include "compiler/dataflow.h" namespace art { diff --git a/src/compiler/codegen/x86/assemble_x86.cc b/src/compiler/codegen/x86/assemble_x86.cc index 2b33090d05..1fa2352d78 100644 --- a/src/compiler/codegen/x86/assemble_x86.cc +++ b/src/compiler/codegen/x86/assemble_x86.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "x86_lir.h" #include "codegen_x86.h" -#include "../codegen_util.h" +#include "compiler/codegen/codegen_util.h" +#include "x86_lir.h" namespace art { diff --git a/src/compiler/codegen/x86/call_x86.cc b/src/compiler/codegen/x86/call_x86.cc index f9b25c844c..4209375b9d 100644 --- a/src/compiler/codegen/x86/call_x86.cc +++ b/src/compiler/codegen/x86/call_x86.cc @@ -16,10 +16,10 @@ /* This file contains codegen for the X86 ISA */ -#include "x86_lir.h" #include "codegen_x86.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "x86_lir.h" namespace art { diff --git a/src/compiler/codegen/x86/codegen_x86.h b/src/compiler/codegen/x86/codegen_x86.h index 25f4461237..141638cf1a 100644 --- a/src/compiler/codegen/x86/codegen_x86.h +++ b/src/compiler/codegen/x86/codegen_x86.h @@ -17,7 +17,7 @@ #ifndef ART_SRC_COMPILER_CODEGEN_X86_CODEGENX86_H_ #define ART_SRC_COMPILER_CODEGEN_X86_CODEGENX86_H_ -#include "../../compiler_internals.h" +#include "compiler/compiler_internals.h" #include "x86_lir.h" namespace art { diff --git a/src/compiler/codegen/x86/fp_x86.cc b/src/compiler/codegen/x86/fp_x86.cc index 6bfe9a2e6f..00c2f536d5 100644 --- a/src/compiler/codegen/x86/fp_x86.cc +++ b/src/compiler/codegen/x86/fp_x86.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "x86_lir.h" #include "codegen_x86.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "x86_lir.h" namespace art { diff --git a/src/compiler/codegen/x86/int_x86.cc b/src/compiler/codegen/x86/int_x86.cc index f2d023cbad..0ae51e0e23 100644 --- a/src/compiler/codegen/x86/int_x86.cc +++ b/src/compiler/codegen/x86/int_x86.cc @@ -16,10 +16,10 @@ /* This file contains codegen for the X86 ISA */ -#include "x86_lir.h" #include "codegen_x86.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "x86_lir.h" namespace art { diff --git a/src/compiler/codegen/x86/target_x86.cc b/src/compiler/codegen/x86/target_x86.cc index e396e54717..6cb420ce79 100644 --- a/src/compiler/codegen/x86/target_x86.cc +++ b/src/compiler/codegen/x86/target_x86.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "../../compiler_internals.h" -#include "x86_lir.h" #include "codegen_x86.h" -#include "../ralloc_util.h" -#include "../codegen_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/compiler_internals.h" +#include "compiler/codegen/ralloc_util.h" +#include "x86_lir.h" #include <string> diff --git a/src/compiler/codegen/x86/utility_x86.cc b/src/compiler/codegen/x86/utility_x86.cc index ce55b4bf22..4f9e28b444 100644 --- a/src/compiler/codegen/x86/utility_x86.cc +++ b/src/compiler/codegen/x86/utility_x86.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "x86_lir.h" #include "codegen_x86.h" -#include "../codegen_util.h" -#include "../ralloc_util.h" +#include "compiler/codegen/codegen_util.h" +#include "compiler/codegen/ralloc_util.h" +#include "x86_lir.h" namespace art { diff --git a/src/compiler/codegen/x86/x86_lir.h b/src/compiler/codegen/x86/x86_lir.h index edfcd4d10e..c2722869c3 100644 --- a/src/compiler/codegen/x86/x86_lir.h +++ b/src/compiler/codegen/x86/x86_lir.h @@ -17,7 +17,7 @@ #ifndef ART_COMPILER_COMPILER_CODEGEN_X86_X86LIR_H_ #define ART_COMPILER_COMPILER_CODEGEN_X86_X86LIR_H_ -#include "../../compiler_internals.h" +#include "compiler/compiler_internals.h" namespace art { diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index 97d005c67f..72379116a2 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -19,11 +19,11 @@ #include "base/stl_util.h" #include "backend_options.h" #include "class_linker.h" -#include "compilation_unit.h" #include "compiled_method.h" #include "compiler.h" #include "ir_builder.h" #include "jni_compiler.h" +#include "llvm_compilation_unit.h" #include "method_compiler.h" #include "oat_compilation_unit.h" #include "oat_file.h" @@ -125,11 +125,11 @@ CompilerLLVM::~CompilerLLVM() { } -CompilationUnit* CompilerLLVM::AllocateCompilationUnit() { +LlvmCompilationUnit* CompilerLLVM::AllocateCompilationUnit() { MutexLock GUARD(Thread::Current(), num_cunits_lock_); - CompilationUnit* cunit = new CompilationUnit(this, num_cunits_++); + LlvmCompilationUnit* cunit = new LlvmCompilationUnit(this, num_cunits_++); if (!bitcode_filename_.empty()) { - cunit->SetBitcodeFileName(StringPrintf("%s-%zu", bitcode_filename_.c_str(), num_cunits_-1)); + cunit->SetBitcodeFileName(StringPrintf("%s-%zu", bitcode_filename_.c_str(), cunit->GetIndex())); } return cunit; } @@ -137,7 +137,7 @@ CompilationUnit* CompilerLLVM::AllocateCompilationUnit() { CompiledMethod* CompilerLLVM:: CompileDexMethod(OatCompilationUnit* oat_compilation_unit, InvokeType invoke_type) { - UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit()); + UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit()); #if defined(ART_USE_PORTABLE_COMPILER) std::string methodName(PrettyMethod(oat_compilation_unit->GetDexMethodIndex(), @@ -185,7 +185,7 @@ CompileDexMethod(OatCompilationUnit* oat_compilation_unit, InvokeType invoke_typ CompiledMethod* CompilerLLVM:: CompileNativeMethod(OatCompilationUnit* oat_compilation_unit) { - UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit()); + UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit()); UniquePtr<JniCompiler> jni_compiler( new JniCompiler(cunit.get(), *compiler_, oat_compilation_unit)); @@ -196,7 +196,7 @@ CompileNativeMethod(OatCompilationUnit* oat_compilation_unit) { CompiledInvokeStub* CompilerLLVM::CreateInvokeStub(bool is_static, char const *shorty) { - UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit()); + UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit()); UniquePtr<StubCompiler> stub_compiler( new StubCompiler(cunit.get(), *compiler_)); @@ -206,7 +206,7 @@ CompiledInvokeStub* CompilerLLVM::CreateInvokeStub(bool is_static, CompiledInvokeStub* CompilerLLVM::CreateProxyStub(char const *shorty) { - UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit()); + UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit()); UniquePtr<StubCompiler> stub_compiler( new StubCompiler(cunit.get(), *compiler_)); diff --git a/src/compiler_llvm/compiler_llvm.h b/src/compiler_llvm/compiler_llvm.h index bb14c49163..b11ce121f4 100644 --- a/src/compiler_llvm/compiler_llvm.h +++ b/src/compiler_llvm/compiler_llvm.h @@ -55,7 +55,7 @@ namespace llvm { namespace art { namespace compiler_llvm { -class CompilationUnit; +class LlvmCompilationUnit; class IRBuilder; class CompilerLLVM { @@ -94,7 +94,7 @@ class CompilerLLVM { } private: - CompilationUnit* AllocateCompilationUnit(); + LlvmCompilationUnit* AllocateCompilationUnit(); Compiler* compiler_; diff --git a/src/compiler_llvm/jni_compiler.cc b/src/compiler_llvm/jni_compiler.cc index fdd2b43358..8d49aba971 100644 --- a/src/compiler_llvm/jni_compiler.cc +++ b/src/compiler_llvm/jni_compiler.cc @@ -18,11 +18,11 @@ #include "base/logging.h" #include "class_linker.h" -#include "compilation_unit.h" #include "compiled_method.h" #include "compiler.h" #include "compiler_llvm.h" #include "ir_builder.h" +#include "llvm_compilation_unit.h" #include "mirror/abstract_method.h" #include "oat_compilation_unit.h" #include "runtime.h" @@ -42,7 +42,7 @@ namespace compiler_llvm { using namespace runtime_support; -JniCompiler::JniCompiler(CompilationUnit* cunit, +JniCompiler::JniCompiler(LlvmCompilationUnit* cunit, Compiler const& compiler, OatCompilationUnit* oat_compilation_unit) : cunit_(cunit), compiler_(&compiler), module_(cunit_->GetModule()), diff --git a/src/compiler_llvm/jni_compiler.h b/src/compiler_llvm/jni_compiler.h index 0731e92a52..46481802b5 100644 --- a/src/compiler_llvm/jni_compiler.h +++ b/src/compiler_llvm/jni_compiler.h @@ -46,12 +46,12 @@ namespace llvm { namespace art { namespace compiler_llvm { -class CompilationUnit; +class LlvmCompilationUnit; class IRBuilder; class JniCompiler { public: - JniCompiler(CompilationUnit* cunit, + JniCompiler(LlvmCompilationUnit* cunit, Compiler const& compiler, OatCompilationUnit* oat_compilation_unit); @@ -64,7 +64,7 @@ class JniCompiler { bool is_static, bool is_target_function); private: - CompilationUnit* cunit_; + LlvmCompilationUnit* cunit_; const Compiler* compiler_; llvm::Module* module_; diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/llvm_compilation_unit.cc index bd2d8fc8ba..97aa6b911a 100644 --- a/src/compiler_llvm/compilation_unit.cc +++ b/src/compiler_llvm/llvm_compilation_unit.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "compilation_unit.h" +#include "llvm_compilation_unit.h" #include "base/logging.h" #include "compiled_method.h" @@ -89,7 +89,7 @@ CreateGBCExpanderPass(const greenland::IntrinsicHelper& intrinsic_helper, IRBuil llvm::Module* makeLLVMModuleContents(llvm::Module* module); -CompilationUnit::CompilationUnit(const CompilerLLVM* compiler_llvm, +LlvmCompilationUnit::LlvmCompilationUnit(const CompilerLLVM* compiler_llvm, size_t cunit_idx) : compiler_llvm_(compiler_llvm), cunit_idx_(cunit_idx) { #if !defined(ART_USE_PORTABLE_COMPILER) @@ -129,7 +129,7 @@ CompilationUnit::CompilationUnit(const CompilerLLVM* compiler_llvm, } -CompilationUnit::~CompilationUnit() { +LlvmCompilationUnit::~LlvmCompilationUnit() { #if defined(ART_USE_PORTABLE_COMPILER) llvm::LLVMContext* llvm_context = context_.release(); // Managed by llvm_info_ CHECK(llvm_context != NULL); @@ -137,12 +137,12 @@ CompilationUnit::~CompilationUnit() { } -InstructionSet CompilationUnit::GetInstructionSet() const { +InstructionSet LlvmCompilationUnit::GetInstructionSet() const { return compiler_llvm_->GetInstructionSet(); } -bool CompilationUnit::Materialize() { +bool LlvmCompilationUnit::Materialize() { std::string elf_image; // Compile and prelink llvm::Module @@ -170,13 +170,13 @@ bool CompilationUnit::Materialize() { } -bool CompilationUnit::MaterializeToString(std::string& str_buffer) { +bool LlvmCompilationUnit::MaterializeToString(std::string& str_buffer) { llvm::raw_string_ostream str_os(str_buffer); return MaterializeToRawOStream(str_os); } -bool CompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) { +bool LlvmCompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) { // Lookup the LLVM target std::string target_triple; std::string target_cpu; @@ -295,7 +295,7 @@ bool CompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) { return true; } -bool CompilationUnit::ExtractCodeAndPrelink(const std::string& elf_image) { +bool LlvmCompilationUnit::ExtractCodeAndPrelink(const std::string& elf_image) { if (GetInstructionSet() == kX86) { compiled_code_.push_back(0xccU); compiled_code_.push_back(0xccU); @@ -405,7 +405,7 @@ bool CompilationUnit::ExtractCodeAndPrelink(const std::string& elf_image) { // that architecture. Since the Oat writer only guarantee that the compiled // method being aligned to kArchAlignment, we have no way to align the ELf // section if the section alignment is greater than kArchAlignment. -void CompilationUnit::CheckCodeAlign(uint32_t align) const { +void LlvmCompilationUnit::CheckCodeAlign(uint32_t align) const { InstructionSet insn_set = GetInstructionSet(); switch (insn_set) { case kThumb2: diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/llvm_compilation_unit.h index b0d072b166..af3ba7a7e0 100644 --- a/src/compiler_llvm/compilation_unit.h +++ b/src/compiler_llvm/llvm_compilation_unit.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_ -#define ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_ +#ifndef ART_SRC_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_ +#define ART_SRC_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_ #include "base/logging.h" #include "base/mutex.h" @@ -52,12 +52,9 @@ namespace compiler_llvm { class CompilerLLVM; class IRBuilder; -class CompilationUnit { +class LlvmCompilationUnit { public: - CompilationUnit(const CompilerLLVM* compiler_llvm, - size_t cunit_idx); - - ~CompilationUnit(); + ~LlvmCompilationUnit(); size_t GetIndex() const { return cunit_idx_; @@ -105,6 +102,9 @@ class CompilationUnit { } private: + LlvmCompilationUnit(const CompilerLLVM* compiler_llvm, + size_t cunit_idx); + const CompilerLLVM* compiler_llvm_; const size_t cunit_idx_; @@ -130,9 +130,11 @@ class CompilationUnit { bool MaterializeToRawOStream(llvm::raw_ostream& out_stream); bool ExtractCodeAndPrelink(const std::string& elf_image); + + friend class CompilerLLVM; // For LlvmCompilationUnit constructor }; } // namespace compiler_llvm } // namespace art -#endif // ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_ +#endif // ART_SRC_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_ diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index 76b1299b6f..47d9b015ff 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -20,11 +20,11 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/stringprintf.h" -#include "compilation_unit.h" #include "compiler.h" #include "dalvik_reg.h" #include "greenland/inferred_reg_category_map.h" #include "ir_builder.h" +#include "llvm_compilation_unit.h" #include "mirror/object.h" #include "oat_compilation_unit.h" #include "object_utils.h" @@ -46,7 +46,7 @@ namespace compiler_llvm { using namespace runtime_support; -MethodCompiler::MethodCompiler(CompilationUnit* cunit, +MethodCompiler::MethodCompiler(LlvmCompilationUnit* cunit, Compiler* compiler, OatCompilationUnit* oat_compilation_unit) : cunit_(cunit), compiler_(compiler), diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h index dd9d1829c3..4d759e501a 100644 --- a/src/compiler_llvm/method_compiler.h +++ b/src/compiler_llvm/method_compiler.h @@ -64,14 +64,14 @@ namespace llvm { namespace art { namespace compiler_llvm { -class CompilationUnit; +class LlvmCompilationUnit; class CompilerLLVM; class DalvikReg; class IRBuilder; class MethodCompiler { public: - MethodCompiler(CompilationUnit* cunit, + MethodCompiler(LlvmCompilationUnit* cunit, Compiler* compiler, OatCompilationUnit* oat_compilation_unit); @@ -447,7 +447,7 @@ class MethodCompiler { void ComputeMethodInfo(); private: - CompilationUnit* cunit_; + LlvmCompilationUnit* cunit_; Compiler* compiler_; const DexFile* dex_file_; diff --git a/src/compiler_llvm/stub_compiler.cc b/src/compiler_llvm/stub_compiler.cc index 6b2a479426..e6bee7b620 100644 --- a/src/compiler_llvm/stub_compiler.cc +++ b/src/compiler_llvm/stub_compiler.cc @@ -17,11 +17,11 @@ #include "stub_compiler.h" #include "base/logging.h" -#include "compilation_unit.h" #include "compiled_method.h" #include "compiler.h" #include "compiler_llvm.h" #include "ir_builder.h" +#include "llvm_compilation_unit.h" #include "mirror/abstract_method.h" #include "runtime_support_func.h" #include "utils_llvm.h" @@ -40,7 +40,7 @@ namespace compiler_llvm { using namespace runtime_support; -StubCompiler::StubCompiler(CompilationUnit* cunit, Compiler& compiler) +StubCompiler::StubCompiler(LlvmCompilationUnit* cunit, Compiler& compiler) : cunit_(cunit), compiler_(&compiler), module_(cunit_->GetModule()), context_(cunit_->GetLLVMContext()), irb_(*cunit_->GetIRBuilder()) { } diff --git a/src/compiler_llvm/stub_compiler.h b/src/compiler_llvm/stub_compiler.h index 9139accd68..312b3af275 100644 --- a/src/compiler_llvm/stub_compiler.h +++ b/src/compiler_llvm/stub_compiler.h @@ -33,19 +33,19 @@ namespace llvm { namespace art { namespace compiler_llvm { -class CompilationUnit; +class LlvmCompilationUnit; class CompilerLLVM; class IRBuilder; class StubCompiler { public: - StubCompiler(CompilationUnit* cunit, Compiler& compiler); + StubCompiler(LlvmCompilationUnit* cunit, Compiler& compiler); CompiledInvokeStub* CreateInvokeStub(bool is_static, const char* shorty); CompiledInvokeStub* CreateProxyStub(const char* shorty); private: - CompilationUnit* cunit_; + LlvmCompilationUnit* cunit_; const Compiler* compiler_; llvm::Module* module_; llvm::LLVMContext* context_; |