From 26aef1213dbdd7ab03688d898cf802c8c8d7e610 Mon Sep 17 00:00:00 2001 From: Mythri Alle Date: Wed, 13 Jul 2022 07:17:56 +0000 Subject: Revert "Introduce a flag to check if JITed code has instrumentation support" This reverts commit fc067a360d14db5f84fd4b58e0dee6cb04ee759b. Reason for revert: test failures on jit-on-first-use: https://android-build.googleplex.com/builds/submitted/8821659/art-jit-on-first-use/latest/view/logs/build_error.log Change-Id: Ie9bc243baac777ecc4f47cc961494ca6ab3ef4c6 --- compiler/jni/quick/jni_compiler.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'compiler/jni/quick/jni_compiler.cc') diff --git a/compiler/jni/quick/jni_compiler.cc b/compiler/jni/quick/jni_compiler.cc index 42072eb6e0..d672500126 100644 --- a/compiler/jni/quick/jni_compiler.cc +++ b/compiler/jni/quick/jni_compiler.cc @@ -103,19 +103,19 @@ static JniCompiledMethod ArtJniCompileMethodInternal(const CompilerOptions& comp // i.e. if the method was annotated with @CriticalNative const bool is_critical_native = (access_flags & kAccCriticalNative) != 0u; - bool needs_entry_exit_hooks = - compiler_options.GetDebuggable() && compiler_options.IsJitCompiler(); - // We don't support JITing stubs for critical native methods in debuggable runtimes yet. - // TODO(mythria): Add support required for calling method entry / exit hooks from critical native - // methods. - DCHECK_IMPLIES(needs_entry_exit_hooks, !is_critical_native); - // When walking the stack the top frame doesn't have a pc associated with it. We then depend on // the invariant that we don't have JITed code when AOT code is available. In debuggable runtimes // this invariant doesn't hold. So we tag the SP for JITed code to indentify if we are executing // JITed code or AOT code. Since tagging involves additional instructions we tag only in // debuggable runtimes. - bool should_tag_sp = needs_entry_exit_hooks; + bool should_tag_sp = compiler_options.GetDebuggable() && compiler_options.IsJitCompiler(); + + // We don't JIT stubs for critical native methods in debuggable runtimes. + // TODO(mythria): Add support required for calling method entry / exit hooks from critical native + // methods. + bool needs_entry_exit_hooks = compiler_options.GetDebuggable() && + compiler_options.IsJitCompiler() && + !is_critical_native; VLOG(jni) << "JniCompile: Method :: " << dex_file.PrettyMethod(method_idx, /* with signature */ true) -- cgit v1.2.3-59-g8ed1b