Revert "Make it possible to enable native debugging through debug flags"
The change causes issues in test-art-target-gtest-jni_internal_test32
This reverts commit c94a61f06ffc13288c67891048128c987b29bf33.
Change-Id: Iecfe3c6874d7b0dd59f10156fe2eb743ab7221dc
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 4fd3c78..0b2471b 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -27,7 +27,6 @@
#include "unstarted_runtime.h"
#include "mterp/mterp.h"
#include "jit/jit.h"
-#include "jit/jit_code_cache.h"
namespace art {
namespace interpreter {
@@ -294,10 +293,9 @@
method, 0);
}
- jit::Jit* jit = Runtime::Current()->GetJit();
- if (UNLIKELY(jit != nullptr &&
- jit->JitAtFirstUse() &&
- jit->GetCodeCache()->ContainsMethod(method))) {
+ if (UNLIKELY(Runtime::Current()->GetJit() != nullptr &&
+ Runtime::Current()->GetJit()->JitAtFirstUse() &&
+ method->HasAnyCompiledCode())) {
JValue result;
// Pop the shadow frame before calling into compiled code.
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 2c7f1fd..09d8601 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -20,7 +20,6 @@
#include "debugger.h"
#include "entrypoints/runtime_asm_entrypoints.h"
-#include "jit/jit.h"
#include "mirror/array-inl.h"
#include "stack.h"
#include "unstarted_runtime.h"
@@ -502,6 +501,23 @@
uint32_t (&arg)[kVarArgMax],
uint32_t vregC) ALWAYS_INLINE;
+SHARED_REQUIRES(Locks::mutator_lock_)
+static inline bool NeedsInterpreter(Thread* self, ShadowFrame* new_shadow_frame) ALWAYS_INLINE;
+
+static inline bool NeedsInterpreter(Thread* self, ShadowFrame* new_shadow_frame) {
+ ArtMethod* target = new_shadow_frame->GetMethod();
+ if (UNLIKELY(target->IsNative() || target->IsProxyMethod())) {
+ return false;
+ }
+ Runtime* runtime = Runtime::Current();
+ ClassLinker* class_linker = runtime->GetClassLinker();
+ return runtime->GetInstrumentation()->IsForcedInterpretOnly() ||
+ // Doing this check avoids doing compiled/interpreter transitions.
+ class_linker->IsQuickToInterpreterBridge(target->GetEntryPointFromQuickCompiledCode()) ||
+ // Force the use of interpreter when it is required by the debugger.
+ Dbg::IsForcedInterpreterNeededForCalling(self, target);
+}
+
void ArtInterpreterToCompiledCodeBridge(Thread* self,
const DexFile::CodeItem* code_item,
ShadowFrame* shadow_frame,
@@ -720,11 +736,10 @@
// Do the call now.
if (LIKELY(Runtime::Current()->IsStarted())) {
- ArtMethod* target = new_shadow_frame->GetMethod();
- if (ClassLinker::CanUseAOTCode(target, target->GetEntryPointFromQuickCompiledCode())) {
- ArtInterpreterToCompiledCodeBridge(self, code_item, new_shadow_frame, result);
- } else {
+ if (NeedsInterpreter(self, new_shadow_frame)) {
ArtInterpreterToInterpreterBridge(self, code_item, new_shadow_frame, result);
+ } else {
+ ArtInterpreterToCompiledCodeBridge(self, code_item, new_shadow_frame, result);
}
} else {
UnstartedRuntime::Invoke(self, code_item, new_shadow_frame, result, first_dest_reg);