From 1e065a54845da12541572f4f149e6ab0dcd20180 Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Wed, 9 Aug 2017 13:20:34 -0700 Subject: optimizing: Refactor statistics to use OptimizingCompilerStats helper Remove all copies of 'MaybeRecordStat', replacing them with a single OptimizingCompilerStats::MaybeRecordStat helper. Change-Id: I83b96b41439dccece3eee2e159b18c95336ea933 --- compiler/optimizing/builder.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'compiler/optimizing/builder.cc') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 2927e1f7c0..0d9d3d4c92 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -31,12 +31,6 @@ namespace art { -void HGraphBuilder::MaybeRecordStat(MethodCompilationStat compilation_stat) { - if (compilation_stats_ != nullptr) { - compilation_stats_->RecordStat(compilation_stat); - } -} - bool HGraphBuilder::SkipCompilation(size_t number_of_branches) { if (compiler_driver_ == nullptr) { // Note that the compiler driver is null when unit testing. @@ -53,7 +47,8 @@ bool HGraphBuilder::SkipCompilation(size_t number_of_branches) { VLOG(compiler) << "Skip compilation of huge method " << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << ": " << code_item_.insns_size_in_code_units_ << " code units"; - MaybeRecordStat(MethodCompilationStat::kNotCompiledHugeMethod); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kNotCompiledHugeMethod); return true; } @@ -63,7 +58,8 @@ bool HGraphBuilder::SkipCompilation(size_t number_of_branches) { VLOG(compiler) << "Skip compilation of large method with no branch " << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex()) << ": " << code_item_.insns_size_in_code_units_ << " code units"; - MaybeRecordStat(MethodCompilationStat::kNotCompiledLargeMethodNoBranches); + MaybeRecordStat(compilation_stats_, + MethodCompilationStat::kNotCompiledLargeMethodNoBranches); return true; } -- cgit v1.2.3-59-g8ed1b