diff options
author | 2021-07-09 17:06:03 +0100 | |
---|---|---|
committer | 2021-09-13 17:54:53 +0000 | |
commit | 3de02fb67de386368c9fe39ab5a0133afcf1d785 (patch) | |
tree | 39b82839945a26dfb857a403effa4ba248145715 /compiler/optimizing/nodes.h | |
parent | 18074d2b59ae56dcfccea770ceb515215c8eb53f (diff) |
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
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 7 |
1 files changed, 7 insertions, 0 deletions
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<kArenaAllocGraph> { 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); } |