summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2022-06-27 11:09:49 +0000
committer Mythri Alle <mythria@google.com> 2022-07-04 07:36:40 +0000
commit6fb0acc14459a856c35b642e3368aff853259260 (patch)
tree0483c30969b98e5bfc75c7eed8ab4cef4f44a993 /compiler/optimizing/optimizing_compiler.cc
parent74e0b53a425ca3643db7dd43a39b57075853b21d (diff)
Reland "Don't use instrumentation stubs for native methods in debuggable"
This reverts commit 5c9b55aa95295a287abd86f1e7fbe98c3f35ffd6. Reason for revert: Relanding with fixes for failure Fixes: 1. Arm64 needs to use 64-bit registers 2. We cannot deoptimize directly from GenericJniEndTrampoline since we only have a refs and args frame. So call the method exit hooks from art_quick_generic_jni_trampoline. Change-Id: If1f08eca69626f60f42f10205b482a3764610846
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 6eb3d01e42..a499c55757 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1233,6 +1233,14 @@ bool OptimizingCompiler::JitCompile(Thread* self,
ArenaAllocator allocator(runtime->GetJitArenaPool());
if (UNLIKELY(method->IsNative())) {
+ // Use GenericJniTrampoline for critical native methods in debuggable runtimes. We don't
+ // support calling method entry / exit hooks for critical native methods yet.
+ // TODO(mythria): Add support for calling method entry / exit hooks in JITed stubs for critical
+ // native methods too.
+ if (runtime->IsJavaDebuggable() && method->IsCriticalNative()) {
+ DCHECK(compiler_options.IsJitCompiler());
+ return false;
+ }
JniCompiledMethod jni_compiled_method = ArtQuickJniCompileMethod(
compiler_options, access_flags, method_idx, *dex_file, &allocator);
std::vector<Handle<mirror::Object>> roots;