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
diff --git a/runtime/stack.cc b/runtime/stack.cc
index c83814a..7b70d41 100644
--- a/runtime/stack.cc
+++ b/runtime/stack.cc
@@ -778,15 +778,6 @@
// (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);