summaryrefslogtreecommitdiff
path: root/compiler/optimizing/cha_guard_optimization.cc
diff options
context:
space:
mode:
author Stelios Ioannou <stelios.ioannou@linaro.org> 2021-07-09 17:06:03 +0100
committer Treehugger Robot <treehugger-gerrit@google.com> 2022-06-08 14:06:51 +0000
commitc54cc7cb18262fe77ed8da6a56acbf00d5bc5a71 (patch)
tree1567e04711f45ddee7ab65c27a38fa9f7f17f7d5 /compiler/optimizing/cha_guard_optimization.cc
parent4ea489a240cf6d241a7b0313c2981bf5f32f7d7f (diff)
Revert^2 "ART: Removes SuspendCheck for plain
loops with a low trip count." This change removes SuspendCheck for plain loops with a low trip count. The SuspendCheck in the codegen makes sure that the thread can be interrupted during execution for GC. Not being able to do so might decrease the responsiveness of GC in the case when a very long loop or a long recursion is being executed. However, for plain loops with a small trip count, the removal of SuspendCheck should not affect the GC's responsiveness by a large margin. Consequently, since the thread won't be interrupted for plain loops, it is assumed that the performance might increase by removing SuspendCheck. Also add explicit checks to existing code to ensure that SuspendCheck is never null when it is used. This reverts commit 8f6b99fba2d043265a84d599a967d52f66738ad6 Reason for revert: Included fix for CHAGuardVisitor::HoistGuard crash by disabling codegen for optimized SuspendCheck nodes instead of removing the SuspendCheck node itself. Test: art/test.py -v -j12 --host --64 -t 2233-checker\ -remove-loop-suspend-check --run-test --optimizing Change-Id: Id6296aded91e1cf49b8f3f339dc83613cbedf876
Diffstat (limited to 'compiler/optimizing/cha_guard_optimization.cc')
-rw-r--r--compiler/optimizing/cha_guard_optimization.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/optimizing/cha_guard_optimization.cc b/compiler/optimizing/cha_guard_optimization.cc
index c6232ef661..d231593792 100644
--- a/compiler/optimizing/cha_guard_optimization.cc
+++ b/compiler/optimizing/cha_guard_optimization.cc
@@ -200,6 +200,7 @@ bool CHAGuardVisitor::HoistGuard(HShouldDeoptimizeFlag* flag,
block->RemoveInstruction(deopt);
HInstruction* suspend = loop_info->GetSuspendCheck();
+ DCHECK(suspend != nullptr);
// Need a new deoptimize instruction that copies the environment
// of the suspend instruction for the loop.
HDeoptimize* deoptimize = new (GetGraph()->GetAllocator()) HDeoptimize(