Quick compiler: Single .so for all targets
With this CL, all targets can be built into a single .so (but
we're not yet doing so - the compiler driver needs to be reworked).
A new Codgen class is introduced (see compiler/codegen/codegen.h),
along with target-specific sub-classes ArmCodegen, MipsCodegens and
X86Codegen (see compiler/codegen/*/codegen_[Arm|Mips|X86].h).
Additional minor code, comment and format refactoring. Some source
files combined, temporary header files deleted and a few file
renames to better identify their function.
Next up is combining the Quick and Portable .so files.
Note: building all targets into libdvm-compiler.so increases its
size by 140K bytes. I'm inclined to not bother introducing conditional
compilation to limit code to the specific target - the added build and
testing complexity doesn't doesn't seem worth such a modest size savings.
Change-Id: Id9c5b4502ad6b77cdb31f71d3126f51a4f2e9dfe
diff --git a/src/compiler.cc b/src/compiler.cc
index e730f9d..818b412 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -340,7 +340,28 @@
init_compiler_context(*this);
jni_compiler_ = FindFunction<JniCompilerFn>(compiler_so_name, compiler_library_, "ArtJniCompileMethod");
- create_invoke_stub_ = FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateInvokeStub");
+ if ((compiler_backend_ == kPortable) || (compiler_backend_ == kIceland)){
+ create_invoke_stub_ =
+ FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateLLVMInvokeStub");
+ } else {
+ switch (instruction_set) {
+ case kArm:
+ case kThumb2:
+ create_invoke_stub_ =
+ FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateArmInvokeStub");
+ break;
+ case kMips:
+ create_invoke_stub_ =
+ FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateMipsInvokeStub");
+ break;
+ case kX86:
+ create_invoke_stub_ =
+ FindFunction<CreateInvokeStubFn>(compiler_so_name, compiler_library_, "ArtCreateX86InvokeStub");
+ break;
+ default:
+ LOG(FATAL) << "Unknown InstructionSet: " << instruction_set;
+ }
+ }
if ((compiler_backend_ == kPortable) || (compiler_backend_ == kIceland)) {
create_proxy_stub_ = FindFunction<CreateProxyStubFn>(