summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator.cc
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2016-03-16 14:05:09 +0000
committer Calin Juravle <calin@google.com> 2016-03-16 14:10:27 +0000
commit2ae48182573da7087bffc2873730bc758ec29696 (patch)
treed6955329ad876aefd477f7ef8905b070b9ab95dd /compiler/optimizing/code_generator.cc
parent6915898b28cea6c9836ca1be6814d87e89cc6d76 (diff)
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r--compiler/optimizing/code_generator.cc10
1 files changed, 10 insertions, 0 deletions
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();