summaryrefslogtreecommitdiffstats
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-02-14 18:37:08 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-02-18 10:03:48 +0000
commitf5df8974173124faddb8e2b6a331959afdb94fdf (patch)
tree26114bf466b445c60176b06a2f8a01f1e14e9358 /compiler/driver/compiler_driver.h
parent32a6c7f3bd76bbe574675d44b7d8076995690a5b (diff)
downloadart-f5df8974173124faddb8e2b6a331959afdb94fdf.zip
art-f5df8974173124faddb8e2b6a331959afdb94fdf.tar.gz
art-f5df8974173124faddb8e2b6a331959afdb94fdf.tar.bz2
Rewrite the compiler interface for CompilerDriver.
Change-Id: I15fa9afe7ffb7283ebda8d788a1e02793e3f75a6
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h34
1 files changed, 7 insertions, 27 deletions
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<CompilerBackend> 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.