Fix TODO on instrumentation and add some more DCHECKs.
bug:25343683
bug:25438583
Change-Id: I232deb1b6761466b514c687ce304f61928755cdc
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index f4a5f23..2a8cf99 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -367,6 +367,10 @@
}
const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) {
+ // Our callers should make sure they don't pass the instrumentation exit pc,
+ // as this method does not look at the side instrumentation stack.
+ DCHECK_NE(pc, reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc()));
+
if (IsRuntimeMethod()) {
return nullptr;
}
@@ -434,7 +438,7 @@
}
const void* oat_entry_point = oat_method.GetQuickCode();
if (oat_entry_point == nullptr || class_linker->IsQuickGenericJniStub(oat_entry_point)) {
- DCHECK(IsNative());
+ DCHECK(IsNative()) << PrettyMethod(this);
return nullptr;
}
@@ -445,12 +449,6 @@
return method_header;
}
- if (pc == reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc())) {
- // If we're instrumenting, just return the compiled OAT code.
- // TODO(ngeoffray): Avoid this call path.
- return method_header;
- }
-
DCHECK(method_header->Contains(pc))
<< PrettyMethod(this)
<< std::hex << pc << " " << oat_entry_point