diff options
author | Ian Rogers <irogers@google.com> | 2014-05-06 16:20:11 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-05-06 16:23:19 -0700 |
commit | 72d32629303f8f39362a4099481f48646aed042f (patch) | |
tree | 0ff613168c3bf2e12799594c9211f9a1694119e2 /compiler/compilers.h | |
parent | 47ebd77a6d249403a34d242908749b7446da2a82 (diff) | |
download | art-72d32629303f8f39362a4099481f48646aed042f.tar.gz art-72d32629303f8f39362a4099481f48646aed042f.tar.bz2 art-72d32629303f8f39362a4099481f48646aed042f.zip |
Give Compiler a back reference to the driver.
The compiler driver is a single object delegating work to the compiler, rather
than passing it through to every Compiler call make it a member of Compiler so
that it maybe queried. This simplifies the Compiler API and makes the
relationship to CompilerDriver more explicit.
Remove reference arguments that contravene code style.
Change-Id: Iba47f2e3cbda679a7ec7588f26188d77643aa2c6
Diffstat (limited to 'compiler/compilers.h')
-rw-r--r-- | compiler/compilers.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/compiler/compilers.h b/compiler/compilers.h index 255dd23f3..3ca78c94c 100644 --- a/compiler/compilers.h +++ b/compiler/compilers.h @@ -23,14 +23,13 @@ namespace art { class QuickCompiler : public Compiler { public: - QuickCompiler() : Compiler(100) {} + explicit QuickCompiler(CompilerDriver* driver) : Compiler(driver, 100) {} - void Init(CompilerDriver& driver) const OVERRIDE; + void Init() const OVERRIDE; - void UnInit(CompilerDriver& driver) const OVERRIDE; + void UnInit() const OVERRIDE; - CompiledMethod* Compile(CompilerDriver& driver, - const DexFile::CodeItem* code_item, + CompiledMethod* Compile(const DexFile::CodeItem* code_item, uint32_t access_flags, InvokeType invoke_type, uint16_t class_def_idx, @@ -38,8 +37,7 @@ class QuickCompiler : public Compiler { jobject class_loader, const DexFile& dex_file) const OVERRIDE; - CompiledMethod* JniCompile(CompilerDriver& driver, - uint32_t access_flags, + CompiledMethod* JniCompile(uint32_t access_flags, uint32_t method_idx, const DexFile& dex_file) const OVERRIDE; @@ -50,7 +48,7 @@ class QuickCompiler : public Compiler { OatWriter* oat_writer, const std::vector<const art::DexFile*>& dex_files, const std::string& android_root, - bool is_host, const CompilerDriver& driver) const + bool is_host) const OVERRIDE SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); @@ -73,12 +71,11 @@ class QuickCompiler : public Compiler { DISALLOW_COPY_AND_ASSIGN(QuickCompiler); }; -class OptimizingCompiler : public QuickCompiler { +class OptimizingCompiler FINAL : public QuickCompiler { public: - OptimizingCompiler() { } + explicit OptimizingCompiler(CompilerDriver* driver) : QuickCompiler(driver) { } - CompiledMethod* Compile(CompilerDriver& driver, - const DexFile::CodeItem* code_item, + CompiledMethod* Compile(const DexFile::CodeItem* code_item, uint32_t access_flags, InvokeType invoke_type, uint16_t class_def_idx, @@ -86,8 +83,7 @@ class OptimizingCompiler : public QuickCompiler { jobject class_loader, const DexFile& dex_file) const OVERRIDE; - CompiledMethod* TryCompile(CompilerDriver& driver, - const DexFile::CodeItem* code_item, + CompiledMethod* TryCompile(const DexFile::CodeItem* code_item, uint32_t access_flags, InvokeType invoke_type, uint16_t class_def_idx, |