diff options
Diffstat (limited to 'compiler/dex/mir_analysis.cc')
-rw-r--r-- | compiler/dex/mir_analysis.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc index 8472a3c011..8597172881 100644 --- a/compiler/dex/mir_analysis.cc +++ b/compiler/dex/mir_analysis.cc @@ -1032,6 +1032,14 @@ bool MIRGraph::SkipCompilation(Runtime::CompilerFilter compiler_filter) { */ if (GetNumDalvikInsns() > Runtime::Current()->GetHugeMethodThreshold()) { skip_compilation = true; + // If we're got a huge number of basic blocks, don't bother with further analysis. + if (static_cast<size_t>(num_blocks_) > (Runtime::Current()->GetHugeMethodThreshold() / 2)) { + return true; + } + } else if (GetNumDalvikInsns() > Runtime::Current()->GetLargeMethodThreshold() && + /* If it's large and contains no branches, it's likely to be machine generated initialization */ + (GetBranchCount() == 0)) { + return true; } else if (compiler_filter == Runtime::kSpeed) { // If not huge, compile. return false; |