From d4a63a2c34ff6ba3e6e7cad2bac6e971497b82df Mon Sep 17 00:00:00 2001 From: Mythri Alle Date: Thu, 15 Dec 2022 13:05:59 +0000 Subject: Remove an incorrect debug check due to removal of instrumentation stubs When validating frames during a stack walk we get the current frame information for quick frames to do some checks. When the current_oat_method_header is a nullptr we get it based on the method type. For native methods, this means that the frame is of GenericJniTrampoline. We added a check there that the available code for the method should be either GenericJniTrampoline or JITed code (because we might have JITed JNI Stubs after the invocation). We didn't expect oat code there. This was true when we used instrumentation stubs for debug / tracing support. Instrumentation stubs were installed which would run necessary entry / exit hooks and then fetch and run oat code. With the removal of instrumentation stubs we install GenericJniTrampoline when necessary. When instrumentation is no longer necessary we install the most optimized code available for the method which could be oat code. So it is possible to see oat code even when running a GenericJniTrampoline. We could expand the DCHECK by expecting oat code as well but I think that may not add much value there. Bug: 206029744 Test: art/testrunner.py -t 602 Change-Id: I8c2cc4dc854c238458480948ecd926960b9f1242 --- runtime/stack.cc | 9 --------- 1 file changed, 9 deletions(-) (limited to 'runtime/stack.cc') diff --git a/runtime/stack.cc b/runtime/stack.cc index c83814abd2..7b70d4165f 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -778,15 +778,6 @@ QuickMethodFrameInfo StackVisitor::GetCurrentQuickFrameInfo() const { // (resolution, instrumentation) trampoline; or // - fake a Generic JNI frame in art_jni_dlsym_lookup_critical_stub. DCHECK(method->IsNative()); - if (kIsDebugBuild && !method->IsCriticalNative()) { - ClassLinker* class_linker = runtime->GetClassLinker(); - const void* entry_point = runtime->GetInstrumentation()->GetCodeForInvoke(method); - CHECK(class_linker->IsQuickGenericJniStub(entry_point) || - // The current entrypoint (after filtering out trampolines) may have changed - // from GenericJNI to JIT-compiled stub since we have entered this frame. - (runtime->GetJit() != nullptr && - runtime->GetJit()->GetCodeCache()->ContainsPc(entry_point))) << method->PrettyMethod(); - } // Generic JNI frame is just like the SaveRefsAndArgs frame. // Note that HandleScope, if any, is below the frame. return RuntimeCalleeSaveFrame::GetMethodFrameInfo(CalleeSaveType::kSaveRefsAndArgs); -- cgit v1.2.3-59-g8ed1b