summaryrefslogtreecommitdiff
path: root/compiler/exception_test.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2022-04-22 11:01:06 +0000
committer Mythri Alle <mythria@google.com> 2022-04-22 15:29:28 +0000
commitbbbcea9ec41513a439283a6d7ad9798d7c4faa83 (patch)
treecddf2bb2f8b5c795e9d458ea9a043003b261d515 /compiler/exception_test.cc
parent79f078d87e410ed6d7b78a3afe8f7008db3601dd (diff)
Add additional checks for ArtMethod::GetOatQuickMethodHeader
We expect a non zero pc for all cases apart from runtime methods and proxy invoke handlers. Add a DCHECK to assert this case. Also assert that we would always find AOT code for non-native methods on the fallback path. This requires fixing a unit test that was passing a pc value of 0 to get the method header of existing entry point. Test: art/test.py Change-Id: I10cfa84c5b9019227d278dd511a4ea09f6aff5b2
Diffstat (limited to 'compiler/exception_test.cc')
-rw-r--r--compiler/exception_test.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/exception_test.cc b/compiler/exception_test.cc
index 495398b4b3..4471b93f17 100644
--- a/compiler/exception_test.cc
+++ b/compiler/exception_test.cc
@@ -187,14 +187,16 @@ TEST_F(ExceptionTest, StackTraceElement) {
fake_stack.push_back(0);
}
- fake_stack.push_back(method_g_->GetOatQuickMethodHeader(0)->ToNativeQuickPc(
+ OatQuickMethodHeader* header = OatQuickMethodHeader::FromEntryPoint(
+ method_g_->GetEntryPointFromQuickCompiledCode());
+ fake_stack.push_back(header->ToNativeQuickPc(
method_g_, kDexPc, /* is_for_catch_handler= */ false)); // return pc
// Create/push fake 16byte stack frame for method g
fake_stack.push_back(reinterpret_cast<uintptr_t>(method_g_));
fake_stack.push_back(0);
fake_stack.push_back(0);
- fake_stack.push_back(method_g_->GetOatQuickMethodHeader(0)->ToNativeQuickPc(
+ fake_stack.push_back(header->ToNativeQuickPc(
method_g_, kDexPc, /* is_for_catch_handler= */ false)); // return pc
// Create/push fake 16byte stack frame for method f