From f5df8974173124faddb8e2b6a331959afdb94fdf Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 14 Feb 2014 18:37:08 +0000 Subject: Rewrite the compiler interface for CompilerDriver. Change-Id: I15fa9afe7ffb7283ebda8d788a1e02793e3f75a6 --- compiler/driver/compiler_driver.h | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) (limited to 'compiler/driver/compiler_driver.h') diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index c4ac9db..a9e029d 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -26,6 +26,7 @@ #include "class_reference.h" #include "compiled_class.h" #include "compiled_method.h" +#include "compiler_backend.h" #include "dex_file.h" #include "dex/arena_allocator.h" #include "instruction_set.h" @@ -44,21 +45,15 @@ class MethodVerifier; } // namespace verifier class AOTCompilationStats; -class ParallelCompilationManager; class DexCompilationUnit; class DexFileToMethodInlinerMap; class InlineIGetIPutData; class OatWriter; +class ParallelCompilationManager; class TimingLogger; class VerificationResults; class VerifiedMethod; -enum CompilerBackend { - kQuick, - kPortable, - kNoBackend -}; - enum EntryPointCallingConvention { // ABI of invocations to a method's interpreter entry point. kInterpreterAbi, @@ -101,7 +96,8 @@ class CompilerDriver { // classes. explicit CompilerDriver(VerificationResults* verification_results, DexFileToMethodInlinerMap* method_inliner_map, - CompilerBackend compiler_backend, InstructionSet instruction_set, + CompilerBackend::Kind compiler_backend_kind, + InstructionSet instruction_set, InstructionSetFeatures instruction_set_features, bool image, DescriptorSet* image_classes, size_t thread_count, bool dump_stats, bool dump_passes, @@ -133,8 +129,8 @@ class CompilerDriver { return instruction_set_features_; } - CompilerBackend GetCompilerBackend() const { - return compiler_backend_; + CompilerBackend* GetCompilerBackend() const { + return compiler_backend_.get(); } // Are we compiling and creating an image file? @@ -560,7 +556,7 @@ class CompilerDriver { VerificationResults* verification_results_; DexFileToMethodInlinerMap* method_inliner_map_; - CompilerBackend compiler_backend_; + UniquePtr compiler_backend_; const InstructionSet instruction_set_; const InstructionSetFeatures instruction_set_features_; @@ -601,32 +597,16 @@ class CompilerDriver { void* compiler_library_; - typedef CompiledMethod* (*CompilerFn)(CompilerDriver& driver, - const DexFile::CodeItem* code_item, - uint32_t access_flags, InvokeType invoke_type, - uint32_t class_dex_idx, uint32_t method_idx, - jobject class_loader, const DexFile& dex_file); - typedef void (*DexToDexCompilerFn)(CompilerDriver& driver, const DexFile::CodeItem* code_item, uint32_t access_flags, InvokeType invoke_type, uint32_t class_dex_idx, uint32_t method_idx, jobject class_loader, const DexFile& dex_file, DexToDexCompilationLevel dex_to_dex_compilation_level); - CompilerFn compiler_; -#ifdef ART_SEA_IR_MODE - CompilerFn sea_ir_compiler_; -#endif - DexToDexCompilerFn dex_to_dex_compiler_; void* compiler_context_; - typedef CompiledMethod* (*JniCompilerFn)(CompilerDriver& driver, - uint32_t access_flags, uint32_t method_idx, - const DexFile& dex_file); - JniCompilerFn jni_compiler_; - pthread_key_t tls_key_; // Arena pool used by the compiler. -- cgit v1.1