summaryrefslogtreecommitdiff
path: root/runtime/runtime-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime-inl.h')
-rw-r--r--runtime/runtime-inl.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/runtime-inl.h b/runtime/runtime-inl.h
index bde0d11c6f..e6cc471ae6 100644
--- a/runtime/runtime-inl.h
+++ b/runtime/runtime-inl.h
@@ -25,7 +25,9 @@
#include "base/casts.h"
#include "entrypoints/quick/callee_save_frame.h"
#include "gc_root-inl.h"
+#include "interpreter/mterp/mterp.h"
#include "obj_ptr-inl.h"
+#include "thread_list.h"
namespace art {
@@ -86,6 +88,15 @@ inline ArtMethod* Runtime::GetCalleeSaveMethodUnchecked(CalleeSaveType type)
return reinterpret_cast64<ArtMethod*>(callee_save_methods_[static_cast<size_t>(type)]);
}
+template<typename Action>
+void Runtime::DoAndMaybeSwitchInterpreter(Action lamda) {
+ MutexLock tll_mu(Thread::Current(), *Locks::thread_list_lock_);
+ lamda();
+ Runtime::Current()->GetThreadList()->ForEach([](Thread* thread, void*) {
+ thread->tls32_.use_mterp.store(interpreter::CanUseMterp());
+ }, nullptr);
+}
+
} // namespace art
#endif // ART_RUNTIME_RUNTIME_INL_H_