summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter_switch_impl.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2016-01-28 14:20:06 -0800
committer buzbee <buzbee@google.com> 2016-01-28 15:58:45 -0800
commit734f3aa9f758236b6f1ace6347895af90b0d813d (patch)
tree5982ad1d7df2062e0bd5deb023b39997a3a66a98 /runtime/interpreter/interpreter_switch_impl.cc
parentde31ca62015e94016155a99a268ea798ab1ef75c (diff)
Fix "Never Interpret" option for all interpreters
CL 196596 added support for an option to bypass interpretation. However, it only covers 2 our of 3 interpreters (missing mterp). This change moves the control up a level to the common interpreter entry where it will take effect before we select which interpreter to use. Also, it corrects a somewhat academic bug in that the existing code that assumes that (dex_pc == 0) means that we just entered a method. If a method's dex code internally branched to address 0, we could issue bogus method entry events. By moving this test up a level, we should avoid this situation. Note, though, that dx would never generate this pattern, and it's hard to imagine even hand-generated dex code that would trigger a deoptimization in this situation. Change-Id: I6684bbf63570e02f5b01ce423c656889a890de7d
Diffstat (limited to 'runtime/interpreter/interpreter_switch_impl.cc')
-rw-r--r--runtime/interpreter/interpreter_switch_impl.cc27
1 files changed, 0 insertions, 27 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index 56a213cd1f..f7b9cdf487 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -17,7 +17,6 @@
#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
@@ -93,32 +92,6 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item,
uint32_t dex_pc = shadow_frame.GetDexPC();
const auto* const instrumentation = Runtime::Current()->GetInstrumentation();
- if (LIKELY(dex_pc == 0)) { // We are entering the method as opposed to deoptimizing.
- if (kIsDebugBuild) {
- self->AssertNoPendingException();
- }
-
- ArtMethod* method = shadow_frame.GetMethod();
-
- if (UNLIKELY(instrumentation->HasMethodEntryListeners())) {
- instrumentation->MethodEnterEvent(self, shadow_frame.GetThisObject(code_item->ins_size_),
- 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_;
const Instruction* inst = Instruction::At(insns + dex_pc);
uint16_t inst_data;