Make ScopedAssertNoThreadSuspension no overhead for non-debug
Previously it required Thread::Current() which may not be free.
The plan is to add a lot more ScopedAssertNoThreadSuspension in
the codebase.
Also cleaned up callers.
Bug: 31458474
Change-Id: I5a1621a5435476504d22266cc01a9bf26aab7568
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index c979c28..b69f06b 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -784,7 +784,7 @@
}
// Though GetDirectInterface() should not cause thread suspension when called
// from here, it takes a Handle as an argument, so we need to wrap `k`.
- ScopedAssertNoThreadSuspension ants(self, __FUNCTION__);
+ ScopedAssertNoThreadSuspension ants(__FUNCTION__);
StackHandleScope<1> hs(self);
Handle<mirror::Class> h_k(hs.NewHandle(k));
// Is this field in any of this class' interfaces?