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/code_generator.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index d7d0ffffda..1e5f1ec00f 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -610,12 +610,6 @@ void CodeGenerator::AllocateLocations(HInstruction* instruction) { } } -void CodeGenerator::MaybeRecordStat(MethodCompilationStat compilation_stat, size_t count) const { - if (stats_ != nullptr) { - stats_->RecordStat(compilation_stat, count); - } -} - std::unique_ptr CodeGenerator::Create(HGraph* graph, InstructionSet instruction_set, const InstructionSetFeatures& isa_features, @@ -1212,10 +1206,10 @@ LocationSummary* CodeGenerator::CreateThrowingSlowPathLocations(HInstruction* in void CodeGenerator::GenerateNullCheck(HNullCheck* instruction) { if (compiler_options_.GetImplicitNullChecks()) { - MaybeRecordStat(kImplicitNullCheckGenerated); + MaybeRecordStat(stats_, kImplicitNullCheckGenerated); GenerateImplicitNullCheck(instruction); } else { - MaybeRecordStat(kExplicitNullCheckGenerated); + MaybeRecordStat(stats_, kExplicitNullCheckGenerated); GenerateExplicitNullCheck(instruction); } } -- cgit v1.2.3-59-g8ed1b