From 2ae48182573da7087bffc2873730bc758ec29696 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 16 Mar 2016 14:05:09 +0000 Subject: Clean up NullCheck generation and record stats about it. This removes redundant code from the generators and allows for easier stat recording. Change-Id: Iccd4368f9e9d87a6fecb863dee4e2145c97851c4 --- compiler/optimizing/code_generator.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index af50363e31..4d12099e90 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -1110,6 +1110,16 @@ void CodeGenerator::MaybeRecordImplicitNullCheck(HInstruction* instr) { } } +void CodeGenerator::GenerateNullCheck(HNullCheck* instruction) { + if (IsImplicitNullCheckAllowed(instruction)) { + MaybeRecordStat(kImplicitNullCheckGenerated); + GenerateImplicitNullCheck(instruction); + } else { + MaybeRecordStat(kExplicitNullCheckGenerated); + GenerateExplicitNullCheck(instruction); + } +} + void CodeGenerator::ClearSpillSlotsFromLoopPhisInStackMap(HSuspendCheck* suspend_check) const { LocationSummary* locations = suspend_check->GetLocations(); HBasicBlock* block = suspend_check->GetBlock(); -- cgit v1.2.3-59-g8ed1b