diff options
author | Vladimir Marko <vmarko@google.com> | 2019-02-19 15:09:35 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2019-02-20 10:40:05 +0000 |
commit | 038924b75f06b91c2a7e944196ca11f118ce182f (patch) | |
tree | fb3073918686ec6f54dce65d2697c0e46f05a272 /compiler/compiler.h | |
parent | 03c6b174a4e412e9bb62935c4ee15b5445e517f2 (diff) |
ART: Reduce dependencies on CompilerDriver.
Preparation for moving CompilerDriver and other stuff
from libart-compiler.so to dex2oat.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: Ic221ebca4b8c79dd1549316921ace655f2e3f0fe
Diffstat (limited to 'compiler/compiler.h')
-rw-r--r-- | compiler/compiler.h | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/compiler/compiler.h b/compiler/compiler.h index 8a67724de0..a496c6ced5 100644 --- a/compiler/compiler.h +++ b/compiler/compiler.h @@ -36,8 +36,9 @@ class DexCache; } // namespace mirror class ArtMethod; -class CompilerDriver; class CompiledMethod; +class CompiledMethodStorage; +class CompilerOptions; class DexFile; template<class T> class Handle; class OatWriter; @@ -50,11 +51,9 @@ class Compiler { kOptimizing }; - static Compiler* Create(CompilerDriver* driver, Kind kind); - - virtual void Init() = 0; - - virtual void UnInit() const = 0; + static Compiler* Create(const CompilerOptions& compiler_options, + CompiledMethodStorage* storage, + Kind kind); virtual bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file) const = 0; @@ -91,19 +90,6 @@ class Compiler { virtual ~Compiler() {} - /* - * @brief Generate and return Dwarf CFI initialization, if supported by the - * backend. - * @param driver CompilerDriver for this compile. - * @returns nullptr if not supported by backend or a vector of bytes for CFI DWARF - * information. - * @note This is used for backtrace information in generated code. - */ - virtual std::vector<uint8_t>* GetCallFrameInformationInitialization( - const CompilerDriver& driver ATTRIBUTE_UNUSED) const { - return nullptr; - } - // Returns whether the method to compile is such a pathological case that // it's not worth compiling. static bool IsPathologicalCase(const dex::CodeItem& code_item, @@ -111,16 +97,25 @@ class Compiler { const DexFile& dex_file); protected: - Compiler(CompilerDriver* driver, uint64_t warning) : - driver_(driver), maximum_compilation_time_before_warning_(warning) { + Compiler(const CompilerOptions& compiler_options, + CompiledMethodStorage* storage, + uint64_t warning) : + compiler_options_(compiler_options), + storage_(storage), + maximum_compilation_time_before_warning_(warning) { + } + + const CompilerOptions& GetCompilerOptions() const { + return compiler_options_; } - CompilerDriver* GetCompilerDriver() const { - return driver_; + CompiledMethodStorage* GetCompiledMethodStorage() const { + return storage_; } private: - CompilerDriver* const driver_; + const CompilerOptions& compiler_options_; + CompiledMethodStorage* const storage_; const uint64_t maximum_compilation_time_before_warning_; DISALLOW_COPY_AND_ASSIGN(Compiler); |