From 3de02fb67de386368c9fe39ab5a0133afcf1d785 Mon Sep 17 00:00:00 2001 From: Stelios Ioannou Date: Fri, 9 Jul 2021 17:06:03 +0100 Subject: 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. Test: art/test.py -v -j12 --host --64 -t 2233-checker\ -remove-loop-suspend-check --run-test --optimizing Change-Id: Ic9f1387059669645ad836d8277bfbc7553aa6e2f --- compiler/optimizing/nodes.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 69ca520f5a..d6b3726fe1 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -675,6 +675,13 @@ class HGraph : public ArenaObject { return cha_single_implementation_list_; } + // In case of OSR we intend to use SuspendChecks as an entry point to the + // function; for debuggable graphs we might deoptimize to interpreter from + // SuspendChecks. In these cases we shouldn't remove them. + bool SuspendChecksAreAllowedToBeRemoved() const { + return !IsDebuggable() && !IsCompilingOsr(); + } + void AddCHASingleImplementationDependency(ArtMethod* method) { cha_single_implementation_list_.insert(method); } -- cgit v1.2.3-59-g8ed1b