diff options
| author | 2016-01-05 17:43:17 -0800 | |
|---|---|---|
| committer | 2016-01-27 15:09:41 +0000 | |
| commit | 05d241565f36df825cf56a4f1b61bfb7e4dcb056 (patch) | |
| tree | 4b74483b1c26640c6ca150fbf4d070c7a3a518f0 /runtime/interpreter/interpreter_switch_impl.cc | |
| parent | f032f3afe513093c508434b17ff1921a114c4424 (diff) | |
Add option to never interpret.
Change-Id: Ib6d6170fa60c77c2e6a8844964f14fa0de4c9e7b
Diffstat (limited to 'runtime/interpreter/interpreter_switch_impl.cc')
| -rw-r--r-- | runtime/interpreter/interpreter_switch_impl.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc index c3b75b29e7..56a213cd1f 100644 --- a/runtime/interpreter/interpreter_switch_impl.cc +++ b/runtime/interpreter/interpreter_switch_impl.cc @@ -17,6 +17,7 @@ #include "base/stl_util.h" // MakeUnique #include "experimental_flags.h" #include "interpreter_common.h" +#include "jit/jit.h" #include "safe_math.h" #include <memory> // std::unique_ptr @@ -96,9 +97,26 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, if (kIsDebugBuild) { self->AssertNoPendingException(); } + + ArtMethod* method = shadow_frame.GetMethod(); + if (UNLIKELY(instrumentation->HasMethodEntryListeners())) { instrumentation->MethodEnterEvent(self, shadow_frame.GetThisObject(code_item->ins_size_), - shadow_frame.GetMethod(), 0); + method, 0); + } + + if (UNLIKELY(Runtime::Current()->GetJit() != nullptr && + Runtime::Current()->GetJit()->JitAtFirstUse() && + method->HasAnyCompiledCode())) { + JValue result; + + // Pop the shadow frame before calling into compiled code. + self->PopShadowFrame(); + ArtInterpreterToCompiledCodeBridge(self, code_item, &shadow_frame, &result); + // Push the shadow frame back as the caller will expect it. + self->PushShadowFrame(&shadow_frame); + + return result; } } const uint16_t* const insns = code_item->insns_; |