ART: Clean up compiler
Clean up the compiler: less extern functions, dis-entangle
compilers, hide some compiler specifics, lower global includes.
Change-Id: Ibaf88d02505d86994d7845cf0075be5041cc8438
diff --git a/compiler/compiler.h b/compiler/compiler.h
index 4caebf3..05fa858 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -26,13 +26,19 @@
struct CompilationUnit;
class CompilerDriver;
class CompiledMethod;
-class MIRGraph;
class OatWriter;
namespace mirror {
class ArtMethod;
}
+// Base class for compiler-specific thread-local storage for compiler worker threads
+class CompilerTls {
+ public:
+ CompilerTls() {}
+ ~CompilerTls() {}
+};
+
class Compiler {
public:
enum Kind {
@@ -47,6 +53,9 @@
virtual void UnInit() const = 0;
+ virtual bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file, CompilationUnit* cu)
+ const = 0;
+
virtual CompiledMethod* Compile(const DexFile::CodeItem* code_item,
uint32_t access_flags,
InvokeType invoke_type,
@@ -109,6 +118,10 @@
return nullptr;
}
+ virtual CompilerTls* CreateNewCompilerTls() {
+ return nullptr;
+ }
+
protected:
explicit Compiler(CompilerDriver* driver, uint64_t warning) :
driver_(driver), maximum_compilation_time_before_warning_(warning) {