ART: Disambiguate access-checks mode from lock-counting
Lock-counting (when structural locking verification failed) is a
special sub-mode of access-checks and must be disambiguated, because
we currently use access-checks mode class-wide when at least one
method soft-fails, but do not stop the compiler/JIT to compile
the "working" methods. So we may end up in the access-checks
interpreter for a working method through deopt without knowing
which locks are already held.
Bug: 28351535
(cherry picked from commit f517e283d477dd2ae229ee3f054120c6953895db)
Change-Id: I083032f064d88df8f8f0611ad8b57d1b39cd09fb
diff --git a/runtime/stack.cc b/runtime/stack.cc
index e56d35a..a5ca527 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -950,7 +950,7 @@
}
}
-void LockCountData::AddMonitorInternal(Thread* self, mirror::Object* obj) {
+void LockCountData::AddMonitor(Thread* self, mirror::Object* obj) {
if (obj == nullptr) {
return;
}
@@ -967,7 +967,7 @@
monitors_->push_back(obj);
}
-void LockCountData::RemoveMonitorInternal(Thread* self, const mirror::Object* obj) {
+void LockCountData::RemoveMonitorOrThrow(Thread* self, const mirror::Object* obj) {
if (obj == nullptr) {
return;
}
@@ -1000,7 +1000,7 @@
obj->MonitorExit(self);
}
-bool LockCountData::CheckAllMonitorsReleasedInternal(Thread* self) {
+bool LockCountData::CheckAllMonitorsReleasedOrThrow(Thread* self) {
DCHECK(self != nullptr);
if (monitors_ != nullptr) {
if (!monitors_->empty()) {