Remove entry SuspendCheck for methods which only call on the slow path
We can skip SuspendCheck if the method is e.g. a leaf method with a read barrier call in the slow path.
Bug: 135477345
Test: ART tests
Change-Id: I6e04f10544ec61b46bb5763a88c28248e88193bf
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index 7bb754c..acaea71 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -605,13 +605,19 @@
}
bool CallsOnSlowPath() const {
- return call_kind_ == kCallOnSlowPath || call_kind_ == kCallOnMainAndSlowPath;
+ return OnlyCallsOnSlowPath() || CallsOnMainAndSlowPath();
}
bool OnlyCallsOnSlowPath() const {
return call_kind_ == kCallOnSlowPath;
}
+ bool NeedsSuspendCheckEntry() const {
+ // Slow path calls do not need a SuspendCheck at method entry since they go into the runtime,
+ // which we expect to either do a suspend check or return quickly.
+ return WillCall();
+ }
+
bool CallsOnMainAndSlowPath() const {
return call_kind_ == kCallOnMainAndSlowPath;
}