Move some fast invoke checks to CanUseMterp
This speeds up arm64 golem interpreter benchmarks by 1.5%.
Test: test.py -b -r --interpreter --host
Change-Id: Ia9d7c885cd488de56c6b726373072070b509bdf1
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 40c7301..a152692 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -744,7 +744,7 @@
self->TransitionFromRunnableToSuspended(kNative);
- started_ = true;
+ DoAndMaybeSwitchInterpreter([=](){ started_ = true; });
if (!IsImageDex2OatEnabled() || !GetHeap()->HasBootImageSpace()) {
ScopedObjectAccess soa(self);
@@ -2488,7 +2488,8 @@
DCHECK(!jit_options_->UseJitCompilation());
}
std::string error_msg;
- jit_.reset(jit::Jit::Create(jit_options_.get(), &error_msg));
+ jit::Jit* jit = jit::Jit::Create(jit_options_.get(), &error_msg);
+ DoAndMaybeSwitchInterpreter([=](){ jit_.reset(jit); });
if (jit_.get() == nullptr) {
LOG(WARNING) << "Failed to create JIT " << error_msg;
return;