From 55ee5b0dc5a6d8860745b4a019c8a7301fc3587e Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 30 Sep 2015 15:01:43 -0700 Subject: ART: move the check bail flag out of class minor code refactoring. move the flag out of class declaration Change-Id: I65ae1601a282f2755ce31fe58364dd025718ff6d --- compiler/dex/quick/quick_compiler.cc | 8 +++++--- compiler/dex/quick/quick_compiler.h | 5 ----- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'compiler') 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(kX86_64), "kX86_64 not 5"); static_assert(6U == static_cast(kMips), "kMips not 6"); static_assert(7U == static_cast(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 pre_opt_pass_manager_; std::unique_ptr post_opt_pass_manager_; - bool check_bail_out_; DISALLOW_COPY_AND_ASSIGN(QuickCompiler); }; -- cgit v1.1