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/interpreter/interpreter_goto_table_impl.cc b/runtime/interpreter/interpreter_goto_table_impl.cc
index 13cfb98..f03036b 100644
--- a/runtime/interpreter/interpreter_goto_table_impl.cc
+++ b/runtime/interpreter/interpreter_goto_table_impl.cc
@@ -104,8 +104,7 @@
   } HANDLE_INSTRUCTION_END();
 
 #define HANDLE_MONITOR_CHECKS()                                                                   \
-  if (!shadow_frame.GetLockCountData().                                                           \
-          CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self)) {                        \
+  if (!DoMonitorCheckOnExit<do_assignability_check>(self, &shadow_frame)) {                       \
     HANDLE_PENDING_EXCEPTION();                                                                   \
   }
 
@@ -2584,7 +2583,7 @@
                                                                   instrumentation);
     if (found_dex_pc == DexFile::kDexNoIndex) {
       // Structured locking is to be enforced for abnormal termination, too.
-      shadow_frame.GetLockCountData().CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self);
+      DoMonitorCheckOnExit<do_assignability_check>(self, &shadow_frame);
       return JValue(); /* Handled in caller. */
     } else {
       int32_t displacement = static_cast<int32_t>(found_dex_pc) - static_cast<int32_t>(dex_pc);