diff options
author | Wei Wang <wangw@codeaurora.org> | 2015-09-30 15:01:43 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-06 12:10:57 -0700 |
commit | 55ee5b0dc5a6d8860745b4a019c8a7301fc3587e (patch) | |
tree | a962c30e0dae3c20672e9af5e4ef99a085e8d25f /compiler | |
parent | 6e037f8660f40fd5869f7a48f27751caaaaa626d (diff) | |
download | art-55ee5b0dc5a6d8860745b4a019c8a7301fc3587e.zip art-55ee5b0dc5a6d8860745b4a019c8a7301fc3587e.tar.gz art-55ee5b0dc5a6d8860745b4a019c8a7301fc3587e.tar.bz2 |
ART: move the check bail flag out of class
minor code refactoring. move the flag out of class declaration
Change-Id: I65ae1601a282f2755ce31fe58364dd025718ff6d
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/dex/quick/quick_compiler.cc | 8 | ||||
-rw-r--r-- | compiler/dex/quick/quick_compiler.h | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/compiler/dex/quick/quick_compiler.cc b/compiler/dex/quick/quick_compiler.cc index 7bec181..43f96d9 100644 --- a/compiler/dex/quick/quick_compiler.cc +++ b/compiler/dex/quick/quick_compiler.cc @@ -59,6 +59,9 @@ static_assert(5U == static_cast<size_t>(kX86_64), "kX86_64 not 5"); static_assert(6U == static_cast<size_t>(kMips), "kMips not 6"); static_assert(7U == static_cast<size_t>(kMips64), "kMips64 not 7"); +// check the pass status for early bail out +thread_local bool check_bail_out; + // Additional disabled optimizations (over generally disabled) per instruction set. static constexpr uint32_t kDisabledOptimizationsPerISA[] = { // 0 = kNone. @@ -730,11 +733,11 @@ CompiledMethod* QuickCompiler::Compile(const DexFile::CodeItem* code_item, PassDriverMEOpts pass_driver(GetPreOptPassManager(), GetPostOptPassManager(), &cu); pass_driver.Launch(); - if (GetCheckBailOutFlag() && cu.mir_graph->PassFailed()) { + if (check_bail_out && cu.mir_graph->PassFailed()) { return nullptr; } - if (GetCheckBailOutFlag()) { + if (check_bail_out) { VLOG(compiler) << "fast compile applied to " << PrettyMethod(method_idx, dex_file); } @@ -866,7 +869,6 @@ QuickCompiler::QuickCompiler(CompilerDriver* driver) : Compiler(driver, 100) { if (pass_manager_options->GetPrintPassOptions()) { PassDriverMEPostOpt::PrintPassOptions(post_opt_pass_manager_.get()); } - check_bail_out_ = false; } QuickCompiler::~QuickCompiler() { diff --git a/compiler/dex/quick/quick_compiler.h b/compiler/dex/quick/quick_compiler.h index ac2d11b..e545b55 100644 --- a/compiler/dex/quick/quick_compiler.h +++ b/compiler/dex/quick/quick_compiler.h @@ -73,17 +73,12 @@ class QuickCompiler : public Compiler { bool CheckMoreConditions(CompilationUnit* cu) const QC_WEAK; - void SetCheckBailOutFlag() { check_bail_out_ = true; } - void ResetCheckBailOutFlag() { check_bail_out_ = false; } - bool GetCheckBailOutFlag() const { return check_bail_out_; } - protected: explicit QuickCompiler(CompilerDriver* driver); private: std::unique_ptr<PassManager> pre_opt_pass_manager_; std::unique_ptr<PassManager> post_opt_pass_manager_; - bool check_bail_out_; DISALLOW_COPY_AND_ASSIGN(QuickCompiler); }; |