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/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h
index 9d76685..814adf7 100644
--- a/runtime/interpreter/interpreter_common.h
+++ b/runtime/interpreter/interpreter_common.h
@@ -147,8 +147,7 @@
jit::Jit* jit = Runtime::Current()->GetJit();
if (jit != nullptr) {
if (type == kVirtual || type == kInterface) {
- jit->InvokeVirtualOrInterface(
- self, receiver, sf_method, shadow_frame.GetDexPC(), called_method);
+ jit->InvokeVirtualOrInterface(receiver, sf_method, shadow_frame.GetDexPC(), called_method);
}
jit->AddSamples(self, sf_method, 1, /*with_backedges*/false);
}
@@ -195,7 +194,7 @@
jit::Jit* jit = Runtime::Current()->GetJit();
if (jit != nullptr) {
jit->InvokeVirtualOrInterface(
- self, receiver, shadow_frame.GetMethod(), shadow_frame.GetDexPC(), called_method);
+ receiver, shadow_frame.GetMethod(), shadow_frame.GetDexPC(), called_method);
jit->AddSamples(self, shadow_frame.GetMethod(), 1, /*with_backedges*/false);
}
instrumentation::Instrumentation* instrumentation = Runtime::Current()->GetInstrumentation();